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


4 replies to this topic

Gadlakha

Gadlakha
  • Members
  • 18 posts

Posted 04 February 2005 - 10:41

Hi.
I am creating a setup program using InstallShieldX. I have a requirement under which I have to launch another .msi package from within my script. I am using the following code...

function NUMBER LaunchPostGREInstall()
STRING szProgram, svPath;
STRING szParam;
NUMBER nResult;
begin
Enable (USE_LOADED_SKIN);
szProgram = WINSYSDIR^"msiexec.exe";
svPath = SRCDIR^"postgresql-8.0.msi";
LongPathToQuote(svPath,TRUE);
szParam= "/i " + svPath;
nResult = LaunchAppAndWait(szProgram,szParam,WAIT|LAAW_OPTION_NO_CHANGEDIRECTORY);
return nResult;
end;

The problem is that I want my original installation to hault till the time this package is completely installed or terminated, but this is not happening. It happens only for the first window of the packeage. But as soon as I click NEXT on that window, my original setup regains the control, which I don't want to happen.

I found that I should use \SMS, but my problem is I don't know where should I place that switch....I tries....
szParam= "/i " + svPath + "-SMS";
nResult = LaunchAppAndWait(szProgram,szParam ,WAIT);

But this doesnot work.

Any input from your side will be of great help.
Thanks & regards.
Gautam Adlakha.

Edited by Gadlakha, 04 February 2005 - 12:14.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 February 2005 - 15:02

The -SMS parameter only applies to InstallScript based setups not to Windows Installer (MSI) setups.
You may need to use an MSI API function to be able to wait for the completion. Or you run that other MSI as a prerequisite.

Gadlakha

Gadlakha
  • Members
  • 18 posts

Posted 07 February 2005 - 04:41

Can you please help me with that. Which MSI API function shall I use and how do I exactly use it. If you could please provide me with some example of just few lines of the script to follow through, it would be of great help.
Awaiting an early response.
Thanks & Regards.
Gautam Adlakha.

Edited by Gadlakha, 07 February 2005 - 08:53.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 February 2005 - 15:26

MsiInstallProduct comes to mind. It's documented in MSI Help.
However in general it's not a very godd idea to launch one MSI from another (and it will only work in the UI sequence). It may be better to use a setup prerequisite instead.

vishnub

vishnub
  • Full Members
  • 63 posts

Posted 09 February 2005 - 12:35

Hi Gadlakha,
I had one such requirement, there instead of msi, i called a setup.exe. Setup.exe in turn call the msiexec.exe. So try this.
Put the msi file in SUPPORTDIR

And make the InstallScript to launch the msi at the last part of OnFirstUIBefore() Event.

Dlg_STATUSEX:
Enable(STATUSEX);
szProgram = SystemFolder ^ "msiexec.exe";
szCmdLine = SUPPORTDIR ^"postgresql-8.0.msi";
LaunchAppAndWait(szProgram,szCmdLine,LAAW_OPTION_WAIT);
return 0;

Add required options for msiexec.exe, i hope now the installer will wait, till the execution of the msi.


Regards,
Vishnu smile.gif