Skip to content

Commit 572c265

Browse files
committed
Fix setenv scripts
1 parent 6408074 commit 572c265

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

setup_ps_env.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ function Get-Batchfile ($file) {
88

99
function VsVars32()
1010
{
11-
$vs100comntools = (Get-ChildItem env:VS110COMNTOOLS).Value
12-
$batchFile = [System.IO.Path]::Combine($vs100comntools, "vsvars32.bat")
11+
$vs110comntools = (Get-ChildItem env:VS110COMNTOOLS).Value
12+
$batchFile = [System.IO.Path]::Combine($vs110comntools, "vsvars32.bat")
1313
Get-Batchfile $BatchFile
1414
}
1515

1616
"Initializing Casablanca Powershell VS2012 Environment"
1717

1818
# get VS tools
1919
VsVars32
20+
21+
# set VisualStudioVersion - this is set by vcvarsall.bat under VS 11 and is needed to correctly build
22+
# on a machine with both Dev10 and Dev11 installed.
23+
$Env:VisualStudioVersion = "11.0"
24+
25+
# set environment variable to select between Dev10 and Dev11 projects in the various dirs.proj
26+
$Env:DevToolsVersion = "110"

setup_ps_env100.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Param([string]$TfsWorkspace='')
2+
3+
function Get-Batchfile ($file) {
4+
$cmd = "`"$file`" & set"
5+
cmd /c $cmd | Foreach-Object {
6+
$p, $v = $_.split('=')
7+
Set-Item -path env:$p -value $v
8+
}
9+
}
10+
11+
function VsVars32()
12+
{
13+
$vs100comntools = (Get-ChildItem env:VS100COMNTOOLS).Value
14+
$batchFile = [System.IO.Path]::Combine($vs100comntools, "vsvars32.bat")
15+
Get-Batchfile $BatchFile
16+
}
17+
18+
"Initializing Casablanca Powershell VS2010 Environment"
19+
20+
# get VS tools
21+
"Calling vsvars32"
22+
VsVars32
23+
24+
# set environment variable to select between Dev10 and Dev11 projects in the various dirs.proj
25+
$Env:DevToolsVersion = "100"

0 commit comments

Comments
 (0)