LaunchConditions 之前的自定义操作
我需要检查框架版本、操作系统版本和启动条件之前的管理员权限。我的操作系统版本和管理条件按预期工作,但框架版本不工作。 NETFRAMEWORK35 未填充。下面是我的代码。
<PropertyRef Id="NETFRAMEWORK35" />
<UI>
<UIRef Id='...'/>
<Error Id="2001">Please uninstall older version of this product to continue.</Error>
<Error Id="2002">This application is only supported on Windows Server 2008(64 bit) or Windows 2003(32 or 64 bit).</Error>
<Error Id="2003">Microsoft .NET Framework Version 3.5 is missing. To download please visit $(var.FrameworkDownload)</Error>
<Error Id="2004">You need to be an administrator to install this product.</Error>
</UI>
<CustomAction Id="CurrentVersionDetected" Error="2001"/>
<CustomAction Id="WrongOSVersionDetected" Error="2002" />
<CustomAction Id="FrameworkMissing" Property="NETFRAMEWORK35" Error="2003" />
<CustomAction Id="IsNotAdministrator" Error="2004" />
<InstallExecuteSequence>
<Custom Action="IsNotAdministrator" After="FrameworkMissing">
<![CDATA[NOT(Installed OR Privileged)]]>
</Custom>
<Custom Action="FrameworkMissing" After="WrongOSVersionDetected">
**<![CDATA[NETFRAMEWORK35]]> //This is make sure it is getting fired, but not**
</Custom>
<Custom Action="WrongOSVersionDetected" After="FindRelatedProducts">
<![CDATA[NOT(Installed OR VersionNT = 601 OR (VersionNT = 600 AND VersionNT64))]]>
</Custom>
<Custom Action="CurrentVersionDetected" After="AppSearch">SELFFOUND</Custom>
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="IsNotAdministrator" After="FrameworkMissing">
<![CDATA[NOT(Installed OR Privileged)]]>
</Custom>
<Custom Action="FrameworkMissing" After="WrongOSVersionDetected">
**<![CDATA[NETFRAMEWORK35]]> //This is make sure it is getting fired, but not**
</Custom>
<Custom Action="WrongOSVersionDetected" After="FindRelatedProducts">
<![CDATA[NOT(Installed OR VersionNT = 601 OR (VersionNT = 600 AND VersionNT64))]]>
</Custom>
<Custom Action="CurrentVersionDetected" After="AppSearch">SELFFOUND</Custom>
</InstallUISequence>
But strangely same action work if i put it after InstallValidate
<Custom Action="FrameworkMissing" After="InstallValidate">
**<![CDATA[NETFRAMEWORK35]]> //This is fired**
</Custom>
i need to check Framework version, OS version & Admin privileges before LaunchConditions. My OS Version & Admin conditions works as expected, but not framework version. NETFRAMEWORK35 is not getting populated. Below is my code.
<PropertyRef Id="NETFRAMEWORK35" />
<UI>
<UIRef Id='...'/>
<Error Id="2001">Please uninstall older version of this product to continue.</Error>
<Error Id="2002">This application is only supported on Windows Server 2008(64 bit) or Windows 2003(32 or 64 bit).</Error>
<Error Id="2003">Microsoft .NET Framework Version 3.5 is missing. To download please visit $(var.FrameworkDownload)</Error>
<Error Id="2004">You need to be an administrator to install this product.</Error>
</UI>
<CustomAction Id="CurrentVersionDetected" Error="2001"/>
<CustomAction Id="WrongOSVersionDetected" Error="2002" />
<CustomAction Id="FrameworkMissing" Property="NETFRAMEWORK35" Error="2003" />
<CustomAction Id="IsNotAdministrator" Error="2004" />
<InstallExecuteSequence>
<Custom Action="IsNotAdministrator" After="FrameworkMissing">
<![CDATA[NOT(Installed OR Privileged)]]>
</Custom>
<Custom Action="FrameworkMissing" After="WrongOSVersionDetected">
**<![CDATA[NETFRAMEWORK35]]> //This is make sure it is getting fired, but not**
</Custom>
<Custom Action="WrongOSVersionDetected" After="FindRelatedProducts">
<![CDATA[NOT(Installed OR VersionNT = 601 OR (VersionNT = 600 AND VersionNT64))]]>
</Custom>
<Custom Action="CurrentVersionDetected" After="AppSearch">SELFFOUND</Custom>
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="IsNotAdministrator" After="FrameworkMissing">
<![CDATA[NOT(Installed OR Privileged)]]>
</Custom>
<Custom Action="FrameworkMissing" After="WrongOSVersionDetected">
**<![CDATA[NETFRAMEWORK35]]> //This is make sure it is getting fired, but not**
</Custom>
<Custom Action="WrongOSVersionDetected" After="FindRelatedProducts">
<![CDATA[NOT(Installed OR VersionNT = 601 OR (VersionNT = 600 AND VersionNT64))]]>
</Custom>
<Custom Action="CurrentVersionDetected" After="AppSearch">SELFFOUND</Custom>
</InstallUISequence>
But strangely same action work if i put it after InstallValidate
<Custom Action="FrameworkMissing" After="InstallValidate">
**<![CDATA[NETFRAMEWORK35]]> //This is fired**
</Custom>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您使用 WiX NetFx NETFRAMEWORK35 属性,则需要在 AppSearch 之后安排 FrameworkMissing,这是处理RegistrySearch 的标准操作。
Assuming you're using the WiX NetFx NETFRAMEWORK35 property, you need to schedule FrameworkMissing after AppSearch, which is the standard action that processes RegistrySearch.
使用product.wxs 中的此代码来检查是否需要框架。
我在这里检查 .net Framework 2.0。同样,您可以更改条件来检查其他版本
Use this code in product.wxs to check for require frameworks.
Here i am checking for .net framework 2.0. Similarly you can change the condition to check for other versions