Old 4th January 2006, 10:02   #1
martti
Junior Member
 
Join Date: Nov 2005
Posts: 5
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.
martti is offline   Reply With Quote
Old 4th January 2006, 12:05   #2
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
What about 4.8.1.22 InstallDirRegKey ?
code:

!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
code:

ExecWait '$R0'


when calling uninstaller
Takhir is offline   Reply With Quote
Old 4th January 2006, 14:35   #3
martti
Junior Member
 
Join Date: Nov 2005
Posts: 5
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
martti is offline   Reply With Quote
Old 4th January 2006, 16:41   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
But you may need to hide uninstaller window even if it not comes foreground.
Takhir is offline   Reply With Quote
Old 4th January 2006, 18:02   #5
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
And you are right, '$R0 _?=$INSTDIR' starts uninstaller directly (not it's copy in tmp folder), so ExecWait waits for uninstaller exit.
Takhir is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump