Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xArchive: Not Compatible with forward slash #469

Closed
vicp-iq opened this issue Nov 28, 2018 · 4 comments · Fixed by #472
Closed

xArchive: Not Compatible with forward slash #469

vicp-iq opened this issue Nov 28, 2018 · 4 comments · Fixed by #472
Assignees
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@vicp-iq
Copy link

vicp-iq commented Nov 28, 2018

ISSUE DESCRIPTION:
When the target archive is the attached archive immediately below this, the object returned by System.IO.Compression.ZipFile is delimited by "/" rather than by "\"

MSBuild_12_WebApplicationTargets.zip

Details of the scenario you tried and the problem that is occurring

When I try to extract the attached archive, then "if ($archiveEntryFullName.EndsWith('\'))" resolves to false for the "Web/" folder and treats it as a file, and then it prints the ItemWithArchiveEntryNameIsNotFile message, and the test returns false, even though it should be true.

Verbose logs showing the problem

LCM:  [ Start  Test     ]  [[xArchive]MSBuild12WebApplicationTargets  "},
                           [[xArchive]MSBuild12WebApplicationTargets Retrieving the state of the archive with path MSBuild_12_WebApplicationTargets.zip and destination C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0..."},
                           [[xArchive]MSBuild12WebApplicationTargets A directory already exists at the destination path C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0."},
                           [[xArchive]MSBuild12WebApplicationTargets Testing if the archive at the destination path C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0 exists..."},
                           [[xArchive]MSBuild12WebApplicationTargets Opening the archive at path MSBuild_12_WebApplicationTargets.zip..."},
                           [[xArchive]MSBuild12WebApplicationTargets An item with the same name as the archive entry exists at the destination path C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0\\Web\\."},
                           [[xArchive]MSBuild12WebApplicationTargets The item at the destination path C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0\\Web\\ has the same name as a file archive entry but is not a file."},
                           [[xArchive]MSBuild12WebApplicationTargets Closing the archive at path MSBuild_12_WebApplicationTargets.zip..."},
                           [[xArchive]MSBuild12WebApplicationTargets The archive at path MSBuild_12_WebApplicationTargets.zip does not exist at the destination C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0."},
                           [[xArchive]MSBuild12WebApplicationTargets Testing whether or not the state of the archive with path MSBuild_12_WebApplicationTargets.zip and destination C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0 matches the desired state..."},
LCM:  [ End    Test     ]  [[xArchive]MSBuild12WebApplicationTargets  in 0.0330 seconds."},
LCM:  [ Start  Set      ]  [[xArchive]MSBuild12WebApplicationTargets  "},
                           [[xArchive]MSBuild12WebApplicationTargets Setting the state of the archive with path MSBuild_12_WebApplicationTargets.zip and destination C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0..."},
                           [[xArchive]MSBuild12WebApplicationTargets A directory already exists at the destination path C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0."},
                           [[xArchive]MSBuild12WebApplicationTargets Expanding the archive at MSBuild_12_WebApplicationTargets.zip to the destination C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0..."},
                           [[xArchive]MSBuild12WebApplicationTargets Opening the archive at path MSBuild_12_WebApplicationTargets.zip..."},
                           [[xArchive]MSBuild12WebApplicationTargets An item with the same name as the archive entry exists at the destination path C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v12.0\\Web\\."},
                           [[xArchive]MSBuild12WebApplicationTargets Closing the archive at path MSBuild_12_WebApplicationTargets.zip..."},
LCM:  [ End    Set      ]  [[xArchive]MSBuild12WebApplicationTargets  in 0.0460 seconds."},

Suggested solution to the issue

See https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/9fd047b90f3d74c4a83e0ae0011da1af5b916bbd/DSCResources/MSFT_xArchive/MSFT_xArchive.psm1#L1153

Update the if statement so that it checks for both "/" and "\" ?

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here

    @(12, 14) | ForEach-Object {
        xArchive "MSBuild$($_)WebApplicationTargets"
        {
            Destination = "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v$_.0"
            Path = Join-Path $InstallerPath "MSBuild_$($_)_WebApplicationTargets.zip"
        }
    }

The operating system the target node is running

OsName : Microsoft Windows Server 2016 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.2608.amd64fre.rs1_release.181024-1742
OsLanguage : en-US
OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

----                           -----                                                                                                                
PSVersion                      5.1.14393.2608                                                                                                       
PSEdition                      Desktop                                                                                                              
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                              
BuildVersion                   10.0.14393.2608                                                                                                      
CLRVersion                     4.0.30319.42000                                                                                                      
WSManStackVersion              3.0                                                                                                                  
PSRemotingProtocolVersion      2.3                                                                                                                  
SerializationVersion           1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

8.4.0.0

@stale
Copy link

stale bot commented Dec 29, 2018

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

@stale stale bot added the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Dec 29, 2018
@vicp-iq
Copy link
Author

vicp-iq commented Jan 3, 2019

So.... this issue is blocking me from upgrading....

@PlagueHO
Copy link
Member

Hi @vicp-iq - I'm going to start picking up issues in this repo so I'll start getting onto fixing this ASAP for you. Sorry about the delay!

@stale stale bot removed the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Jan 11, 2019
@vicp-iq
Copy link
Author

vicp-iq commented Jan 11, 2019

Thank you!

@PlagueHO PlagueHO self-assigned this Jan 18, 2019
@PlagueHO PlagueHO added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants