到目前为止,我发现WIX不是我最喜欢的最直观,易用的语言/系统。
我创建了一个自定义对话框,输入了数据,并查看了安装日志中的值。
MSI (c) (C8:A4) [14:42:37:137]: PROPERTY CHANGE: Modifying VARRADIOBUTTONENVIRONMENT property. Its current value is 'Dev'. Its new value: 'QA'.
MSI (c) (C8:A4) [14:42:41:448]: PROPERTY CHANGE: Modifying VARTEXTSETTINGSFILENAME property. Its current value is 'C:\Path\SettingsFileGenerator.xml'. Its new value: 'Test1234.txt'.
稍后,当需要使用该值时,我会看到:
Action ended 14:42:43: InstallFinalize. Return value 1.
MSI (s) (BC:F8) [14:42:43:676]: Doing action: QtExec1
Action 14:42:43: QtExec1.
Action start 14:42:43: QtExec1.
MSI (s) (BC:F4) [14:42:43:682]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIC4A7.tmp, Entrypoint: CAQuietExec
MSI (s) (BC!BC) [14:42:43:690]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"[INSTALLLOCATION]XmlPreprocess.exe /i:web.config /e:[VARRADIOBUTTONENVIRONMENT] "'.
CAQuietExec: Error 0x8007007b: Command failed to execute.
CAQuietExec: Error 0x8007007b: CAQuietExec Failed
Action ended 14:42:43: QtExec1. Return value 3.
Action ended 14:42:43: INSTALL. Return value 3.
Property(S): StartIIS7ConfigTransaction = ScaConfigureIIs
最后当它转储所有属性时,它会显示:
财产(S):VARRADIOBUTTONENVIRONMENT = QA 物业(S):VARTEXTSETTINGSFILENAME = Test1234.txt 物业(S):VerifyCurrentPropValueOfEnv = [VARRADIOBUTTONENVIRONMENT]
以下是我的代码片段。我刚刚将属性ID更改为全部大写,并根据我看到的另一篇文章添加了secure =“yes”。我已经尝试过使用和不使用Secure =“是”。
<Property Id="VARRADIOBUTTONENVIRONMENT" Secure="yes">Dev</Property>
<Property Id="VARTEXTSETTINGSFILENAME" Secure="yes">C:\Path\SettingsFileGenerator.xml</Property>
...then later...
<Property Id="VerifyCurrentPropValueOfEnv" Value="[VARRADIOBUTTONENVIRONMENT]"/>
<Property Id="QtExecCmdLine" Value=""[INSTALLLOCATION]XmlPreprocess.exe /i:web.config /e:[VARRADIOBUTTONENVIRONMENT] ""/>
<CustomAction Id="QtExec1" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
<InstallExecuteSequence>
<Custom Action="QtExec1" After="InstallFinalize"><![CDATA[NOT(Installed)]]></Custom>
</InstallExecuteSequence>
在安装结束时,我看到XmlPreProcess.exe安装在安装目录中。
问题:
有什么我做错了让价值取代?
我正在使用CAQuietExec,因为我被告知它会记录更好的错误并将命令窗口的输出回显到安装日志。我真的不在乎没有看到命令窗口。我不知道如何找出这意味着什么: “CAQuietExec:错误0x8007007b:命令无法执行。”我不知道这是一个WIX错误试图调用XmlPreprocess.exe或它是否进入XmlPreprocess然后抛出错误。
谢谢,
Neal Walters
答案 0 :(得分:8)
查看日志提取我认为我可以看到问题,你引用了整个命令行,试试这个:
<Property Id="QtExecCmdLine" Value=""[INSTALLLOCATION]XmlPreprocess.exe" /i:"[INSTALLLOCATION]web.config" /e:[VARRADIOBUTTONENVIRONMENT]"/>