PDA

View Full Version : Breaking within Wizard Loop



Joe Snyder
12-28-2005, 11:41 PM
I am finding that the variable %_SB_DIALOGNEXTID% used by the Loop Wizard is being reset to 0, causing an infinite loop, when "Break Loop" is executed in the inner loop of the code below. Is this an expected behavior or am I doing something improperly?

Loop Wizard
Wizard Auto Break
If %_SB_DIALOGID% Equals "$LICENSEAGREEMENT$" Then
Set Variable %DRIVES_FOUND% to GetSystemInfo(Enumerate Disk Drives)
Set Variable %DRIVE_COUNT% to CountListItems(%DRIVES_FOUND%)
Loop
Set Variable %LOOPCOUNT% to (Increment Variable by 1)
Set Variable %DRIVE_LETTER_TO_TEST% to GetListItem(%DRIVES_FOUND%, %LOOPCOUNT%)
Set Variable %VALID_FMG_ELIGIBLE_DRIVE% to GetSystemInfo(Drive Type) of "%DRIVE_LETTER_TO_TEST%"
! If network drive or hard drive, look for existing files
If %VALID_FMG_ELIGIBLE_DRIVE% Equals "$DRIVE_REMOTE$" Or %VALID_FMG_ELIGIBLE_DRIVE% Equals "$DRIVE_FIXED$" Then
Set Variable %FMGMASTR_ALREADYEXISTS% to Search for File("FMGMASTR.EXE")
If %_SB_ERRORCODE% Equals "1" Then
! Reset install path if existing one is found
Set Variable %_SB_INSTALLDIR% to %FMGMASTR_ALREADYEXISTS%
Break Loop
End
End
End
End
End

linder
12-29-2005, 01:13 AM
Joe,

I'll check this and get back to you.

Thanks,

linder
12-31-2005, 07:21 AM
Item in review.

linder
12-31-2005, 07:53 AM
Joe,

This was a bug and has been fixed now. Thanks for bringing this to our attention!

Joe Snyder
01-02-2006, 09:52 PM
Freidrich:

Thanks for your help with the original problem. I am having a problem with another section of this same code.

Set Variable %FMGMASTR_ALREADYEXISTS% to Search for File("FMGMASTR.EXE")

This is my development/test machine so I happen to have quite a few directories where this exe exists. I am looping through all drives that might contain this exe. The second time this line is executed I am getting a buffer overrun or a gpf. The buffer overrun seems to happen if I run the program and the gpf if I debug the program. I do know it dies on this line in the script. I can't tell from this if this is a data issue or a buffer overrun from too many occurances for the result string to handle. Your documentation gives no indication of the maximum length allowed for the destination string. If it is quite large I suspect the data value within one of my directory paths. I have attempted to dump the result into a debug string but nothing is getting to dbgview. I seem to see only a small portion of the result string when viewing the variable from within debug mode. (even when using scrolling)

I also have a second question. Can this %FMGMASTR_ALREADYEXISTS% variable be loaded into the "Combo Box Text" argument of a Combo Box dialog.
I would like to present all existing paths to the client to choose as an existing alternate install path.

linder
01-03-2006, 01:20 AM
Joe,

Unfortunately, I cannot reproduce this here. But variables have a maximum of 1024 bytes, so perhaps this causes the problem.

You said you can only see a small portion of the result string. Could you please send me a screen-shot?

Thank you for your help!

linder
01-03-2006, 01:31 AM
I also have a second question. Can this %FMGMASTR_ALREADYEXISTS% variable be loaded into the "Combo Box Text" argument of a Combo Box dialog.
I would like to present all existing paths to the client to choose as an existing alternate install path.

Yes, no problem. Search for File returens the following:

path1|path2|path3|...

Combo Box Text requires the follwing format:

|path1|path2|path3|...

Just do the following:

Add %FMGMASTR_ALREADYEXISTS% to your "Combo Box Text" argument of a Combo Box dialog.

Then add this:

Set Variable %TEST% to Search for File("yourfilegoeshere.exe")
Set Variable %FMGMASTR_ALREADYEXISTS% to |%TEST%

Does this help?

Joe Snyder
01-04-2006, 07:50 AM
Yes thanks

I had it all there I just wasn't adding the '|' at the beginning.