Archive: Removing $INSTDIR Folder


Removing $INSTDIR Folder
It installs the application to Program Files\Appname. When I run the uninstall from add/remove programs it will remove the appname directory. When I run the shortcut from the start menu it won't remove it - it removes everything within the directory, but not the directory itself.

The uninst.exe is in the appname folder.

The uninstall script is:

Section Uninstall
Delete "$SMPROGRAMS\Appname\Uninstall.lnk"
Delete "$SMPROGRAMS\Appname\Appname Manager.lnk"
Delete "$SMPROGRAMS\Appname\Appname.lnk"

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
DeleteRegKey HKLM "SOFTWARE\Appname"
SetAutoClose true

RMDir "$SMPROGRAMS\Appname"
RMDir /r "$INSTDIR"
RMDir "$INSTDIR"
SectionEnd

Anyone know how I can get the uninstall to remove the actual base folder when I run either the start menu link or the uninst.exe in the folder?


If you use NSIS v2.09. Then try:


...
SetOutPath $TEMP
RMDir "$SMPROGRAMS\Appname"
RMDir /r "$INSTDIR"
SectionEnd

Hooray :]
Thank-you for the quick reply Instructor. That fixed my problem.