PDA

View Full Version : Installation Folder



slimboywynn
07-14-2005, 03:23 PM
Any way I can check to see if the %_SB_INSTALLDIR% contains a word, ie SYNC? I basically want the user to select a folder and if it's not my SYNC folder I dont want the wizard dialog script to move on. :D

linder
07-15-2005, 06:15 AM
No problem :) You can use the InStr String Function here. See test script. If the installation folder contains SYNC, the installer displays an error message and does not continue to the next dialog.

! Wizard dialog definition(s)
Define Wizard Dialog "WELCOME" (Welcome)
Define Wizard Dialog "LICENSE" (License Agreement)
Define Wizard Dialog "SELECTFOLDER" (Select Install Folder)
Define Wizard Dialog "READY" (Ready to Install)

! The Wizard Loop displays the dialog screens that the user sees in the installation
Loop Wizard
Wizard Auto Break
If %_SB_DIALOGID% Equals "$SELECTFOLDER$" Then
Set Variable %SYNCTEST% to InStr(1, %_SB_INSTALLDIR%, "SYNC")
If %SYNCTEST% Not Equals "0" Then
Message Box "SYNC not allowed in folder path!" -- "Error"
Cycle Loop
End
End
End

Does this help?

Thanks,

slimboywynn
07-15-2005, 08:36 AM
Thanks Friedrich, I'm sure it will :)

slimboywynn
07-15-2005, 09:48 AM
Bugger, cant get this to work Friedrich :confused:

Am I evaluating the expression? If so I'm getting all sorts of numbers back :confused: :confused: :confused:

linder
07-15-2005, 09:54 AM
See private email (demo script).

slimboywynn
07-15-2005, 11:06 AM
Works like a charm, I just needed to UPPER the value first before checking it.

I must read what you type Friedrich, I used SET VARIABLE and not the STRING FUNCTION previously! :eek: