Cookie Settings

In the last few releases when we have been using WIX 3.5 as a base for our MSI installations, a lot of people have encountered a bug in WIX 3.5 where %windir% has been string-compared to C:\Windows, i.e. failing the installation with a pesky “Failed to register ISAPICGI Restrictions” in the MSI log. To get around this, I wrote a little piece of powershell which changes the reference to the proper one. Also, all our new installations are based on WIX 3.7 so we don’t have these issues any more for new installations. Powershell of course! J

Script:

Import-Module webadministration

 function Is64Bit{

[IntPtr]::Size -eq 8

}

function EnableIsapiRestriction($oldisapiPath){

$isapiConfiguration = get-webconfiguration “/system.webServer/security/isapiCgiRestriction/add[@path=’$oldisapiPath‘]/@allowed”
set-webconfiguration “/system.webServer/security/isapiCgiRestriction/add[@path=’$oldisapiPath‘]/@allowed” -value “True” -PSPath:IIS:\
s
et-webconfiguration “/system.webServer/security/isapiCgiRestriction/add[@path=’$oldisapiPath‘]/@path” -value $newframeworkPath -PSPath:IIS:\
Write-Host “Enabled ISAPI – $newframeworkPath -ForegroundColor Green }

  function EnableDotNet40Isapi($systemArchitecture){
$oldframeworkPath = “%windir%\Microsoft.NET\Framework$systemArchitecture\v4.0.30319\aspnet_isapi.dll”
$newframeworkPath = $env:windir\Microsoft.NET\Framework$systemArchitecture\v4.0.30319\aspnet_isapi.dll”
EnableIsapiRestriction $oldframeworkPath}

function
Main(){
if (Is64Bit)

{
EnableDotNet40Isapi “64”
}
EnableDotNet40Isapi}

  Main