Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

LaunchAppAndWait will not wait?


2 replies to this topic

aedmunde

aedmunde
  • Members
  • 1 posts

Posted 25 September 2004 - 02:27

Ok, forgive me if it's been discussed.(I'm hurrying).

I found that a legacy uninstall of our software had a race condition where the upgraded version would launch itself even though it was *supposed to wait* using LaunchAppAndWait with appropriate parameters.

What I've done as a work-around (for now -- not sure it's going to work)... is add the -sms switch to the mix .

What apparently is occurring is that the Setup.exe is spawned, determines the OS type, spawns the 32 bit version of the installer, and then terminates.
As far as the LAAW call can tell, this guy has finished execution and it is safe to go on.

From some code on the website, I found a VB applet that launches setup as follows:
'FYI: The InstallShield Setup.exe program is a 16-bit program that determines
'the target operating system, among other things, and then launches the
'correct engine executable. If you don't use the -sms switch, Setup.exe
'will terminate just after launching the engine with the result that the
'WaitForSingleObject call below will show a terminated process but the actual
'setup has yet to run.

'IMPORTANT: When launching an InstallShield setup, use the -sms switch.
szInstallProgName = "d:\my installations\basicvbapp\media\new media\disk images\disk1\Setup.exe -sms"

'call the setup executable, then wait until it is done
lRetVal = CreateProcessA(0&, szInstallProgName, 0&, 0&, 1&, HIGH_PRIORITY_CLASS, 0&, vbNullString, sinfo, pinfo)

-------------------------------------------------------------------

I took that and ran with it...

// this is the standard entry point. (where we normally go)
nResult = LaunchAppAndWait(szPath + "\\setup" , "-sms -s -f1" + SUPPORTDIR ^
"7311v41Uninstallsetup.iss",LAAW_OPTION_WAIT
| LAAW_OPTION_MAXIMIZED
| LAAW_OPTION_SHOW_HOURGLASS
//| LAAW_OPTION_SET_BATCH_INSTALL
);

And we will see (shortly) whether or not it works...
ok... sending up a trial baloon.
(It looks like it works on my box; now I have to try test lab).

Comments?

-e
Edmund F. Biro
consultant, Software Engineer, Visual Basic, C/C++
At Medtronic Minimed




Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 September 2004 - 08:13

Yes, if your old setup was built with InstallShield 5 for instance, -SMS would be the solution.

RobertDickau

RobertDickau
  • Members
  • 29 posts

Posted 28 September 2004 - 15:14

I seem to remember that the /SMS switch was case-sensitive, so if -sms doesn't work you might try capitalizing it...
Robert Dickau
InstallShield, a Macrovision company
InstallShield training, books, seminars, newsletters, ...