PDA

View Full Version : LaunchAppAndWait



aranda
02-14-2005, 10:35 AM
I'm trying to do a registry to a .ocx file with regsvr32.exe, and i find a solution with LaunchAppAndWait, but i don't know how to use it in the script,
someone can help me??

LewisQ
02-14-2005, 12:03 PM
Unless I missed something, why don't you just let IS register the OCX. I fail to see why use LaunchAppAndWait()...

aranda
02-14-2005, 02:40 PM
hi lewisQ... the problem is that I don't know how to registry a .ocx with IS...
before I use the Self-Regiter property but after that I tried my installer and I had to registry the .ocx with regsvr32 in start -> run.
I would like to registry my file but not manually.

Christopher Painter
02-14-2005, 02:42 PM
The problem is you open up a new thread with a narrow question rather then sticking to the original thread where the problem is better understood.

RadhaK
02-15-2005, 06:23 AM
Hi,

sample script for LaunchAppAndWait

/*--------------------------------------------------------------*\
*
* InstallShield Example Script
*
* Demonstrates the LaunchAppAndWait function.
*
* This script presents the user with three options:
*
* -- Launch Notepad; continue with installation after
* Notepad closes.
* -- Launch Notepad and continue executing installation
* immediately.
* -- Exit installation.
*
* If the user selects the first option, the installation
* launches Notepad and then waits for it to close before
* continuing. If the user selects the second option, the
* installation launches Notepad and then continues immediately
* to execute the script. If the user selects the third option,
* the installation exits.
*
\*--------------------------------------------------------------*/

#define PROGRAM WINDIR^"NotePAD.EXE"
#define LAUNCH_WAIT_TEXT "Launch Notepad; continue with installation after Notepad closes."
#define LAUNCH_GO_TEXT "Launch Notepad and continue executing installation immediately."
#define EXIT_TEXT "Exit installation."

// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"

export prototype ExFn_LaunchAppAndWait(HWND);

function ExFn_LaunchAppAndWait(hMSI)
STRING szProgram, szCmdLine, szMsg;
BOOL bLaunchAndGo, bLaunchAndWait, bExit;
NUMBER nWait;
begin

// Run the installation in a normal Window;
Enable (BACKGROUND);
Enable (DEFWINDOWMODE);

// Disable the Back button in installation dialog boxes.
Disable (BACKBUTTON);

// Get an option from the user.
AskOptions (EXCLUSIVE, "Test",
LAUNCH_WAIT_TEXT, bLaunchAndWait,
LAUNCH_GO_TEXT, bLaunchAndGo,
EXIT_TEXT, bExit);

if !bExit then

// Set variable to pass to LaunchAppAndWait
// to indicate whether or not to wait.
if bLaunchAndWait then
nWait = WAIT;
else
nWait = NOWAIT;
endif;

// Launch Notepad; the value of nWait determines
// when execution of the installation continues.
if (LaunchAppAndWait (PROGRAM, "", nWait) < 0) then
MessageBox ("Unable to launch "+ PROGRAM +".",SEVERE);
endif;

MessageBox ("Setup will now exit.", INFORMATION);

endif;

end;

Annaraj
02-25-2005, 07:01 AM
This is what am doing...


nIsFlag = FILE_EXISTS;
szOCXPath="";
szOCXPath = INSTALLDIR ^ "Test.OCX";
LongPathToQuote(szOCXPath,FALSE);
//Check if the ocx file exists
if (Is (nIsFlag, szOCXPath) = TRUE) then
//first unregister to make sure that we install the latest ocx
LaunchAppAndWait(WINDIR ^ "Regsvr32.exe /u", szOCXPath,LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN );
LaunchAppAndWait(WINDIR ^ "Regsvr32.exe", szOCXPath,LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN );
endif;
- anna