【问题标题】:Custom Action to set INSTALLFOLDER path设置 INSTALLFOLDER 路径的自定义操作
【发布时间】:2021-12-29 12:23:47
【问题描述】:

所以我创建了这个 customAction,它可以让我使用 Registries 获取另一个应用程序的路径

string value = Registry.GetValue(userRoot, key, -1).ToString();
session["INSTALLLOCATION"] = value; 

而且它有效。问题是我如何将它发送回 .wxs 文件并将某些东西的安装路径设置为该字符串值。我在 Wix 文件中有这个东西:


    <CustomAction Id="CustomAction" Property="CustomAction2" Value="path=[INSTALLLOCATION]" />
    
    <Binary Id="CustomActionBinary" SourceFile="$(var.ProAdmin_TargetDir)ExtractRegistryPath\bin\Debug\ExtractRegistryPath.CA.dll"/>
    <CustomAction Id="CustomAction2" Impersonate="no" BinaryKey="CustomActionBinary" DllEntry="CustomAction1" Return="check" Execute="deferred"/>

<InstallUISequence>
      <Custom Action="CustomAction" Before="CustomAction2" />
      <Custom Action='CustomAction2' Before="ExecuteAction" />
    </InstallUISequence>

这个东西会抛出2762错误代码。

【问题讨论】:

    标签: wix custom-action wix3 wix3.7 wix3.6


    【解决方案1】:

    您收到错误 2762,因为您不能在 InstallUISequence 中执行延迟操作。填充 INSTALLLOCATION 属性的自定义操作应在 InstallUISequence 和 InstallExecuteSequence 开始时作为“立即”操作调用 - 并且 - INSTALLLOCATION 应该是目录表中的文件夹。

    【讨论】:

      猜你喜欢
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      • 2021-03-29
      • 1970-01-01
      • 2020-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多