-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
One or more of the below may be due to the WIX framework not following MSI best practices and conventions - I'm not sure.
The MSI package uninstall does not clean up the start menu folder and shortcut that were created.
(e.g. "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PowerShell_6.0.0.13\PowerShell_6.0.0.13.lnk")
This may be because the package breaks an MSI validation rule (ICE67: https://msdn.microsoft.com/en-us/library/windows/desktop/aa369017(v=vs.85).aspx) that all shortcuts should be defined in the same component as the EXE they point to (their "target"). As authored, the shortcut has a dedicated component instead with a dedicated registry keypath just so that the component will work properly. When done in a compliant way, MSI knows to remove the shortcut when the EXE is removed. This should also prevent you from having to include an ICO file for the shortcut as the icon will be pulled from the target EXE.
It also does not clean up the empty version folder. (e.g. "C:\Program Files\PowerShell\6.0.0.13")
In this case I believe this is because you have this folder in the "CreateFolder" table and you should not. MSI implicitly creates folders whenever a component targeted for the folder is selected. The component reference count is also how it knows when to remove the folder. There does appear to be a correlating "RemoveFile" table entry - but for whatever reason it is not taking effect. It is possible this is an artifact of using WIX as it may be doing this in error or for handling edge cases.
There is not a validation rule for this - it is just a convention of how MSI works. The valid use case for CreateFolder should be for creating empty folders for which the package will never have a component destined to - for example a data folder in Documents.