kvm-guest-drivers-windows
/
RunSdv.bat
102 строки · 4.1 Кб
1REM -----------------------------------------------------------------------
2REM Copyright (c) 2010-2017 Red Hat, Inc.
3REM
4REM Author(s):
5REM Miki Mishael <mikim@daynix.com>
6REM
7REM Redistribution and use in source and binary forms, with or without
8REM modification, are permitted provided that the following conditions
9REM are met :
10REM 1. Redistributions of source code must retain the above copyright
11REM notice, this list of conditions and the following disclaimer.
12REM 2. Redistributions in binary form must reproduce the above copyright
13REM notice, this list of conditions and the following disclaimer in the
14REM documentation and / or other materials provided with the distribution.
15REM 3. Neither the names of the copyright holders nor the names of their contributors
16REM may be used to endorse or promote products derived from this software
17REM without specific prior written permission.
18REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
19REM ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20REM IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21REM ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
22REM FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23REM DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREM ENT OF SUBSTITUTE GOODS
24REM OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25REM HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26REM LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27REM OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28REM SUCH DAMAGE.
29REM -----------------------------------------------------------------------
30@echo off
31cls
32cls
33Echo.
34Echo ***********************************************
35Echo * Running SDV... Don't close! *
36Echo ***********************************************
37:START
38
39SETLOCAL
40REM Set NATIVE ENV for running SDV Tool.
41set vsVer=11
42set arc=x86
43call %~dp0Tools\SetVsEnv.bat %vsVer% %arc%
44if %ERRORLEVEL% NEQ 0 goto Error3
45
46SET ROOT_PATH=%1
47SET PROJECT_XML_PATH=%2
48SET PROJECT_DIR_PATH=%3
49SET PROJECT_NAME=%4
50title "DO Not Close!-Running SDV on %PROJECT_NAME% (ALL Configurations)"
51
52if "%_NT_TARGET_VERSION%"=="" set _NT_TARGET_VERSION=0x602
53if "%_BUILD_MAJOR_VERSION_%"=="" set _BUILD_MAJOR_VERSION_=101
54if "%_BUILD_MINOR_VERSION_%"=="" set _BUILD_MINOR_VERSION_=58000
55if "%_RHEL_RELEASE_VERSION_%"=="" set _RHEL_RELEASE_VERSION_=61
56
57set /a _NT_TARGET_MAJ="(%_NT_TARGET_VERSION% >> 8) * 10 + (%_NT_TARGET_VERSION% & 255)"
58set STAMPINF_VERSION=%_NT_TARGET_MAJ%.%_RHEL_RELEASE_VERSION_%.%_BUILD_MAJOR_VERSION_%.%_BUILD_MINOR_VERSION_%
59
60cscript.exe %ROOT_PATH%\Tools\RunSdv.js %ROOT_PATH% %PROJECT_XML_PATH% %PROJECT_DIR_PATH% %PROJECT_NAME% //Nologo
61if %ERRORLEVEL% EQU 0 goto End
62if %ERRORLEVEL% EQU 1 goto Error1
63if %ERRORLEVEL% EQU 2 goto Error2
64
65:Error2
66Echo.
67Echo *********************************************************************
68Echo * Fatal Error Running SDV on %PROJECT_NAME%, Try Again, Good Bye... *
69Echo *********************************************************************
70Echo.
71ENDLOCAL
72EXIT /B 1
73
74REM Error in specific Configurations and platform
75:Error1
76Echo.
77Echo *********************************************************************
78Echo * Error Running With Configurations and platform on %PROJECT_NAME% *
79Echo *********************************************************************
80Echo.
81ENDLOCAL
82EXIT /B 1
83
84:Error3
85Echo.
86Echo *********************************************************************
87Echo * Error Couldn't find VS installation *
88Echo *********************************************************************
89Echo.
90ENDLOCAL
91EXIT /B 1
92
93:End
94Echo.
95Echo **********************************************************
96Echo * Successful Running SDV on this project %PROJECT_NAME% *
97Echo **********************************************************
98Echo.
99Ping -n 3 127.0.0.1 > NUL
100:FIN
101ENDLOCAL
102EXIT /B 0
103