[wix-users] uninstall fails after removing installer EXE at its original path

Gubanov, Oleg (INT) Oleg.Gubanov at Teledyne.com
Wed Feb 2 07:35:13 PST 2022


I have a managed bootstrapper application A.exe that has an MsiPackage embedded into it. I'd like to handle the following scenario:

1.         Install a product by running A.exe from its original location d:\setup\A.exe.
2.         Delete file d:\setup\A.exe.
3.         Uninstall the product via "add/remove programs".

The first two steps complete successfully. The problem happens at step (3), during the uninstallation.
At step (3), the installer is started from the package cache location C:\ProgramData\Package Cache\{some guid}\A.exe, as indicated by the first line in the log file:

i001: Burn v3.11.2.4516, Windows v10.0 (Build 19042: Service Pack 0), path: C:\ProgramData\Package Cache\{some guid}\A.exe

The problem is that the installer starts looking for itself at its original location, fails to find itself there, and aborts the uninstallation:

i300: Apply begin
w341: Prompt for source of container: WixAttachedContainer, path: d:\setup\A.exe
e054: Failed to resolve source for file: d:\setup\A.exe, error: 0x80070002.
e311: Failed to acquire container: WixAttachedContainer to working path: C:\WINDOWS\Temp\{38073DCD-E73A-4C38-A977-AA72E7DCF756}\79E32844E8819A5B8527590929F3AFC7525C327C, error: 0x80070002.
e000: Error 0x80070002: Failed while caching, aborting execution.

The problem can be avoided by restoring A.exe in its original location: then, the uninstallation completes successfully.
But keeping d:\setup\A.exe is an extra burden on a user, and that wastes disk space, considering that A.exe is copied to the package cache.
It should be possible to uninstall the product without having A.exe at its original location.

How to avoid dependency on the original d:\setup\A.exe during the uninstallation?
Is it possible to have the uninstaller find itself at the package cache?



More information about the wix-users mailing list