I have set up the install directory by reading a registry setting for that program as
I then use the standard page, but checks if it's a valid directory;Default installation folder
InstallDir "$PROGRAMFILES\${COMPANY_NAME}\${PRODUCT_NAME}"
;Get installation folder from registry if available
InstallDirRegKey HKLM "Software\Company\Package\Install" "InstallDir"
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.!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
How do I prevent this and install in the directory the user actually selected?