|
|
#1 |
|
Junior Member
Join Date: Feb 2007
Posts: 5
|
removing the installed folder when uninstalling
Greetings
I'm trying to fight with the problem of removeing the installed folder where I placed uninstall.exe. I thought of uninstalling from a higher folder than the installed. In order to do that I wrote a small function: Function un.OnInit ${un.GetParent} "$INSTDIR" $R0 CpyStr $INSTDIR $R0 MessageBox MB_OK '"$OUTDIR" will be uninstalled from "$INSTDIR"' FunctionEnd and $INSTDIR is replaced by $OUTDIR throughout the Uninstall Section. And it worked. But if the MessageBox is neutralized, replaced by DetailPrint, moved to the Uninstall Section - it does not work. Everything is uninstalled except the folder. Why? Thanks in advance Dilbertz |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Just place the uninstaller into $INSTDIR, e.g.
WriteUninstaller "$INSTDIR\uninstall.exe" don't forget to add at the end of uninstall section, after you've deleted all files/folders individual, the command RmDir "$INSTDIR". Also, you may want to have a look at Advanced Uninstall Log, http://nsis.sourceforge.net/Advanced...og_NSIS_Header Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2007
Posts: 5
|
Thanks for your lightening fast answer.
Of course I did both WriteInstaller $INSTDIR\Uninstaller.exe in the install section and RMDir /r $INSTDIR in the Uninstall section and it didn't work! i.e. everything was deleted except $INSTDIR itself Unless you meant: in addition to RMDir /r $INSTDIR the last line should be RMDir $INSTDIR I'll try. Thanks again. Dilbertz |
|
|
|
|
|
#4 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
no i'd never suggest RMDir /r
all files deleted and remains $INSTDIR empty? Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2007
Posts: 5
|
Sorry but I have subfolders in $INSTDIR and apart from registry handling that's all I do.
And you're right all files and subfolders deleted and I stayed with empty $INSTDIR but I haven't tried RMDir $INSTDIR yet. You're too fast, man. Thanks |
|
|
|
|
|
#6 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
When all files/folders removed, adding RMDir "$INSTDIR" should remove parent if it's empty.
I'm going to do a guess, what about a hidden file e.g. help.GID which remains invisible? Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
|
This happen if dir is 'working' for instaler (or other program). Add SetOutPath "$WINDIR" before folder deletion.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|