杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2416|回复: 0

InstallShield的InstallScript MSI工程中如何添加用户协议界面

[复制链接]
发表于 2017-3-27 15:24:15 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
在InstallShield中,通过工程向导创建的InstallScript MSI工程中,默认情况下是没有用户协议界面的。
所以我们需要通过修改脚本的方式实现:

首先是在事件响应函数OnFirstUIBefore中添加SdLicense2Ex,部分代码段见:
  1. Dlg_SdWelcome:
  2.     szTitle = "";
  3.     szMsg   = "";
  4.     nResult = SdWelcome(szTitle, szMsg);
  5.     if (nResult = BACK) goto Dlg_SdWelcome;
  6.    
  7. Dlg_SdLicense2:
  8.     szTitle = "";
  9.     szOpt1 = "";
  10.     szOpt2 = "";
  11.     //{{IS_SCRIPT_TAG(License_File_Path)
  12.     szLicenseFile = SUPPORTDIR ^ "License.rtf";
  13.     //}}IS_SCRIPT_TAG(License_File_Path)
  14.     //{{IS_SCRIPT_TAG(Dlg_SdLicense2)
  15.     nResult = SdLicense2Ex( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted, TRUE );
  16.     //}}IS_SCRIPT_TAG(Dlg_SdLicense2)
  17.     if (nResult = BACK) then
  18.         goto Dlg_SdWelcome;
  19.     else
  20.         bLicenseAccepted = TRUE;
  21.     endif;

  22. Dlg_SdRegisterUser:
  23.     szMsg = "";
  24.     szTitle = "";
  25.     nResult = SdRegisterUser( szTitle, szMsg, svName, svCompany );
  26.     if (nResult = BACK) goto Dlg_SdLicense2;
复制代码


在函数OnFirstUIBefore中增加如下变量定义代码段:
    STRING szOpt1, szOpt2;
    BOOL bLicenseAccepted;
最后一步是在Support Files/Billboards -> Support Files下添加License.rtf文件(注意如果是多语言版本,需要放到对应的语言目录下)。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-18 13:24 , Processed in 0.121872 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表