Search code examples
wixwindows-installerwix3.7burn

Wix bundle uninstall package with custom install location


I have a Wix bundle which allows users to customize installation directory and passes the value to the package during installation. This is implemented using the approach described in this answer: How do I pass a default 'install location' to the RtfLicense bootstrapper?

If the user does not change install directory after running bundle and uninstalling it all files are deleted as expected. If the user does select another installation directory and runs bundle and uninstalls the app the files are not deleted. I guess this happens because the bundle passes default directory but it obviously isn't there. What's more the shortcut that's created during installation is deleted as the shortcut location does not depend on the installation directory.

How can I solve this issue?


Solution

  • The "install location" is not saved by the bundle. The packages have to save anything they need upon installation and read it back during other operations. For an MsiPackage, this is typically done using the "Remember Property" pattern. Directory paths are manipulated as properties so save any directory paths you need.