I am learning WIX to build installer for my app but I am stuck with removing files. My question is how can I remove files and folders on uninstall. When I click on remove button, all the files and folders which the installer created doesn't remove on uninstall.
Asked
Active
Viewed 6,825 times
3
-
1http://stackoverflow.com/questions/195919/removing-files-when-uninstalling-wix addresses this, but it looks like that's wix2 and i'm guessing you're using wix3.0 or 3.5? – James Polley Jan 06 '10 at 11:41
-
thanks for your reply James, yes you are right i am using wix 3.0, let me see the solution link which you gave – Khalid Jan 06 '10 at 12:54
-
no, actually i had visited this link and find nothing which works for me. and one more thing to ask related to my problem is i am not getting the point of following line whenever i search for removefile element; it is in help file,
= "Remove a file(s) if the parent component is selected for installation or removal" how we can select parent component to uninstall? – Khalid Jan 06 '10 at 13:03 -
This is a duplicate as suggested by James Polley. Wix 2.0 or 3.0 doesn't matter, the linked answer is valid for both. – Wim Coenen Jan 07 '10 at 02:05
-
thank you wcoenen, after your reply i put my effort on practicing james poley posted link, and it is working now, and why it is not working before because i let guid value empty. – Khalid Jan 07 '10 at 11:41
1 Answers
9
The answer is in the comments above but for future reference there are two things to check first when files are not being removed:
Ensure that you do not have Component/@Guid="". In Specifically setting to an empty string (Guid="") tells the Windows Installer ignore all the stuff built into this Component. Note: WiX v3.6+ you can leave the Guid attribute of the Component element completely and that is fine (a stable GUID will be generated).
Ensure the you do not have Component/@Permanent="yes". Obviously, that tells the Windows Installer to not uninstall the stuff.

Rob Mensching
- 33,834
- 5
- 90
- 130
-
1My application directory under Program Files wasn't being removed. I had to add GUIDs even though it installed fine without them. Thanks! – Robert Feb 17 '13 at 08:22