安装时候注册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)。