Archive: unable to set a working "InstallDir" parameter


unable to set a working "InstallDir" parameter
In general the script works great. I have just found out that for some reason beyond my (somewhat non-existant) NSIS skills, the installation DOES NOT use InstallDir which I've set.

I would like the installer to extract the files (by default) to InstallDir "$PROGRAMFILES\Project of doom", yet.. this isnt the case.

While running the installation, the setup suggests that the files should be extracted to

"C:\DOCUME~1\User\LOCALS~1\Temp\nst43.tmp\"

Why is that? I've added a shortened version of my code aswell. SO if you are able to help, drop a line.

Ktnxbye .)

Edit1: I've also found out that deleting "InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" """ from the installer.. will fix the problem, but I'm quite sure that "InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" """ is required for something :)


You've defined as PRODUCT_DIR_REGKEY the 7za.exe which extracted in $PLUGINSDIR and probably you add this path to the registry hence the suggestion "C:\DOCUME~1\User\LOCALS~1\Temp\nst43.tmp\"
Change this to point the $INSTDIR instead.


Thanks for the reply.
AFter some experimenting I found that changing
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
to
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "$PROGRAMFILES\PROJECT OF DOOM"
DId the trick.

Thanks again.


Also changing the corresponding lines of your script with the following should be ok,

; remove the line below
;!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\7za.exe"
; unchanged
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
; unchanged
!define PRODUCT_UNINST_ROOT_KEY "HKLM"


; replace
InstallDirRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallDir"


Section -Post
;add
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "InstallDir" "$INSTDIR"
SectionEnd