|
|
#1 |
|
Junior Member
Join Date: Jan 2005
Posts: 3
|
Strange Behaviour with .onVerifyInstDir
I am writing an installer to replace an executable that already exists and to ensure the user chooses the correct directory I am using onVerifyInstDir to check that the executable to be replaced already exists.
However, although in the install directory browse popup the OK button enables and disables correctly, the Install button on the main dialog only enables if you choose the default install directory, if you choose an alternate directory that contains the executable to be replaced the Install button remains disabled. Here is the entire script: code: Any suggestions on what I'm doing wrong? |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Mar 2003
Posts: 571
|
Try using quotes, like this:
IfFileExists "$INSTDIR\Uploader.exe" PathGood |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2005
Posts: 3
|
I have tried quoting everything and that didn't work. I just worked out what's happening:
$INSTDIR is $PROGRAMFILES\Uploader, if you then browse for a directory that contains Uploader.exe (for example C:\Test) the OK button in the Browse box is enabled but when you click OK instead of putting C:\Test in the directory text box it is putting C:\Test\Uploader, it is as if it is appending the static part of $INSTDIR. Is this a bug? |
|
|
|
|
|
#4 | |
|
Major Dude
Join Date: Mar 2003
Posts: 571
|
Quote:
http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.1.21 Here is a relevant extract from that section: "Note that the part of this string following the last \ will be used if the user selects 'browse', and may be appended back on to the string at install time (to disable this, end the directory with a \ (which will require the entire parameter to be enclosed with quotes)" |
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2005
Posts: 3
|
Thanks, works a treat.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|