I'm having some trouble with the LaunAppAndWait function, specifically how to pass a file location as a part of an msiexec command line parameter.
As part of my project, once all the required application files are copied onto the target machine, the installer also copies the setup files for a couple of support applciations and drivers into a separate directory under the TARGETDIR. I then call the LaunchAppAndWait function to run these setup files.
One of thesupport apps is ActiveSync 4.5, which is supplied as an MSI installer. I can get the Setup.exe files for the other support apps to execute without a problem, but when it come to the ActiveSync setup, I need to call msiexec to run the installation. As the setup.msi file is in a custom location I need to pass the file location as a command line parameter. My question is how to pass this file location as a command line parameter.
This is my script so far for all the LaunchAppAndWait functions.
function OnFirstUIAfter()
STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
NUMBER bvOpt1, bvOpt2;
NUMBER bShowUpdateServiceDlg;
BOOL bLaunch_ActiveSync_AndWait,
bLaunch_WAPUSB_AndWait,
bLaunch_BlueToothDrv_AndWait;
NUMBER nWait;
STRING szDirPath;
begin
// Installer will ask the user to specify which additional
// options they wish to install on the target PC.
Dlg_OtherApplications:
Disable (BACKBUTTON);
AskOptions (NONEXCLUSIVE, "Additional Options",
"Install Microsoft ActiveSync 4.5", bLaunch_ActiveSync_AndWait,
"Install WorkAbout Pro USB Drivers", bLaunch_WAPUSB_AndWait,
"Install Belkin BlueTooth Drivers", bLaunch_BlueToothDrv_AndWait
);
// Launch Microsoft ActiveSync Installer
if bLaunch_ActiveSync_AndWait then
if(LaunchAppAndWait
("msiexec.exe", "/i setup.msi",WAIT) < 0) then
MessageBox ("Unable to launch Setup.", SEVERE);
endif;
endif;
// Launch WorkAbout PRO USB Drivers Installer
if bLaunch_WAPUSB_AndWait then
if(LaunchAppAndWait
(TARGETDIR^"\\!Additional\\WAP USB Drivers\\usbsetup-wapro.exe","",WAIT) < 0) then
MessageBox ("Unable to launch Setup.", SEVERE);
endif;
endif;
// Launch Belkin USB BlueTooth Adaptor Drivers Installer
if bLaunch_BlueToothDrv_AndWait then
if(LaunchAppAndWait
(TARGETDIR^"\\!Additional\\Belkin BlueTooth Drivers\\setup.exe","",WAIT) < 0) then
MessageBox ("Unable to launch Setup.", SEVERE);
endif;
endif;
The full path to the ActiveSync installer is as follows:
TARGETDIR^\\!Additional\\ActiveSync\\ActiveSync 4.5\\setup.msi
I don't need the installer to run in quiet mode or anything like that, I literally just need to call it up.
Any help would be greatly appreciated!
Martin
Edited by sis_bakerm, 29 July 2009 - 15:37.