Basic INFO:InstallShield的InstallScript MSI工程中如何添加用户协议界面
2011-03-31 14:58 Kevin.Wan 阅读(1059) 评论(0) 编辑 收藏 举报在InstallShield中,通过工程向导创建的InstallScript MSI工程中,默认情况下是没有用户协议界面的。
所以我们需要通过修改脚本的方式实现:
首先是在事件响应函数OnFirstUIBefore中添加SdLicense2Ex,部分代码段见:
Dlg_SdWelcome:
szTitle = "";
szMsg = "";
nResult = SdWelcome(szTitle, szMsg);
if (nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdLicense2:
szTitle = "";
szOpt1 = "";
szOpt2 = "";
//{{IS_SCRIPT_TAG(License_File_Path)
szLicenseFile = SUPPORTDIR ^ "License.rtf";
//}}IS_SCRIPT_TAG(License_File_Path)
//{{IS_SCRIPT_TAG(Dlg_SdLicense2)
nResult = SdLicense2Ex( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted, TRUE );
//}}IS_SCRIPT_TAG(Dlg_SdLicense2)
if (nResult = BACK) then
goto Dlg_SdWelcome;
else
bLicenseAccepted = TRUE;
endif;
Dlg_SdRegisterUser:
szMsg = "";
szTitle = "";
nResult = SdRegisterUser( szTitle, szMsg, svName, svCompany );
if (nResult = BACK) goto Dlg_SdLicense2;
szTitle = "";
szMsg = "";
nResult = SdWelcome(szTitle, szMsg);
if (nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdLicense2:
szTitle = "";
szOpt1 = "";
szOpt2 = "";
//{{IS_SCRIPT_TAG(License_File_Path)
szLicenseFile = SUPPORTDIR ^ "License.rtf";
//}}IS_SCRIPT_TAG(License_File_Path)
//{{IS_SCRIPT_TAG(Dlg_SdLicense2)
nResult = SdLicense2Ex( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted, TRUE );
//}}IS_SCRIPT_TAG(Dlg_SdLicense2)
if (nResult = BACK) then
goto Dlg_SdWelcome;
else
bLicenseAccepted = TRUE;
endif;
Dlg_SdRegisterUser:
szMsg = "";
szTitle = "";
nResult = SdRegisterUser( szTitle, szMsg, svName, svCompany );
if (nResult = BACK) goto Dlg_SdLicense2;
在函数OnFirstUIBefore中增加如下变量定义代码段:
STRING szOpt1, szOpt2;
BOOL bLicenseAccepted;
BOOL bLicenseAccepted;
最后一步是在Support Files/Billboards -> Support Files下添加License.rtf文件(注意如果是多语言版本,需要放到对应的语言目录下)。
版权声明: 转载时请务必以超链接形式标明文章原始出处和作者信息
万炳宏(Kevin Wan)
Avizo/Amira技术交流,欢迎加我微信:13911850365或QQ:17842153