Archive: uninstconfirm/uninstfiles shows wrong folder


uninstconfirm/uninstfiles shows wrong folder
Happy rest of the year, nsis folks!

I have a pretty straightforward install script that tries automatically remove existing installation. I check in .onInit if an uninstaller.exe exists in the registry.

When I use the uninstconfirm page, it shows the InstallDir value (I set it in the installer to default value) instead of the real $INSTDIR path (changed with Page directory).

.onInit looks like:

ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Product" "UninstallString"
...
ExecWait '$R0 _?=$INSTDIR'

If I try to set INSTDIR to correct value from registry (got a key containing the true install path) I get a installer error.


What about 4.8.1.22 InstallDirRegKey ? :)


!define INST_DIR Install_Dir
InstallDir "$PROGRAMFILES\${APP_NAME}"
InstallDirRegKey HKLM "${REG_PATH}" "${INST_DIR}"
...
Section "Dummy Section" SecDummy
WriteRegStr HKLM "${REG_PATH}" "${INST_DIR}" "$INSTDIR"
SectionEnd

And simply

ExecWait '$R0'

when calling uninstaller

Thanks Takhir,

Your answer led me to solution. The error was generated because I accidentally wrote the registry value with surrounding "'s -> ExecWait got gibberish..

BTW. Using only ExecWait '$R0' caused the install window to appear underneath the uninstallconfirm page.

Thanks, Martti


But you may need to hide uninstaller window even if it not comes foreground.


And you are right, '$R0 _?=$INSTDIR' starts uninstaller directly (not it's copy in tmp folder), so ExecWait waits for uninstaller exit.