Skip to content
⌘ NSIS Forum Archive

Uninstall Problem

4 posts

abrakad#edited

Uninstall Problem

Hello Guys.
I used Nsis 2.36 and HM Nsis edit 2.03 to make mod installer.

After Compiling Original script and checking it have no problem, I want to change a dir of Uninstaller. So I Change it like this

WriteUninstaller "$INSTDIR\uninstmod.exe"
Section Uninstall
Delete $instdir\Mod_data\text\xxx.txt

-> WriteUninstaller "$INSTDIR\Mod_data\uninstall\uninstmod.exe"
Section Uninstall
Delete $instdir\Mod_data\text\xxx.txt

Compile is OK, Install is OK, and Uninstall seem to work. but Uninstall do not work. It don't delete a file and folder at all.

so, I add a line to know what happened like this

-> WriteUninstaller "$INSTDIR\Mod_data\uninstall\uninstmod.exe"
Section Uninstall
MessageBox MB_OK $instdir\Mod_data\text\xxx.txt
Delete $instdir\Mod_data\text\xxx.txt

Box is opened while uninstalling and it shows like this

delete $instdir\Mod_data\uninstall\Mod_data\text\xxx.txt

Of course, It's a wrong dir. What's happened? Is it a bug? And How can I change dir of Uninstaller?

Sorry for my bad English. and thank for reading. Please Reply my Problem. 😉
abrakad#
Thank for reply, Anders. so How can I change dir of Uninstaller? Is it impossible to make uninstmod.exe in different dir? 🙁
abrakad#
I edit the script like this temporarily

-> WriteUninstaller "$INSTDIR\Mod_data\uninstmod.exe"
Section Uninstall
Delete $instdir\text\xxx.txt

It works. Uninstall did delete a file.
But still I don't use

WriteUninstaller "$INSTDIR\Mod_data\uninstall\uninstmod.exe"

I don't understand why they make $INSTDIR like this.
Why should It change $INSTDIR in uninstall part. 🤪