PDA

View Full Version : "Run Program" with Wait option fails to wait when "running" a 2 CD install...



NewsArchive
01-01-2008, 11:30 AM
In my setup, there is an option to install Microsoft SQL with options my app
needs. It has all the script options to install it unattended with no use
input. I put all this in a run command, as follows:

FileName: SETUP.EXE
Target Folder: %TCS_SQL_SETUPPATH% (this is set earlier with a browse)
Command Line: [TCS_SQL_OPTIONS_1] [TCS_SQL_OPTIONS_2] [TCS_SQL_OPTIONS_3]
(these are set in my options.
Start Parameter: <empty>
Default Directory: %TCS_SQL_SETUPPATH% (same as Target Folder)
Wait for Program - Checked
Use ShellExecuteEx - Checked
Hide Window - Unchecked
Open Web Page - Unchecked

All the other tabs are left default.

The SQL install is a 2-CD install, and when it comes up with the message
"Insert disk 2", SB runs past the wait setting %_SB_ERRORCODE%, resulting in
the rest of my install terminating. The SQL does continue to finish, no
errors.

Any ideas?

Thanks,
-Glenn.

NewsArchive
01-01-2008, 11:32 AM
Glenn,

As I understand it, SETUP.EXE is a multiple-volume setup that installs
Microsoft SQL. Your main installation executes SETUP.EXE and should wait.
But it only waits until SETUP.EXE prompts for "Insert Disk 2", right?

An application has to use the WaitForSingleObject Windows API to "wait" for
a program. What seems to happen in your case is that the
WaitForSingleObject API returns if the "Insert Disk 2" message box is
displayed. Unfortunately, there is nothing we can do if WaitForSingleObject
returns. I would suggest to test if unchecking "Use ShellExecuteEx" makes a
difference (but I doubt it).

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
01-01-2008, 11:33 AM
Glenn,

I have tested this here on our machines (Windows 2000, Windows XP SP2 and
SP3, Windows XP Media Center, Windows Server 2003, Windows Vista Ultimate
and Business 32- and 64-bit, Windows Server 2008). Both installations
created with SetupBuilder 6.7 latest build.

I have developed a multiple-volume (2 images) test.exe. This test.exe is
executed from the main.exe installer - the "wait" option is enabled. The
main.exe launches the test.exe multiple-volume installer. The "Please
insert disk yadayada" message from the test.exe pops-up. Main.exe is still
in wait status. The 2nd install image is used, the next "Please insert disk
yadayada" appears. Main.exe is still in wait status, it returns when the
test.exe terminates.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
01-02-2008, 12:26 PM
To make sure I understand, your test is with unchecking "Use
ShellExecuteEx", and then everything worked properly?
That's great news. I will give that a shot as soon as I get back to the
office tomarrow.

thanks!

Glenn Paschal

NewsArchive
01-02-2008, 12:27 PM
Glenn,

> To make sure I understand, your test is with unchecking "Use
> ShellExecuteEx", and then everything worked properly?
> That's great news. I will give that a shot as soon as I get back to the
> office tomarrow.

No, it works with and without the ShellExecuteEx option here. I can send
you my test scripts if you want.

Friedrich

NewsArchive
01-02-2008, 12:27 PM
ok, forgive my confusion... but I'm not sure what you are trying to tell
me...
I've got an error in my script somewhere?
or, I've got something set wrong?
sorry for being a little on the dense side, been a rough couple of days!

Thanks,
-Glenn.

NewsArchive
01-02-2008, 12:28 PM
Glenn,

Well, I am trying to tell you that I can't reproduce it here and that the
Windows WaitForSingleObject API handles the "wait for program". In other
words, if Windows WaitForSingleObject decides that the "wait if over" then
there is very little you can do :)

HTH,
Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.7
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
01-02-2008, 12:30 PM
Ah. Gotcha. Ok, I will try Geoffs solution, see what kind of results I
have with that. Or may just pop a screen that says "Press OK after the SQL
installation finishes."

Thanks,
-Glenn.

NewsArchive
01-02-2008, 12:30 PM
Hi Glenn,

I have a situation where the script kept running before the executable
finished so I finished up doing the following:

Run Program %_SB_INSTALLDIR%\wmpcdcs8.exe /q:a /r:n (Always
Install) [Wait]
Set Variable %LOOPID% to "1"
Loop
Set Variable %LOOPID% to (Increment Variable by 1)
Sleep for "3" seconds
Set Variable %ACTIVE% to ScriptItem->Detect Active
Application(wmpcdcs8.exe)
If %ACTIVE% Equals "603" Then
Break Loop
End
If %LOOPID% Equals "4" Then
Break Loop
End
End

This effectively starts the program, then periodically loops to see if
the executable is still active. It also includes a fail-safe so that
it can't go into an eternal loop if something goes wrong. It closes
either after 12 seconds (4 loops x 3 second sleep) or if the
executable closes.

Best Regards,
Geoff Spillane
Data Down Under