Installshield 2008 And 脚本 (七 )

安装时候注册Filter

手动注册Filter的命令为:

regsvr32.exe  AZImageProcess.ax  OR

regsvr32.exe /s  AZImageProcess.ax 

那么我们利用这个.exe.命令注册Filter,同样可以在InstallShield中完成。

1.如下图所示,Installation Designer  ------> Behavior and Logic -------------> Support files/Billboards 然后在出现的右侧窗口中,Support Files -> Language Indepenents, 单击右键,插入 File Ink,这样可以Browe电脑选中 C:/Windows/System32/Regsvr32.exe

这时Regsvr32.exe可以当作已经在工程目录下,在Script中不用写带Path就可以直接使用了。

在我的工程脚本中,我重载了OnFirstUIAfter函数。这个函数句柄表示在OnMoveData之后会响应处理的事件。

我处理的事件为注册Filter,修改注册表,安装驱动,将用户选择的语言类别写入配置文件(ini文件)。

function OnFirstUIAfter()

    STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;

    NUMBER bvOpt1, bvOpt2;

    NUMBER bShowUpdateServiceDlg;    

    STRING szCommandLine, szSourceFilePath, szTargetFilePath, szPath; 

begin    

	 

	// create uninstall shortcut

    	ISCopyFiles();

    	ISShortcut();

	/ 

    	Delay(1);

	

	// filter register                                            

    	szPath = TARGETDIR;

    	szSourceFilePath = "regsvr32.exe";      

    	szTargetFilePath = szPath ^ "AZImageProcess.ax";    

	SetFileInfo(szTargetFilePath,FILE_ATTRIBUTE,FILE_ATTR_NORMAL,"");	

	ChangeDirectory(szPath);

	LongPathToShortPath  ( szTargetFilePath );

	szCommandLine ="/s" + szTargetFilePath;             

	LaunchAppAndWait ( szSourceFilePath , szCommandLine , WAIT ); 

	//

	

	// install camera virtual driver   

    	szPath = TARGETDIR ^ "Virtual Cam Driver";

    	szSourceFilePath = szPath ^ "VDrvInst.exe";      

    	szTargetFilePath = szPath ^ "ECamVideo.inf";	

		                               

	LongPathToShortPath  ( szSourceFilePath );	                               

	LongPathToShortPath  ( szTargetFilePath );

	szCommandLine =  szTargetFilePath;             

	LaunchAppAndWait ( szSourceFilePath , szCommandLine , WAIT ); 

	Delay(5);      

	

	//

	// Write user selected language to the LanguageConfig.ini  

	szPath = TARGETDIR ^ "Config.ini";

	switch(SELECTED_LANGUAGE)

		case ISLANG_CHINESE_SIMPLIFIED:

			AddProfString(szPath, "LanguageSet", "Language", "CHS");			

		case ISLANG_CHINESE_TRADITIONAL: 

			AddProfString(szPath, "LanguageSet", "Language", "CHT");	

		case ISLANG_ENGLISH:

			AddProfString(szPath, "LanguageSet", "Language", "ENU");	

	endswitch;

	



    	ShowObjWizardPages(NEXT);

    

    	szTitle = "";

    	szMsg1 = ""; 

    	szMsg2 = "";

    	szOpt1 = "";

    	szOpt2 = "";

	bvOpt1   = FALSE;

   	 bvOpt2   = FALSE;    



	// Set this to true if you have the update service enabled, and if you want to check for updates.

	// Note: the ISUS Starter Edition does not support checking for updates programatically.  So, 

	// only set this to true if you have at least the ISUS Professional Edition.

	bShowUpdateServiceDlg = FALSE;

    

    	//{{IS_SCRIPT_TAG(Dlg_SdDinishEx)	

    

   	if ( BATCH_INSTALL ) then

    		SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );

    	else

		

	// If the update service is enabled, show finish dialog that includes

	// update check option.

		if( bShowUpdateServiceDlg && ( ENABLED_ISERVICES & SERVICE_ISUPDATE ) ) then

			if( SdFinishUpdateEx( szTitle, szMsg1, szMsg2, szOpt1, szOpt2, TRUE ) ) then

			// Don't check for updates in silent mode.

			if( MODE != SILENTMODE ) then

				UpdateServiceCheckForUpdates( "", FALSE );

			endif;



		endif;



		else

			SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bvOpt1 , bvOpt2 );

		endif;



    	endif;

    //}}IS_SCRIPT_TAG(Dlg_SdDinishEx)	

end;

 

其中有/部分我是我自己添加的部分代码。其他的是系统为函数自动生成的。 Filter注册。AZImageProcess我已经在拷贝文件部分(上一篇,复制到安装路径目录去了)。注意OnFirstUIAfter这个函数已经在复制文件之后响应(即使你代码中没有写OnMoveData)。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值