开发者

Check for 32bit/64bit environment in TFSBuild.proj

开发者 https://www.devze.com 2023-03-15 14:08 出处:网络
I have a 32bit build agent on which our MSBuilds run. We recently added a new 64bit machine to our build agent array, but some things in our TFSBuild.proj file is hard coded for a 32bit machine.

I have a 32bit build agent on which our MSBuilds run. We recently added a new 64bit machine to our build agent array, but some things in our TFSBuild.proj file is hard coded for a 32bit machine.

Is it possible to check whether the environment being built on is 32 or 64bit?

<Exec Command="&quot;C:\Program Files\Microsoft Visua开发者_开发知识库l Studio 10.0\Common7\IDE\devenv.exe&quot; &quot;$(BuildDirectoryPath)\FooProduct/foo.vdproj&quot; /Build &quot;Release&quot;"/>

When running the build on a 32bit machine, it must point to C:\Program Files\... but on a 64bit machine, it must point to C:\Program Files (x86)\...

Thanks


There is $(MSBuildProgramFiles32) property in MSBuild 4.0.

More details at MSBuild Reserved Properties.

The MSBuild subfolder under the \Program Files\ or \Program Files (x86) folder. This path always points to the 32-bit Program Files folder. For example, on a 32-bit machine, the path is to the Program Files folder. For a 64-bit machine, the path is to the Program Files (x86) folder.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
         DefaultTargets="Test"
         ToolsVersion="4.0">
  <Target Name="Test">
    <Message Text="&quot;$(MSBuildProgramFiles32)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" />
  </Target>
</Project>
0

精彩评论

暂无评论...
验证码 换一张
取 消