Victor.Stone
dot net 备忘录
首页
新文章
新随笔
聚合
管理
posts - 21, comments - 25, trackbacks - 0
vs2010中加入环境变量
@echo Setting environment
for
using Microsoft Visual Studio
2010
x86 tools.
@
call
:GetVSCommonToolsDir
@
if
"
%VS100COMNTOOLS%
"
==
""
goto
error_no_VS100COMNTOOLSDIR
@
call
"
%VS100COMNTOOLS%VCVarsQueryRegistry.bat
"
32bit No64bit
@
if
"
%VSINSTALLDIR%
"
==
""
goto
error_no_VSINSTALLDIR
@
if
"
%FrameworkDir32%
"
==
""
goto
error_no_FrameworkDIR32
@
if
"
%FrameworkVersion32%
"
==
""
goto
error_no_FrameworkVer32
@
if
"
%Framework35Version%
"
==
""
goto
error_no_Framework35Version
@
set
FrameworkDir
=
%FrameworkDir32%
@
set
FrameworkVersion
=
%FrameworkVersion32%
@
if
not
"
%WindowsSdkDir%
"
==
""
(
@
set
"
PATH=%WindowsSdkDir%bin\NETFX 4.0 Tools;%WindowsSdkDir%bin;%PATH%
"
@
set
"
INCLUDE=%WindowsSdkDir%include;%INCLUDE%
"
@
set
"
LIB=%WindowsSdkDir%lib;%LIB%
"
)
@
rem
@
rem
Root of Visual Studio IDE installed files.
@
rem
@
set
DevEnvDir
=
%VSINSTALLDIR%Common7
\
IDE
\
@
rem
PATH
@
rem
----
@
if
exist
"
%VSINSTALLDIR%Team Tools\Performance Tools
"
(
@
set
"
PATH=%VSINSTALLDIR%Team Tools\Performance Tools;%PATH%
"
)
@
if
exist
"
%ProgramFiles%\HTML Help Workshop
"
set
PATH
=
%ProgramFiles%
\
HTML Help Workshop;%PATH%
@
if
exist
"
%ProgramFiles(x86)%\HTML Help Workshop
"
set
PATH
=
%ProgramFiles(x86)%
\
HTML Help Workshop;%PATH%
@
if
exist
"
%VCINSTALLDIR%VCPackages
"
set
PATH
=
%VCINSTALLDIR%VCPackages;%PATH%
@
set
PATH
=
%FrameworkDir%%Framework35Version%;%PATH%
@
set
PATH
=
%FrameworkDir%%FrameworkVersion%;%PATH%
@
set
PATH
=
%VSINSTALLDIR%Common7
\
Tools;%PATH%
@
if
exist
"
%VCINSTALLDIR%BIN
"
set
PATH
=
%VCINSTALLDIR%BIN;%PATH%
@
set
PATH
=
%DevEnvDir%;%PATH%
@
if
exist
"
%VSINSTALLDIR%VSTSDB\Deploy
"
(
@
set
"
PATH=%VSINSTALLDIR%VSTSDB\Deploy;%PATH%
"
)
@
if
not
"
%FSHARPINSTALLDIR%
"
==
""
(
@
set
"
PATH=%FSHARPINSTALLDIR%;%PATH%
"
)
@
rem
INCLUDE
@
rem
-------
@
if
exist
"
%VCINSTALLDIR%ATLMFC\INCLUDE
"
set
INCLUDE
=
%VCINSTALLDIR%ATLMFC
\
INCLUDE;%INCLUDE%
@
if
exist
"
%VCINSTALLDIR%INCLUDE
"
set
INCLUDE
=
%VCINSTALLDIR%INCLUDE;%INCLUDE%
@
rem
LIB
@
rem
---
@
if
exist
"
%VCINSTALLDIR%ATLMFC\LIB
"
set
LIB
=
%VCINSTALLDIR%ATLMFC
\
LIB
;%
LIB
%
@
if
exist
"
%VCINSTALLDIR%LIB
"
set
LIB
=
%VCINSTALLDIR%
LIB
;%
LIB
%
@
rem
LIBPATH
@
rem
-------
@
if
exist
"
%VCINSTALLDIR%ATLMFC\LIB
"
set
LIBPATH
=
%VCINSTALLDIR%ATLMFC
\
LIB
;%LIBPATH%
@
if
exist
"
%VCINSTALLDIR%LIB
"
set
LIBPATH
=
%VCINSTALLDIR%
LIB
;%LIBPATH%
@
set
LIBPATH
=
%FrameworkDir%%Framework35Version%;%LIBPATH%
@
set
LIBPATH
=
%FrameworkDir%%FrameworkVersion%;%LIBPATH%
@
goto
end
@
REM
-----------------------------------------------------------------------
:GetVSCommonToolsDir
@
set
VS100COMNTOOLS
=
@
call
:GetVSCommonToolsDirHelper32 HKLM
>
nul
2
>&
1
@
if
errorlevel
1
call
:GetVSCommonToolsDirHelper32 HKCU
>
nul
2
>&
1
@
if
errorlevel
1
call
:GetVSCommonToolsDirHelper64 HKLM
>
nul
2
>&
1
@
if
errorlevel
1
call
:GetVSCommonToolsDirHelper64 HKCU
>
nul
2
>&
1
@
exit
/
B
0
:GetVSCommonToolsDirHelper32
@
for
/
F
"
tokens=1,2*
"
%%i
in
(
'
reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
@
if
"
%%i
"
==
"
10.0
"
(
@
SET
"
VS100COMNTOOLS=%%k
"
)
)
@
if
"
%VS100COMNTOOLS%
"
==
""
exit
/
B
1
@
SET
"
VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\
"
@
exit
/
B
0
:GetVSCommonToolsDirHelper64
@
for
/
F
"
tokens=1,2*
"
%%i
in
(
'
reg query "%1\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "10.0"') DO (
@
if
"
%%i
"
==
"
10.0
"
(
@
SET
"
VS100COMNTOOLS=%%k
"
)
)
@
if
"
%VS100COMNTOOLS%
"
==
""
exit
/
B
1
@
SET
"
VS100COMNTOOLS=%VS100COMNTOOLS%Common7\Tools\
"
@
exit
/
B
0
posted on 2010-12-09 10:41
Victor.Stone
阅读(5855)
评论(1)
编辑
收藏
引用
FeedBack:
#
re: vs2010中加入环境变量
2010-12-16 09:23 |
Victor.Stone
@set "PATH=D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE";PATH
@set "PATH=D:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools";PATH
@set "PATH=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319";PATH
MSBuild mis.sln /t:Rebuild /p:Configuration=Debug
回复
更多评论
刷新评论列表
只有注册用户
登录
后才能发表评论。
<
2010年12月
>
日
一
二
三
四
五
六
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
常用链接
我的随笔
我的评论
我参与的随笔
留言簿
(2)
给我留言
查看公开留言
查看私人留言
随笔分类
(17)
.net framework (10)
DB(2)
Nhibernate & Spring.net(1)
Other(2)
Report
分布式应用(2)
文章分类
Document
搜索
积分与排名
积分 - 24174
排名 - 193
最新随笔
1. 关于override和多成态
2. 在数据库中保存和显示图片
3. IE9打不开.appliction的问题
4. 主生产计划MPS
5. Remoting异步回调
6. 服务端订阅客户端事件处理
7. ERP术语名词解释
8. 数据库附加
9. vs2010中加入环境变量
10. 通过委托更新WinForm的UI
阅读排行榜
1. vs2010中加入环境变量(5855)
2. C#正则表达式指南(5157)
3. ERP术语名词解释(2771)
4. C#.NET中使用注释(1824)
5. 关于 CollectionBase 与 ArrayList 的比较(1274)