所以我创建了这个customAction,它使用Registrys 为我获取另一个应用程序的路径
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)ExtractRegistryPathbinDebugExtractRegistryPath.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应为Directory表中的文件夹。