PDA

View Full Version : If statements after user dialog entry



arrigob
09-10-2010, 12:16 PM
I am trying to add an "if" statement after my second dialog.

I started working on another installer our company is needing. One of our dialogs asks the user to point to a certain directory on their computer, once they have and click next, we would like the installer to run an if statement and check to see if a file is in the directory they specified, if it is not, we would like it to pop up a message saying click back and pick the correct directory. I hope that made sense.

The problem is that the if statement doesn't seem to be running in the proper place. No matter where I have placed the if statement in the script, the if statement shows up at the incorrect time when running the installer, either before the installer pops up or during the installation portion. Where do I need to place the if statement in my script to have it pop uo after the 2nd "shared" user dialog?

I have included my dialog script below. The if statement is down by the wizard loop at the present time. I have tried moving this right below the 2nd dialog labeled Shared but that wouldn't work. Any ideas on the correct placement of the if statement?


[ User Interface ]
! Wizard dialog definition(s)
Define Wizard Dialog "#1" (Welcome)
Define Wizard Dialog "SHARED" (Select Install Folder) (%DATAPATH%)
Define Wizard Dialog "INSTALL" (Select Install Folder) (%_SB_INSTALLDIR%)
Define Wizard Dialog "#4" (Ready to Install)

! The Wizard Loop displays the dialog screens that the user sees in the installation
Loop Wizard (Abort Dialog Active)
If %DATAPATH%\AAS2.EXE File or Folder doesn't exist Then
Display Message Box "The file or folder chosen is the incorrect FPA sha..." -- "Incorrect Shared Folder"
End
End

Thanks,

Brandon

linder
09-10-2010, 02:26 PM
Brandon,

Did you already download the Examples and the Learning SetupBuilder Part I manual? There are quite a few good examples that demonstrate this :)

http://www.lindersoft.com/forums/showthread.php?t=24376

It should look like this:

If %_SB_DIALOGID% Equals "$SHARED$" Then
If %DATAPATH%\AAS2.EXE File or Folder doesn't exist Then
Display Message Box "The file or folder chosen is the incorrect FPA sha..." -- "Incorrect Shared Folder"
Cycle
End
End

Friedrich