繁体   English   中英

设置 INSTALLFOLDER 路径的自定义操作

[英]Custom Action to set INSTALLFOLDER path

所以我创建了这个 customAction 让我使用注册表获取另一个应用程序的路径

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错误代码

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM