Skip to content
⌘ NSIS Forum Archive

Uninstaller

4 posts

mamilo#

Uninstaller

Hi,
I don't want that the uninstaller deletes at end of uninstall the directory where the application was. How can I do that?
Thanks

mamilo!
Koopa#
Simply don't add this to the uninstaller. 😉

For example: This will delete the files, the uninstaller, the reg key and a sub dir but won't touch the main folder.

Section Uninstall
Delete "$INSTDIR\uninstaller.exe"
Delete "$INSTDIR\yourfolder\subfolder\test.txt"
Delete "$INSTDIR\yourfolder\subfolder\test2.txt"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
RMDir "$INSTDIR\yourfolder\subfolder\"
SetAutoClose true
SectionEnd
Don't add: RMDir "$INSTDIR\yourfolder\"

Also note, that the uninstaller won't delete directories, if the directory isn't empty.
carlosc#
What is the best way to handle a product uninstall if unbeknownst to the admin the product were being used while it is being uninstalled? Is there a simple way in NSIS to detect and warn the admin that the product is being currently used?

Thanks
Carlos
Red Wine#
There are several ways, one quite simple is discussed on this forum thread,
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.