4
<!-- Custom action to set the .NET version -->
<CustomAction Id="SetNetVersion_Cmd" Property="SetNetVersion"  Execute="immediate" Return="check" Value="$(var.SetNetVersionCmd)" />
<CustomAction Id="SetNetVersion" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>

<!-- Run the action -->
<InstallExecuteSequence>
  <Custom Action='SetNetVersion_Cmd' After='InstallFinalize' />
</InstallExecuteSequence>

这是 msi 日志显示的内容:

Action 22:02:57: SetNetVersion_Cmd. 
Action start 22:02:57: SetNetVersion_Cmd.
MSI (s) (44:9C) [22:02:57:533]: PROPERTY CHANGE: Adding SetNetVersion property. Its value is '&quot;C:\Windows\\system32\inetsrv\appcmd&quot; set config -section:applicationPools -[name=&quot;PoolName&quot;].managedRuntimeVersion:v4.0'.
Action ended 22:02:57: SetNetVersion_Cmd. Return value 1.

该池确实存在,但其 .NET 版本未更改。我究竟做错了什么?

SetNetVersionCmd 是:

'&quot;[WindowsFolder]\system32\inetsrv\appcmd&quot; set config -section:applicationPools -[\[]name=&quot;PoolName&quot;[\]].managedRuntimeVersion:v4.0'
4

2 回答 2

0

旧帖子,但有人可能会觉得这很有用,而且这个地方是一座金矿......

个人仍然使用 Wix 3.5,并且手册指出我们可以ManagedRuntimeVersion在创建应用程序池时设置,但是文档适用于 3.6 版...查看我的本地帮助文件ManagedRuntimeVersion不支持。

于 2011-12-07T17:00:34.850 回答
0

一个更简单的方法(仍然使用 AppCmd)是这样的:

AppCmd Set AppPool "PoolName" /managedRuntimeVersion:v4.0

您应该能够重用所有其余的 WiX 代码,只需更改变量的值。

于 2011-02-09T17:00:56.920 回答