VirtualBox

source: vbox/trunk/src/VBox/Installer/win/Scripts/Combined-1-Prepare.cmd@ 72056

Last change on this file since 72056 was 72056, checked in by vboxsync, 7 years ago

Installer/win: Some repacking script fixes. bugref:8691

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 8.4 KB
Line 
1@echo off
2rem $Id: Combined-1-Prepare.cmd 72056 2018-04-27 11:38:50Z vboxsync $
3rem rem @file
4rem Windows NT batch script for preparing both amd64 and x86 for signing submission.
5rem
6
7rem
8rem Copyright (C) 2018 Oracle Corporation
9rem
10rem This file is part of VirtualBox Open Source Edition (OSE), as
11rem available from http://www.virtualbox.org. This file is free software;
12rem you can redistribute it and/or modify it under the terms of the GNU
13rem General Public License (GPL) as published by the Free Software
14rem Foundation, in version 2 as it comes in the "COPYING" file of the
15rem VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16rem hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17rem
18
19
20setlocal ENABLEEXTENSIONS
21setlocal
22
23rem
24rem Globals and checks for required enviornment variables.
25rem
26if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & goto end_failed)
27if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & goto end_failed)
28set _MY_SCRIPT_DIR=%~dp0
29set _MY_SAVED_CD=%CD%
30set _MY_VER_REV=@VBOX_VERSION_STRING@r@VBOX_SVN_REV@
31
32rem
33rem Parse arguments.
34rem
35set _MY_OPT_UNTAR_DIR=%_MY_SCRIPT_DIR%\..\..\..\
36for %%i in (%_MY_OPT_UNTAR_DIR%) do set _MY_OPT_UNTAR_DIR=%%~fi
37set _MY_OPT_EXTPACK=%_MY_OPT_UNTAR_DIR%\Oracle_VM_VirtualBox_Extension_Pack-%_MY_VER_REV%.vbox-extpack
38set _MY_OPT_EXTPACK_ENTERPRISE=%_MY_OPT_UNTAR_DIR%\Oracle_VM_VirtualBox_Extension_Pack-%_MY_VER_REV%-ENTERPRISE.vbox-extpack
39set _MY_OPT_BUILD_TYPE=@KBUILD_TYPE@
40set _MY_OPT_OUTDIR=%_MY_OPT_UNTAR_DIR%\output
41
42:argument_loop
43if ".%1" == "." goto no_more_arguments
44
45if ".%1" == ".-h" goto opt_h
46if ".%1" == ".-?" goto opt_h
47if ".%1" == "./h" goto opt_h
48if ".%1" == "./H" goto opt_h
49if ".%1" == "./?" goto opt_h
50if ".%1" == ".-help" goto opt_h
51if ".%1" == ".--help" goto opt_h
52
53if ".%1" == ".-e" goto opt_e
54if ".%1" == ".--extpack" goto opt_e
55if ".%1" == ".-o" goto opt_o
56if ".%1" == ".--outdir" goto opt_o
57if ".%1" == ".-s" goto opt_s
58if ".%1" == ".--extpack-enterprise" goto opt_s
59if ".%1" == ".-t" goto opt_t
60if ".%1" == ".--build-type" goto opt_t
61if ".%1" == ".-u" goto opt_u
62if ".%1" == ".--vboxall-untar-dir" goto opt_u
63echo syntax error: Unknown option: %1
64echo Try --help to list valid options.
65goto end_failed
66
67:argument_loop_next_with_value
68shift
69shift
70goto argument_loop
71
72:opt_e
73if ".%~2" == "." goto syntax_error_missing_value
74set _MY_OPT_EXTPACK=%~f2
75goto argument_loop_next_with_value
76
77:opt_h
78echo Toplevel combined package: Prepare both x86 and amd64 for submission.
79echo .
80echo Usage: Combined-1-Prepare.cmd [-o output-dir] [-e/--extpack puel.vbox-extpack]
81echo [-s/--extpack-enterprise puel-enterprise.vbox-extpack]
82echo [-u/--vboxall-dir unpacked-vboxall-dir] [-t build-type]
83echo .
84echo Default -e/--extpack value: %_MY_OPT_EXTPACK%
85echo Default -s/--extpack-enterprise value: %_MY_OPT_EXTPACK_ENTERPRISE%
86echo Default -u/--vboxall-untar-dir value: %_MY_OPT_UNTAR_DIR%
87echo Default -o/--outdir value: %_MY_OPT_OUTDIR%
88echo Default -t/--build-type value: %_MY_OPT_BUILD_TYPE%
89echo .
90goto end_failed
91
92:opt_o
93if ".%~2" == "." goto syntax_error_missing_value
94set _MY_OPT_OUTDIR=%~f2
95goto argument_loop_next_with_value
96
97:opt_s
98if ".%~2" == "." goto syntax_error_missing_value
99set _MY_OPT_EXTPACK_ENTERPRISE=%~f2
100goto argument_loop_next_with_value
101
102:opt_t
103if ".%~2" == "." goto syntax_error_missing_value
104set _MY_OPT_BUILD_TYPE=%~2
105goto argument_loop_next_with_value
106
107:opt_u
108if ".%~2" == "." goto syntax_error_missing_value
109set _MY_OPT_UNTAR_DIR=%~f2
110goto argument_loop_next_with_value
111
112
113:syntax_error_missing_value
114echo syntax error: missing or empty option value after %1
115goto end_failed
116
117
118:error_vboxall_untar_dir_not_found
119echo syntax error: The VBoxAll untar directory was not found: "%_MY_OPT_UNTAR_DIR%"
120goto end_failed
121
122:error_amd64_bindir_not_found
123echo syntax error: The AMD64 bin directory was not found: "%_MY_BINDIR_AMD64%"
124goto end_failed
125
126:error_x86_bindir_not_found
127echo syntax error: The AMD64 bin directory was not found: "%_MY_BINDIR_X86%"
128goto end_failed
129
130:error_amd64_repack_dir_not_found
131echo syntax error: The AMD64 bin directory was not found: "%_MY_REPACK_DIR_AMD64%"
132goto end_failed
133
134:error_x86_repack_dir_not_found
135echo syntax error: The AMD64 bin directory was not found: "%_MY_REPACK_DIR_X86%"
136goto end_failed
137
138:error_extpack_not_found
139echo syntax error: Specified extension pack not found: "%_MY_OPT_EXTPACK%"
140goto end_failed
141
142:error_enterprise_extpack_not_found
143echo syntax error: Specified enterprise extension pack not found: "%_MY_OPT_EXTPACK_ENTERPRISE%"
144goto end_failed
145
146
147
148:no_more_arguments
149rem
150rem Validate and adjust specified options.
151rem
152
153if not exist "%_MY_OPT_UNTAR_DIR%" goto error_vboxall_untar_dir_not_found
154
155set _MY_BINDIR_AMD64=%_MY_OPT_UNTAR_DIR%\win.amd64\%_MY_OPT_BUILD_TYPE%\bin
156set _MY_BINDIR_X86=%_MY_OPT_UNTAR_DIR%\win.x86\%_MY_OPT_BUILD_TYPE%\bin
157if not exist "%_MY_BINDIR_AMD64%" goto error_amd64_bindir_not_found
158if not exist "%_MY_BINDIR_X86%" goto error_x86_bindir_not_found
159
160set _MY_REPACK_DIR_AMD64=%_MY_OPT_UNTAR_DIR%\win.amd64\%_MY_OPT_BUILD_TYPE%\repack
161set _MY_REPACK_DIR_X86=%_MY_OPT_UNTAR_DIR%\win.x86\%_MY_OPT_BUILD_TYPE%\repack
162if not exist "%_MY_REPACK_DIR_AMD64%" goto error_amd64_repack_dir_not_found
163if not exist "%_MY_REPACK_DIR_X86%" goto error_x86_repack_dir_not_found
164
165if not exist "%_MY_OPT_EXTPACK%" goto error_extpack_not_found
166if not ".%_MY_OPT_EXTPACK_ENTERPRISE%" == "." if not exist "%_MY_OPT_EXTPACK_ENTERPRISE%" goto error_enterprise_extpack_not_found
167
168
169rem Make sure the output dir exists.
170if not exist "%_MY_OPT_OUTDIR%" (mkdir "%_MY_OPT_OUTDIR%" || goto end_failed)
171
172rem
173rem Install the extpack in the bin directories.
174rem Note! Not really necessary, but whatever.
175rem
176echo on
177copy /y "%_MY_OPT_EXTPACK%" "%_MY_BINDIR_AMD64%\Oracle_VM_VirtualBox_Extension_Pack.vbox-extpack" || goto end_failed
178copy /y "%_MY_OPT_EXTPACK%" "%_MY_BINDIR_X86%\Oracle_VM_VirtualBox_Extension_Pack.vbox-extpack" || goto end_failed
179@echo off
180
181rem
182rem Do the packing.
183rem
184@echo **************************************************************************
185@echo Packing AMD64 drivers
186@echo **************************************************************************
187cd /d "%_MY_REPACK_DIR_AMD64%" || goto end_failed
188call "%_MY_REPACK_DIR_AMD64%\PackDriversForSubmission.cmd" -b "%_MY_BINDIR_AMD64%" -a amd64 -e "%_MY_OPT_EXTPACK%" ^
189 -o "%_MY_OPT_OUTDIR%\VBoxDrivers-%_MY_VER_REV%-amd64.cab" || goto end_failed
190@echo .
191@echo **************************************************************************
192@echo Packing X86 drivers
193@echo **************************************************************************
194cd /d "%_MY_REPACK_DIR_X86%" || goto end_failed
195call "%_MY_REPACK_DIR_X86%\PackDriversForSubmission.cmd" -b "%_MY_BINDIR_X86%" -a x86 -e "%_MY_OPT_EXTPACK%" ^
196 -o "%_MY_OPT_OUTDIR%\VBoxDrivers-%_MY_VER_REV%-x86.cab" || goto end_failed
197@echo off
198echo .
199cd /d "%_MY_SAVED_CD%"
200
201rem
202rem Generate script for taking the next step.
203rem
204set _MY_NEXT_SCRIPT=%_MY_OPT_OUTDIR%\Combined-3-Repack.cmd
205echo cd /d "%cd%" > "%_MY_NEXT_SCRIPT%"
206echo call "%_MY_SCRIPT_DIR%\Combined-3-Repack.cmd" --extpack "%_MY_OPT_EXTPACK%" ^
207 --extpack-enterprise "%_MY_OPT_EXTPACK_ENTERPRISE%" ^
208 --vboxall-untar-dir "%_MY_OPT_UNTAR_DIR%" ^
209 --outdir "%_MY_OPT_OUTDIR%" ^
210 --build-type "%_MY_OPT_BUILD_TYPE%" %%* >> "%_MY_NEXT_SCRIPT%"
211
212rem
213rem Instructions on what to do next.
214rem
215echo **************************************************************************
216echo * First step is done.
217echo *
218echo * Created:
219echo * %_MY_OPT_OUTDIR%\VBoxDrivers-%_MY_VER_REV%-amd64.cab
220echo * %_MY_OPT_OUTDIR%\VBoxDrivers-%_MY_VER_REV%-x86.cab
221echo *
222echo * Next steps:
223echo * 1. Sign the two files using the Oracle EV certificate.
224echo * 2. Submit the signed files to Microsoft for attestation signing.
225echo * 3. Download the signed result.
226echo * 4. "%_MY_NEXT_SCRIPT%" --signed-x86 {zip} --signed-amd64 {zip}
227
228goto end
229
230
231:end_failed
232@cd /d "%_MY_SAVED_CD%"
233@endlocal
234@endlocal
235@echo * Failed!
236@exit /b 1
237
238:end
239@cd /d "%_MY_SAVED_CD%"
240@endlocal
241@endlocal
242
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette