Old 30th June 2010, 14:53   #1
liftarn
Junior Member
 
Join Date: Jun 2010
Location: Stockholm, Sweden
Posts: 4
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
code:
;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
code:
!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?
liftarn is offline   Reply With Quote
Old 30th June 2010, 15:06   #2
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
Add a backslash:
code:

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



(It's explained in the documentation about InstallDir)
Wizou is offline   Reply With Quote
Old 1st July 2010, 12:50   #3
liftarn
Junior Member
 
Join Date: Jun 2010
Location: Stockholm, Sweden
Posts: 4
Quote:
Originally Posted by Wizou View Post
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.
liftarn 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