Archive: Can't find registry value..


Can't find registry value..
Hi all,

I'm trying to write an installer for a PHP app. It installs xampp to automate the install for apache,mysql,php, etc. I'm trying to have my installer go into the registry to find the path where the user chose to install xampp.

I've used this thread to help me along, yet when I attempt to install, the destination path is blank. My code is below. Any ideas?


Section "FindPath" Section1
; Set Section properties
SetOverwrite on
; Set Section Files and Shortcuts
ReadRegStr $0 HKLM "SOFTWARE\xampp" "Install_Dir"
SetOutPath "$INSTDIR $0"
SectionEnd

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Setup.exe"
InstallDir "$0"
ShowInstDetails show
ShowUnInstDetails show
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "setprefs.ini"

Sections are executed in the instfiles page. The instfiles page shows after the directory page. It'd be way simpler to use InstallDirRegKey instead of reading the value yourself.