开发者

NSIS Uninstaller Working Directory

开发者 https://www.devze.com 2022-12-30 06:04 出处:网络
I am using NSIS to create my installers/uninstallers, and the uninstaller seems to have a wei开发者_C百科rd behavior.

I am using NSIS to create my installers/uninstallers, and the uninstaller seems to have a wei开发者_C百科rd behavior.

I don't put the installer in $INSTDIR, it is located at $INSTDIR/subdir/uninstall.exe (it's a addon installer for a host application).

When I run the installer then, it thinks the application installation root is $INSTDIR/subdir instead of $INSTDIR. It then can't find all the files in subdir/* as it's already in subdir.

If I move the executable, it seems to just accept the current directory as where the application installation root is. I can move it to $INSTDIR and all is well.

Thanks.


$INSTDIR in the uninstaller is just the directory the uninstaller is in (Not the same as current directory necessarily)

If you can just put the uninstaller in the root of the install, that is the best option, otherwise you have to do something ugly like strcpy $instdir "$instdir\.." or use a define in every Delete/RMDir call.

Alternatively, if you save the install dir somewhere in the registry during install, you could read it back in the uninstaller.

0

精彩评论

暂无评论...
验证码 换一张
取 消