You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which version of Visual Studio are you building with (if any)?
17.6
Which version of the WiX Toolset Visual Studio Extension are you building with (if any)?
N/A
Which version of .NET are you building with?
.Net Framework 4.7.2
If the problem occurs when installing your packages built with WiX, what is the version of Windows the package is running on?
N/A
Describe the problem and the steps to reproduce it.
I am hitting a problem with wix.exe method of cleanup of temporary files. What I see in Procmon is that wix.exe cleans up temporary files and then tries to recursively delete all non-empty folders.
Wix.exe relies on OS to return 145 "Not empty" error code to know when to stop trying to delete. The problem happens when you output to a symlink folder. If you try to delete symlinked folder, it won't return "not empty" error code and will instead successfully remove the symlink, leaving all files intact in symlink's source folder. On the image above, obj\release is an output folder.
Repro steps:
Create a .wixproj targeting .msi file without localization
Delete .wixproj's output folder and replace it with a symlink to some other folder: mklink /D E:\FinOps\pl3\Source\Setup\MSIWix\TraceParser\obj\release E:\FinOps\pl3\Source\Setup\MSIWix\TraceParser\a
Build .wixproj
Actual:
wix.exe will successfully compile the .msi file and will then wipe the output folder's symlink and recreate it being empty
CopyFilesToOutputDirectory target fails to find output file: D:\blah\wixtoolset.sdk\4.0.1\tools\wix.targets(928,5): error MSB3030: Could not copy the file "obj\Release\TraceParser.wixpdb" because it was not found.
Expected:
wix.exe deletes only temporary files it created and doesn't touch output directory in any other way
The text was updated successfully, but these errors were encountered:
Workaround I'm using to put the output one folder deeper preventing symlink from being deleted.
<Target Name="PatchOutputPath" AfterTargets="AssignTargetPaths">
<!-- wix.exe will delete its own output folder if it's a symlink, this fails only in CloudBuild https://github.com/wixtoolset/issues/issues/7688
Patch output path to be one folder deeper than $(IntermediateOutputPath) -->
<ItemGroup>
<CultureGroup Remove="@(CultureGroup)" />
<CultureGroup Include="en-US" >
<OutputSuffix>en-US</OutputSuffix>
<OutputFolder>en-US\</OutputFolder>
</CultureGroup>
</ItemGroup>
<PropertyGroup>
<IntermediateOutputPath>$(IntermediateOutputPath)en-US\</IntermediateOutputPath>
</PropertyGroup>
</Target>
barnson
added
up for grabs
No one volunteered to fix the issue. If you are interested, comment with "I want to fix this issue"
and removed
triage
labels
Sep 5, 2023
If this issue is a bug:
I am hitting a problem with wix.exe method of cleanup of temporary files. What I see in Procmon is that wix.exe cleans up temporary files and then tries to recursively delete all non-empty folders.
Wix.exe relies on OS to return 145 "Not empty" error code to know when to stop trying to delete. The problem happens when you output to a symlink folder. If you try to delete symlinked folder, it won't return "not empty" error code and will instead successfully remove the symlink, leaving all files intact in symlink's source folder. On the image above, obj\release is an output folder.
Repro steps:
mklink /D E:\FinOps\pl3\Source\Setup\MSIWix\TraceParser\obj\release E:\FinOps\pl3\Source\Setup\MSIWix\TraceParser\a
Actual:
D:\blah\wixtoolset.sdk\4.0.1\tools\wix.targets(928,5): error MSB3030: Could not copy the file "obj\Release\TraceParser.wixpdb" because it was not found.
Expected:
The text was updated successfully, but these errors were encountered: