Uninstaller NSIS working directory

I use NSIS to create my installers / uninstallers, and the uninstaller seems to have strange behavior.

I do not install the installer in $ INSTDIR, it is in $ INSTDIR / subdir / uninstall.exe (this is the add-on installer for the host application).

When I run the installer, it thinks the app's installation root is $ INSTDIR / subdir instead of $ INSTDIR. Then it cannot find all the files in subdir / * as it already does in subdir.

If I translate the executable it seems it just takes the current directory where the application installation root is. I can move it to $ INSTDIR and everything is fine.

Thanks.

+2


a source to share


1 answer


$ INSTDIR in the uninstaller is only the directory where the uninstaller is located (does not match the current directory)

If you can just put the uninstaller in the root of the installation, that's the best option, otherwise you have to do something ugly like strcpy $instdir "$instdir\.."

, or use a definition in every Delete / RMDir call.



Alternatively, if you save the installation directory somewhere in the registry during installation, you can read it back in the uninstaller.

+4


a source







All Articles