chocolatey/chocolatey — pull request #479 by jberezanski (2014-05-26 22:02:59+00:00)
Title: Build script fixes: hardcoded Chocolatey directory, use 64-bit msbuild

1) Replace hardcoded %systemdrive%\chocolateyinstall with %ChocolateyInstall% in build.proj (similar to GH-477)
2) Use 64-bit msbuild to run build.proj if it is available (i.e. on 64-bit systems)

To elaborate on the second one:

The intention is to consistently use the platform-native PowerShell to run tests.The tests.cmd script invokes PowerShell as %windir%\System32\WindowsPowerShell\v1.0\powershell.exe, which, when run from the default command prompt on a 64-bit OS (64-bit cmd.exe), results in 64-bit PowerShell being invoked. The build.bat script, however, invoked %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe, which is 32-bit (the 64-bit version is in Framework64). This caused tests.cmd to be executed with 32-bit cmd.exe and System32 (in path to powershell.exe) to be translated to SysWOW64, thus resulting in 32-bit PowerShell being invoked to run the tests.

Using 64-bit msbuild, if present, makes test behavior consistent between the two scripts and, in particular, ensures the tests are run using the default PowerShell for the platform when building the release package.