Basic MSI工程类型中如果实现动态指定安装路径的功能,下面介绍的方法也适用于InstallScript MSI工程。

1. 在Setup Design中找到相对应的Component。

2. 点击Destination的后侧的“...”按键。

3. 在Browse for Directory对话框中,选中Destination Computer后点击鼠标右键选择“New Directory” ,默认会参数一个NEW_DIRECTORY1,点击OK。

4. 在Property Manager中添加一个 NEW_DIRECTORY1属性。

5. 在脚本中添加如下代码:

export prototype SetRuntimeProperty(function SetRuntimeProperty(hMSI) 
    STRING szRuntimeDestination ;
    NUMBER nCnt;
begin;  
    szRuntimeDestination C:\\Kevin WanMsiSetProperty(hMSI,NEW_DIRECTORY1,szRuntimeDestination);

6. 添加一个CA,与脚本函数SetRuntimeProperty绑定。

7. 将CA插入到User Interface序列中,放到SetupInitialization之后,设置运行条件为:Not Installed。

8. 编译,运行安装包。 

相关文章:

  • 2022-12-23
  • 2021-04-20
  • 2021-09-14
  • 2021-09-10
  • 2021-12-09
  • 2021-09-29
  • 2021-11-29
  • 2022-01-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-12-05
相关资源
相似解决方案