Archive: Blocking appending on install dir on browse


Blocking appending on install dir on browse
I have an application that nneds to be installed in the same directory as another application.

I have set up the install directory by reading a registry setting for that program as

;Default installation folder
InstallDir "$PROGRAMFILES\${COMPANY_NAME}\${PRODUCT_NAME}"

;Get installation folder from registry if available
InstallDirRegKey HKLM "Software\Company\Package\Install" "InstallDir"


I then use the standard page, but checks if it's a valid directory
!insertmacro MUI_PAGE_DIRECTORY
Function .onVerifyInstDir
IfFileExists $INSTDIR\TestFile.exe PathGood
Abort ; if $INSTDIR is not a valid directory, don't let user install there.
PathGood:
FunctionEnd


The problem is if the user uses the browse button to look for the directory the directory name gets appended with my appname when the user clicks OK and this is not what I want.
How do I prevent this and install in the directory the user actually selected?

Add a backslash:


InstallDir "$PROGRAMFILES\${COMPANY_NAME}\${PRODUCT_NAME}\"


(It's explained in the documentation about InstallDir)

Originally posted by Wizou
Add a backslash:
(It's explained in the documentation about InstallDir)
Ok, that did the trick. The ducumentation made it look it was not what I was looking for.