ghverdun
25th April 2002 17:35 UTC
Uninstall does not work on 1.96 and 1.97
I have a simple installer with a few files in the install section and no license text.
The uninstaller fails to remove any files because it appears that the $EXEDIR points to the temp dir and the $INSTDIR and $OUTDIR point to the $EXEDIR instead of the installed dir.
Anyone else seeing this?
Smile2Me
25th April 2002 17:37 UTC
No, but post your script and maybe we can find the mistake...
Greetz,
-Hendri.
ghverdun
25th April 2002 17:54 UTC
Ok, so with this script.. In the uninstaller the Messagebox shows that the $EXEDIR as set to the temp dir and the $INSTDIR is set to what $EXEDIR should have been set to.
Name "Test"
Caption "Test Installer"
OutFile "Install_Test.exe"
AutoCloseWindow false
ShowInstDetails show
ShowUninstDetails show
DirText "Please select a location to install Test (or use the default):"
BrandingText "Test"
SetOverwrite on
SetDateSave on
WindowIcon off
InstallDir $EXEDIR\test
;
; Test Components
;
Section Test
SetOutPath $INSTDIR
file "Test.exe"
SectionEnd
Section -post
SetOutPath $INSTDIR
Delete $EXEDIR\Uninstall_Test.exe
WriteUninstaller $EXEDIR\Uninstall_Test.exe
SectionEnd
Section Uninstall
MessageBox MB_OK "$EXEDIR $INSTDIR"
Delete "$EXEDIR\Uninstall_Test.exe"
Delete "$INSTDIR\Test.exe"
SectionEnd
Smile2Me
25th April 2002 19:00 UTC
This is a working script:
Name "Test"
OutFile "Test.exe"
InstallDir $EXEDIR\test
Section Test
SetOutPath $INSTDIR
file "Test.txt"
SectionEnd
Section -post
SetOutPath $INSTDIR
Delete $INSTDIR\Uninst.exe
WriteUninstaller $INSTDIR\Uninst.exe
SectionEnd
Section Uninstall
Delete "$INSTDIR\Uninst.exe"
Delete "$INSTDIR\Test.txt"
RMDir $INSTDIR
SectionEnd
Mistake: be carefull not to mix up $EXEDIR and $INSTDIR. If you define $INSTDIR as $EXEDIR, then you could mix up (without problems) the two vars in the installer section. But in the uninstaller section NOT. The reason is that the uninstaller copies itself to the tempdir to be able to delete itself from the install dir. So $EXEDIR then becomes $TEMP (for the uninstaller, as you observed!) and cannot be used to delete files anymore. For this purpose, keep on using $INSTDIR!
Good luck, greetz,
-Hendri.