-
Notifications
You must be signed in to change notification settings - Fork 1
/
FirstTimeBuildVS2008.bat
54 lines (46 loc) · 2.36 KB
/
FirstTimeBuildVS2008.bat
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@ECHO OFF
SETLOCAL
SET RootDir=%~dp0.
SETLOCAL
IF "%ProgramFiles(X86)%"=="" (
SET WOWRegistryAdjust=
) ELSE (
IF DEFINED PROCESSOR_ARCHITEW6432 (
SET WOWRegistryAdjust=
) ELSE (
SET WOWRegistryAdjust=\Wow6432Node
)
)
REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1
IF ERRORLEVEL 1 (CALL:_SetupExpHive)
REG QUERY "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp" /v ApplicationID 1>NUL 2>&1
IF ERRORLEVEL 1 (ECHO Could not find experimental registry hive for Visual Studio 2008. Aborting... && GOTO:EOF)
ENDLOCAL
IF "%TargetVisualStudioVersion%"=="v8.0" (
SET DegradeToolsVersion=/toolsversion:2.0
) ELSE (
SET TargetVisualStudioVersion=v9.0
SET DegradeToolsVersion=/toolsversion:3.5
)
CALL "%RootDir%\BuildDevTools.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion%
CALL "%RootDir%\Build.bat" %* /consoleloggerparameters:DisableMPLogging %DegradeToolsVersion%
CALL "%RootDir%\SetupEnvironment.bat" %*
ECHO.
ECHO Running 'devenv.exe /RootSuffix "%VSRegistryRootSuffix%" /Setup'... This may take a few minutes...
"%VSEnvironmentPath%" /RootSuffix "%VSRegistryRootSuffix%" /Setup
GOTO:EOF
:_SetupExpHive
CALL "%RootDir%\SetFromRegistry.bat" "VSIPDir" "HKLM\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\VSIP\9.0" "InstallDir" "f"
IF "%VSIPDir%"=="" (ECHO Please install the Microsoft Visual Studio 2008 SDK. See README.txt. && PAUSE && EXIT)
ECHO Setting up machine-level experimental registry hive for Visual Studio 2008... This may take a few minutes...
"%VSIPDir%\VisualStudioIntegration\Tools\Bin\VSRegEx.exe" GetOrig 9.0 Exp
REG QUERY "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" /v ApplicationID 1>NUL 2>&1
IF NOT ERRORLEVEL 1 (CALL:_BackupUserConfiguration)
GOTO:EOF
:_BackupUserConfiguration
ECHO Backing up user-level experimental registry hive for Visual Studio 2008... This may take a minute...
REG DELETE "HCKU\Software%WOWRegistryAdjust%\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /f 1>NUL 2>&1
REG ADD "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" 1>NUL 2>&1
REG COPY "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration_Backup" /s /f
REG DELETE "HKCU\Software\Microsoft\VisualStudio\9.0Exp\Configuration" /f 1>NUL 2>&1
GOTO:EOF