Fixed MSDeploy InstallPath for WebApplicationGallery

Check if running in 32bit mode under 64bit Windows (WOW64) - works with .NET 2.0+

http://blogs.msdn.com/b/david.wang/archive/2006/03/26/howto-detect-process-bitness.aspx
This commit is contained in:
DanVB 2012-05-04 11:23:27 +01:00
parent f2c4ad4345
commit 0ae5ff96b5

View file

@ -121,6 +121,13 @@ namespace WebsitePanel.Providers.Web
Array.ForEach(versionKeys, (x) => { Log.WriteInfo("MSDeploy version key found: {0}", x); });
// Determine appropriate key name to query for
var installPathKey = (IntPtr.Size == 8) ? "InstallPath" : "InstallPath_x86";
// Check if running in 32bit mode under 64bit Windows (WOW64) - works with .NET 2.0+
if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432") == "AMD64")
{
installPathKey = "InstallPath_x64";
}
var fileVersion = String.Empty;
//
var libPath = String.Empty;