InstallShield 里LaunchApp位置问题
各位专家好!
我使用的版本:InstallShield Professional—Standard Edition6.2
操作系统:win2000
我现在要用IS来制作安装程序, 需要在COPY完文件后直接运行其中的一个程序sentcfg.exe。我看过帮助,可以使用LaunchAppAndWait或LaunchApp函数来实现。
我在用Project Wizard——Standard Setup Project做成的脚本里,只有两个函数OnFirstUIBefore() 和 OnMoving(),没有主函数。(我想是InstallShield里是事件驱动的原因。)所以,我只能在OnFirstUIBefore()里的末尾(end前)调用LaunchApp(),
我的问题:
我知道,OnFirstUIBefore()是在某台电脑上第一次运行安装时执行.所以我的程序sentcfg.exe 就只能是在第一次时能被运行,以后再要重装,sentcfg.exe就不能再被运行了!!!!但是我弄IS的目的就是为了运行它~~~~
大侠们,我的脚本里只有两个函数啊,多一个都没有~~~请问LaunchApp()语句还可以放在哪里啊???
大侠,救救我吧,我为它折腾了两个星期了~~~~~~~我都超期两天了~~~~~~~:_( 我知道大家都不是很在乎分的人,但我只能用分数报答大家,分数我现在只能给那么多,如果问题解决了,分不够,我再另外开帖子给分。
(下面附上我的脚本程序)
////////////////////////////////////////////////////////////////////////////////
//
// File Name: Setup.rul
//
// Description: InstallShield script
//
// Comments: This script was generated based on the selections you made in
// the Project Wizard. Refer to the help topic entitled "Modify
// the script that the Project Wizard generates" for information
// on possible next steps.
//
////////////////////////////////////////////////////////////////////////////////
// Include header files
#include "ifx.h"
////////////////////// string defines ////////////////////////////
//////////////////// installation declarations ///////////////////
// ----- DLL function prototypes -----
// your DLL function prototypes
// ---- script function prototypes -----
// your script function prototypes
// your global variables
//////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnFirstUIBefore
//
// EVENT: FirstUIBefore event is sent when installation is run for the first
// time on given machine. In the handler installation usually displays
// UI allowing end user to specify installation parameters. After this
// function returns, ComponentTransferData is called to perform file
// transfer.
//
///////////////////////////////////////////////////////////////////////////////
function OnFirstUIBefore()
number nResult,nSetupType;
string szTitle, szMsg;
LIST listStartCopy;
begin
// TO DO: if you want to enable background, window title, and caption bar title
// SetTitle( @TITLE_MAIN, 24, WHITE );
// SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION );
// Enable( FULLWINDOWMODE );
// Enable( BACKGROUND );
// SetColor(BACKGROUND,RGB (0, 128, 128));
TARGETDIR = PROGRAMFILES ^@COMPANY_NAME ^@PRODUCT_NAME;
Dlg_Start:
// beginning of dialogs label
Dlg_SdWelcome:
szTitle = "";
szMsg = "";
nResult = SdWelcome( szTitle, szMsg );
if (nResult = BACK) goto Dlg_Start;
Dlg_ObjDialogs:
nResult = ShowObjWizardPages(nResult);
if (nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdStartCopy:
szTitle = "";
szMsg = "";
listStartCopy = ListCreate( STRINGLIST );
//The following is an example of how to add a string(szName) to a list(listStartCopy).
//eg. ListAddString(listStartCopy,szName,AFTER);
nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
ListDestroy(listStartCopy);
if (nResult = BACK) goto Dlg_ObjDialogs;
// setup default status
SetStatusWindow(0, "");
Enable(STATUSEX);
StatusUpdate(ON, 100);
LaunchApp( TARGETDIR ^"snetcfg.exe " , ""); // 这就是我添加的语句
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnMoving
//
// EVENT: Moving event is sent when file transfer is started as a result of
// ComponentTransferData call, before any file transfer operations
// are performed.
//
///////////////////////////////////////////////////////////////////////////////
function OnMoving()
string szAppPath;
begin
// Set LOGO Compliance Application Path
// TO DO : if your application .exe is in a subfolder of TARGETDIR then add subfolder
szAppPath = TARGETDIR;
RegDBSetItem(REGDB_APPPATH, szAppPath);
RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY);
end;
// --- include script file section ---