SteveRussell
4th March 2007 04:03 UTC
Uninstaller in a subdirectory
I am moving a group of uninstallers to their respective subdirectories of the common install directory. (This is because a number of exe's will share files.) Under certain conditions, I want an installer to be able to remove what's left of the install directory (all other exe's having been uninstalled). However, I find that RMDir and Delete are no longer succeeding in the install path for anything except the installer's directory. What do I need to do?
kichik
4th March 2007 07:23 UTC
$INSTDIR is the directory where the uninstaller is located. You can use GetParent to get the parent directory of $INSTDIR.
SteveRussell
4th March 2007 14:57 UTC
Are you saying that it is a mistake to place the uninstaller in a subdirectory of $INSTDIR? Currently I have it in $INSTDIR\test. In this position, I am only able to delete \test and its contents.
Red Wine
4th March 2007 15:13 UTC
Uninstaller recognizes as $INSTDIR the directory from where is executed.
You should either use GetParent as kichik suggested or read the $INSTDIR from registry, see NSIS manual about,
http://nsis.sourceforge.net/Docs/Chapter3.html#3.2.2
SteveRussell
4th March 2007 16:00 UTC
I am beginning to understand. Thank you both very much.
Here's what I'm doing now, along with the error I'm getting. Please advise:
!include FileFunc.nsh
!insertmacro un.GetParent
. . .
${GetParent} "$INSTDIR\uninst.exe" $R0
Compile error -->> Invalid command: ${GetParent}
Red Wine
4th March 2007 16:04 UTC
!insertmacro un.GetParent --> ${un.GetParent}
SteveRussell
4th March 2007 16:47 UTC
Again I say: THANKS SO VERY MUCH! !