wix Managed bootstrapper: Rollback failing

2

I have multiple EXECPackages chained in my managed bootstrapper, for example:

<ExePackage Id="Test1" SourceFile="D:\Test\TestBatch.bat" Vital="yes" Compressed="yes" 
              InstallCommand="Testinstall1"
              UninstallCommand="Testuninstall1"
              />
<ExePackage Id="Test2" .../>

I want my rollback to execute the Uninstall command. The generated log file has the following info:

Rollback:uninstall. Applying rollback package: Test2, action: Uninstall, path: C:\ProgramData\Package Cache\AD944C8E8D75C79F57819C331F46D15B4CFD9172\TestBatch.bat, arguments: '"C:\ProgramData\Package Cache\AD944C8E8D75C79F57819C331F46D15B4CFD9172\TestBatch.bat" Testuninstall2' [24F4:246C][2013-06-05T14:45:10]e000: Error 0x80070003: Failed to CreateProcess on path: C:\ProgramData\Package Cache\AD944C8E8D75C79F57819C331F46D15B4CFD9172\TestBatch.bat [24F4:246C][2013-06-05T14:45:10]e000: Error 0x80070003: Failed to execute EXE package. [1654:27A8][2013-06-05T14:45:10]e000: Error 0x80070003: Failed to configure per-machine EXE package.

I realized that when rollback is triggered (Result.Cancel), the cached folder that contains the Exe package payload is deleted from C:\ProgramData\Package Cache.

However this used to work before.

wix
wix3.6
wix-extension
wix3.7
asked on Stack Overflow May 29, 2013 by microsoftprogrammer • edited Jul 1, 2013 by Yan Sklyarenko

1 Answer

3

The UninstallCommand is executed on rollback if the package is being installed. I've seen this issue occur when the same executable is used for multiple ExePackage elements in a single Chain. The way that the Burn engine caches packages uses the hash of the executable to determine the location. Thus if you put the same executable in Chain it can be prematurely removed. Make sure every executable package is unique in your Bundle.

PS: It is highly recommended that you have a DetectCondition on the ExePackage

answered on Stack Overflow Jun 22, 2013 by Rob Mensching

User contributions licensed under CC BY-SA 3.0