我试图在Wix中设置一个小的“先决条件”对话框,让用户相信他们拥有运行我的软件所需的所有东西:
例如,我需要托管DirectX,所以我寻找一些DLL:
<Property Id="MANAGED_DIRECTX">
<DirectorySearch Path="$(env.SystemRoot)\Microsoft.NET\DirectX for Managed Code\1.0.2902.0" Depth="0" Id="MDXDir">
<FileSearch Name="Microsoft.DirectX.dll"/>
</DirectorySearch>
</Property>
<Property Id="MANAGED_DIRECTX_DIRECTINPUT">
<DirectorySearch Path="$(env.SystemRoot)\Microsoft.NET\DirectX for Managed Code\1.0.2902.0" Depth="0" Id="MDXInputDir">
<FileSearch Name="Microsoft.DirectX.DirectInput.dll"/>
</DirectorySearch>
</Property>我还有一个CustomAction来组合我的条件逻辑:
<CustomAction Id="SetManagedDirectXInstalled"
Property="MANAGED_DIRECTX_INSTALLED"
Value="NOT([MANAGED_DIRECTX] = '') AND NOT ([MANAGED_DIRECTX_DIRECTINPUT] = ''")/>对此CustomAction进行了排序:
<InstallExecuteSequence>
<Custom Action="SetManagedDirectXInstalled" After="AppSearch" />
<RemoveExistingProducts After="InstallInitialize" />
</InstallExecuteSequence>我现在应该能够做的是使用“托管DIRECTX安装”来做一些事情。
<Control Id="NoManagedDirectX" Type="Text" X="20" Y="50" Width="300" Height="60" Transparent="yes" NoPrefix="yes" Hidden="yes">
<Text>Microsoft Managed DirectX (MDX) for DirectX 9.0 is NOT installed</Text>
<Condition Action="show">NOT MANAGED_DIRECTX_INSTALLED</Condition>
</Control>
<Control Id="ManagedDirectX" Type="Text" X="20" Y="50" Width="300" Height="60" Transparent="yes" NoPrefix="yes" Hidden="yes">
<Text>Microsoft Managed DirectX (MDX) for DirectX 9.0 is correctly installed</Text>
<Condition Action="show">MANAGED_DIRECTX_INSTALLED</Condition>
</Control>不管我做什么,条件总是错误的(例如,没有安装),即使我知道文件在那里。使用带有/l*vx的msiexec命令不会在任何地方显示托管DIRECTX已安装的属性。
当a与下面的内容一起使用时,它成功地阻止了安装(尽管在本例中我不再想阻止安装,只需通知)。
<Condition Message="You must have Microsoft Managed DirectX (MDX) for DirectX 9.0 installed">
MANAGED_DIRECTX AND MANAGED_DIRECTX_DIRECTINPUT
</Condition>我如何跟踪/调试这个(或者我做错了什么?)
编辑-我现在确定我的CustomAction甚至没有被调用,将其设置为下面也没有显示预期的结果!
<CustomAction Id='SetManagedDirectXInstalled'
Property='MANAGED_DIRECTX_INSTALLED'
Value='Something hard-coded'/>或
<CustomAction Id='SetManagedDirectXInstalled'
Error='Some error should show!'/>发布于 2009-06-18 17:30:07
我想我可能已经找到了答案,但我无法尝试,直到我下一个在我的开发PC。
看来,我必须将这些值与TRUE/FALSE (或空字符串)进行比较,而不仅仅是期望它作为布尔值(来源)工作。
在这些表达式中,可以使用属性名称(请记住它们区分大小写)。不存在的属性名称将被视为空字符串。属性的逻辑值反映它是否已经设置--这意味着您不能简单地使用该属性来检查逻辑值:
发布于 2009-06-18 18:57:37
https://stackoverflow.com/questions/1013140
复制相似问题