<!-- 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>
Here is what the msi log shows:
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 '"C:\Windows\system32\inetsrv\appcmd" set config -section:applicationPools -[name="PoolName"].managedRuntimeVersion:v4.0'. Action ended 22:02:57: SetNetVersion_Cmd. Return value 1.
The pool does exist but its.NET version is not changed. What am I doing wrong?
The SetNetVersionCmd is:
'"[WindowsFolder]\system32\inetsrv\appcmd" set config -section:applicationPools -[[]name="PoolName"[]].managedRuntimeVersion:v4.0'