VirtualBox

source: vbox/trunk/src/VBox/Installer/win/Scripts/Combined-3-RepackAdditions.cmd@ 84909

Last change on this file since 84909 was 83010, checked in by vboxsync, 5 years ago

Repack scripts: typo fix bugref:9587

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 16.3 KB
Line 
1@echo off
2rem $Id: Combined-3-RepackAdditions.cmd 83010 2020-02-06 17:25:49Z vboxsync $
3rem rem @file
4rem Windows NT batch script for repacking signed amd64 and x86 drivers.
5rem
6
7rem
8rem Copyright (C) 2018-2020 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_BUILD_TYPE=@KBUILD_TYPE@
38set _MY_OPT_OUTDIR=%_MY_OPT_UNTAR_DIR%\output
39set _MY_OPT_SRC_DIR=%_MY_SCRIPT_DIR%\resources\
40
41:argument_loop
42if ".%1" == "." goto no_more_arguments
43
44if ".%1" == ".-h" goto opt_h
45if ".%1" == ".-?" goto opt_h
46if ".%1" == "./h" goto opt_h
47if ".%1" == "./H" goto opt_h
48if ".%1" == "./?" goto opt_h
49if ".%1" == ".-help" goto opt_h
50if ".%1" == ".--help" goto opt_h
51
52if ".%1" == ".-o" goto opt_o
53if ".%1" == ".--outdir" goto opt_o
54if ".%1" == ".-s" goto opt_s
55if ".%1" == ".--source" goto opt_s
56if ".%1" == ".--signed-amd64" goto opt_signed_amd64
57if ".%1" == ".--signed-x86" goto opt_signed_x86
58if ".%1" == ".-t" goto opt_t
59if ".%1" == ".--build-type" goto opt_t
60if ".%1" == ".-u" goto opt_u
61if ".%1" == ".--vboxall-untar-dir" goto opt_u
62echo syntax error: Unknown option: %1
63echo Try --help to list valid options.
64goto end_failed
65
66:argument_loop_next_with_value
67shift
68shift
69goto argument_loop
70
71:opt_h
72echo Toplevel combined package: Repack the guest additions.
73echo .
74echo Usage: Combined-3-RepackAdditions.cmd [-o output-dir]
75echo [-u/--vboxall-dir unpacked-vboxall-dir] [-t build-type]
76echo [--signed-amd64 signed-amd64.zip]
77echo [--signed-x86 signed-x86.zip]
78echo
79echo .
80echo Default -u/--vboxall-untar-dir value: %_MY_OPT_UNTAR_DIR%
81echo Default -o/--outdir value: %_MY_OPT_OUTDIR%
82echo Default -t/--build-type value: %_MY_OPT_BUILD_TYPE%
83echo .
84goto end_failed
85
86:opt_o
87if ".%~2" == "." goto syntax_error_missing_value
88set _MY_OPT_OUTDIR=%~f2
89goto argument_loop_next_with_value
90
91:opt_s
92if ".%~2" == "." goto syntax_error_missing_value
93set _MY_OPT_SRC_DIR=%~f2
94goto argument_loop_next_with_value
95
96:opt_signed_amd64
97if ".%~2" == "." goto syntax_error_missing_value
98set _MY_OPT_SIGNED_AMD64=%~f2
99goto argument_loop_next_with_value
100
101:opt_signed_x86
102if ".%~2" == "." goto syntax_error_missing_value
103set _MY_OPT_SIGNED_X86=%~f2
104goto argument_loop_next_with_value
105
106:opt_t
107if ".%~2" == "." goto syntax_error_missing_value
108set _MY_OPT_BUILD_TYPE=%~2
109goto argument_loop_next_with_value
110
111:opt_u
112if ".%~2" == "." goto syntax_error_missing_value
113set _MY_OPT_UNTAR_DIR=%~f2
114goto argument_loop_next_with_value
115
116:syntax_error_missing_value
117echo syntax error: missing or empty option value after %1
118goto end_failed
119
120:error_vboxall_untar_dir_not_found
121echo syntax error: The VBoxAll untar directory was not found: "%_MY_OPT_UNTAR_DIR%"
122goto end_failed
123
124:error_amd64_bindir_not_found
125echo syntax error: The AMD64 bin directory was not found: "%_MY_BINDIR_AMD64%"
126goto end_failed
127
128:error_x86_bindir_not_found
129echo syntax error: The X86 bin directory was not found: "%_MY_BINDIR_X86%"
130goto end_failed
131
132:error_amd64_repack_dir_not_found
133echo syntax error: The AMD64 repack directory was not found: "%_MY_REPACK_DIR_AMD64%"
134goto end_failed
135
136:error_x86_repack_dir_not_found
137echo syntax error: The X86 repack directory was not found: "%_MY_REPACK_DIR_X86%"
138goto end_failed
139
140:error_extpack_not_found
141echo syntax error: Specified extension pack not found: "%_MY_OPT_EXTPACK%"
142goto end_failed
143
144:error_enterprise_extpack_not_found
145echo syntax error: Specified enterprise extension pack not found: "%_MY_OPT_EXTPACK_ENTERPRISE%"
146goto end_failed
147
148:error_signed_amd64_not_found
149echo syntax error: Zip with signed AMD64 drivers not found: "%_MY_OPT_SIGNED_AMD64%"
150goto end_failed
151
152:error_signed_x86_not_found
153echo syntax error: Zip with signed X86 drivers not found: "%_MY_OPT_SIGNED_X86%"
154goto end_failed
155
156:error_src_dir_not_found
157echo syntax error: src directory not found: "%_MY_OPT_SRC_DIR%"
158goto end_failed
159
160
161:no_more_arguments
162rem
163rem Validate and adjust specified options.
164rem
165
166if not exist "%_MY_OPT_UNTAR_DIR%" goto error_vboxall_untar_dir_not_found
167
168set _MY_BINDIR_AMD64=%_MY_OPT_UNTAR_DIR%\win.amd64\%_MY_OPT_BUILD_TYPE%\bin\additions
169set _MY_BINDIR_X86=%_MY_OPT_UNTAR_DIR%\win.x86\%_MY_OPT_BUILD_TYPE%\bin\additions
170if not exist "%_MY_BINDIR_AMD64%" goto error_amd64_bindir_not_found
171if not exist "%_MY_BINDIR_X86%" goto error_x86_bindir_not_found
172
173set _MY_REPACK_DIR_AMD64=%_MY_OPT_UNTAR_DIR%\win.amd64\%_MY_OPT_BUILD_TYPE%\repackadd
174set _MY_REPACK_DIR_X86=%_MY_OPT_UNTAR_DIR%\win.x86\%_MY_OPT_BUILD_TYPE%\repackadd
175if not exist "%_MY_REPACK_DIR_AMD64%" goto error_amd64_repack_dir_not_found
176if not exist "%_MY_REPACK_DIR_X86%" goto error_x86_repack_dir_not_found
177
178if not ".%_MY_OPT_SIGNED_AMD64%" == "." goto skip_set_default_amd64_signed
179set _MY_OPT_SIGNED_AMD64="%_MY_OPT_OUTDIR%/VBoxDrivers-@VBOX_VERSION_STRING@r@[email protected]"
180:skip_set_default_amd64_signed
181
182if not ".%_MY_OPT_SIGNED_X86%" == "." goto skip_set_default_x86_signed
183set _MY_OPT_SIGNED_X86="%_MY_OPT_OUTDIR%/VBoxDrivers-@VBOX_VERSION_STRING@r@[email protected]"
184:skip_set_default_x86_signed
185
186if not exist "%_MY_OPT_SIGNED_AMD64%" goto error_signed_amd64_not_found
187if not exist "%_MY_OPT_SIGNED_X86%" goto error_signed_x86_not_found
188
189rem Make sure the output dir exists.
190if not exist "%_MY_OPT_OUTDIR%" (mkdir "%_MY_OPT_OUTDIR%" || goto end_failed)
191
192if not exist "%_MY_OPT_SRC_DIR%" goto error_src_dir_not_found
193
194rem
195rem Unpacking the two driver zips.
196rem
197echo **************************************************************************
198echo * AMD64: Unpacking signed drivers...
199echo **************************************************************************
200cd /d "%_MY_REPACK_DIR_AMD64%" || goto end_failed
201call "%_MY_REPACK_DIR_AMD64%\UnpackBlessedDrivers.cmd" -b "%_MY_BINDIR_AMD64%" -i "%_MY_OPT_SIGNED_AMD64%" -n -v || goto end_failed
202echo .
203
204echo **************************************************************************
205echo * X86: Unpacking signed drivers...
206echo **************************************************************************
207cd /d "%_MY_REPACK_DIR_X86%" || goto end_failed
208call "%_MY_REPACK_DIR_X86%\UnpackBlessedDrivers.cmd" -b "%_MY_BINDIR_X86%" -i "%_MY_OPT_SIGNED_X86%" -n -v || goto end_failed
209echo .
210
211
212rem
213rem Building amd64 installer
214rem
215echo **************************************************************************
216echo * Building amd64 installer
217echo **************************************************************************
218
219del %_MY_OPT_UNTAR_DIR%\win.amd64\release\bin\additions\VBoxWindowsAdditions-amd64.exe
220cp %_MY_REPACK_DIR_AMD64%\..\obj\uninst.exe %_MY_REPACK_DIR_AMD64%
221
222rem TBD: that has to be converted to invoke auto-generated .cmd
223
224%KBUILD_BIN_PATH%\kmk_redirect.exe -C %_MY_OPT_SRC_DIR% ^
225 -E "PATH_OUT=%_MY_REPACK_DIR_AMD64%\.." ^
226 -E "PATH_TARGET=%_MY_REPACK_DIR_AMD64%" ^
227 -E "PATH_TARGET_X86=%_MY_REPACK_DIR_X86%\resources" ^
228 -E "VBOX_PATH_ADDITIONS_WIN_X86=%_MY_REPACK_DIR_AMD64%\..\bin\additions" ^
229 -E "VBOX_PATH_DIFX=%KBUILD_DEVTOOLS%\win.amd64\DIFx\v2.1-r3" ^
230 -E "VBOX_VENDOR=Oracle Corporation" -E "VBOX_VENDOR_SHORT=Oracle" -E "VBOX_PRODUCT=Oracle VM VirtualBox" ^
231 -E "VBOX_C_YEAR=@VBOX_C_YEAR@" -E "VBOX_VERSION_STRING=@VBOX_VERSION_STRING@" -E "VBOX_VERSION_STRING_RAW=@VBOX_VERSION_STRING_RAW@" ^
232 -E "VBOX_VERSION_MAJOR=@VBOX_VERSION_MAJOR@" -E "VBOX_VERSION_MINOR=@VBOX_VERSION_MINOR@" -E "VBOX_VERSION_BUILD=0" -E "VBOX_SVN_REV=@VBOX_SVN_REV@" ^
233 -E "VBOX_WINDOWS_ADDITIONS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-vista.ico" ^
234 -E "VBOX_NSIS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-nsis.ico" ^
235 -E "VBOX_WITH_GUEST_INSTALL_HELPER=1" -E "VBOX_WITH_GUEST_INSTALLER_UNICODE=1" -E "VBOX_WITH_LICENSE_INSTALL_RTF=1" ^
236 -E "VBOX_WITH_WDDM=1" -E "VBOX_WITH_MESA3D=1" -E "VBOX_BRAND_WIN_ADD_INST_DLGBMP=%_MY_OPT_SRC_DIR%\welcome.bmp" ^
237 -E "VBOX_BRAND_LICENSE_RTF=%_MY_OPT_SRC_DIR%\License-gpl-2.0.rtf" -E "BUILD_TYPE=release" -E "BUILD_TARGET_ARCH=amd64" ^
238 -- %KBUILD_DEVTOOLS%/win.x86/nsis/v3.04-log/makensis.exe /NOCD /V2 ^
239 "/DVBOX_SIGN_ADDITIONS=1" ^
240 "/DEXTERNAL_UNINSTALLER=1" ^
241 "%_MY_OPT_SRC_DIR%\VBoxGuestAdditions.nsi"
242
243rem
244rem Building amd64 installer
245rem
246echo **************************************************************************
247echo * Building x86 installer
248echo **************************************************************************
249
250del %_MY_OPT_UNTAR_DIR%\win.x86\release\bin\additions\VBoxWindowsAdditions-x86.exe
251cp %_MY_REPACK_DIR_X86%\..\obj\uninst.exe %_MY_REPACK_DIR_X86%\
252
253rem TBD: that has to be converted to invoke auto-generated .cmd
254
255%KBUILD_BIN_PATH%\kmk_redirect.exe -C %_MY_OPT_SRC_DIR% ^
256 -E "PATH_OUT=%_MY_REPACK_DIR_X86%\.." ^
257 -E "PATH_TARGET=%_MY_REPACK_DIR_X86%" ^
258 -E "PATH_TARGET_X86=%_MY_REPACK_DIR_X86%\resources" ^
259 -E "VBOX_PATH_ADDITIONS_WIN_X86=%_MY_REPACK_DIR_X86%\..\bin\additions" ^
260 -E "VBOX_PATH_DIFX=%KBUILD_DEVTOOLS%\win.x86\DIFx\v2.1-r3" ^
261 -E "VBOX_VENDOR=Oracle Corporation" -E "VBOX_VENDOR_SHORT=Oracle" -E "VBOX_PRODUCT=Oracle VM VirtualBox" ^
262 -E "VBOX_C_YEAR=@VBOX_C_YEAR@" -E "VBOX_VERSION_STRING=@VBOX_VERSION_STRING@" -E "VBOX_VERSION_STRING_RAW=@VBOX_VERSION_STRING_RAW@" ^
263 -E "VBOX_VERSION_MAJOR=@VBOX_VERSION_MAJOR@" -E "VBOX_VERSION_MINOR=@VBOX_VERSION_MINOR@" -E "VBOX_VERSION_BUILD=0" -E "VBOX_SVN_REV=@VBOX_SVN_REV@" ^
264 -E "VBOX_WINDOWS_ADDITIONS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-vista.ico" ^
265 -E "VBOX_NSIS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-nsis.ico" ^
266 -E "VBOX_WITH_GUEST_INSTALL_HELPER=1" -E "VBOX_WITH_GUEST_INSTALLER_UNICODE=1" -E "VBOX_WITH_LICENSE_INSTALL_RTF=1" ^
267 -E "VBOX_WITH_WDDM=1" -E "VBOX_WITH_MESA3D=1" -E "VBOX_BRAND_WIN_ADD_INST_DLGBMP=%_MY_OPT_SRC_DIR%\welcome.bmp" ^
268 -E "VBOX_BRAND_LICENSE_RTF=%_MY_OPT_SRC_DIR%\License-gpl-2.0.rtf" -E "BUILD_TYPE=release" -E "BUILD_TARGET_ARCH=x86" ^
269 -- %KBUILD_DEVTOOLS%/win.x86/nsis/v3.04-log/makensis.exe /NOCD /V2 ^
270 "/DVBOX_SIGN_ADDITIONS=1" ^
271 "/DEXTERNAL_UNINSTALLER=1" ^
272 "%_MY_OPT_SRC_DIR%\VBoxGuestAdditions.nsi"
273
274rem
275rem Making .iso
276rem
277echo **************************************************************************
278echo * Making VBoxGuestAdditions.iso
279echo **************************************************************************
280
281del %_MY_OPT_OUTDIR%/VBoxGuestAdditions.iso
282
283rem TBD: that has to be converted to invoke auto-generated .cmd
284
285%_MY_SCRIPT_DIR%/../bin/bldRTIsoMaker.exe ^
286 --output %_MY_OPT_OUTDIR%/VBoxGuestAdditions.iso ^
287 --iso-level 3 ^
288 --rock-ridge ^
289 --joliet ^
290 --rational-attribs ^
291 --random-order-verification 2048 ^
292 /cert/vbox-sha1.cer=%_MY_SCRIPT_DIR%../bin/additions/vbox-sha1.cer ^
293 /cert/vbox-sha256.cer=%_MY_SCRIPT_DIR%../bin/additions/vbox-sha256.cer ^
294 /VBoxWindowsAdditions-x86.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxWindowsAdditions-x86.exe ^
295 /VBoxWindowsAdditions.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxWindowsAdditions.exe ^
296 /AUTORUN.INF=%_MY_OPT_SRC_DIR%/AUTORUN.INF ^
297 /cert/VBoxCertUtil.exe=%_MY_SCRIPT_DIR%../bin/additions/VBoxCertUtil.exe ^
298 /NT3x/Readme.txt=%_MY_OPT_SRC_DIR%/NT3xReadme.txt ^
299 /NT3x/VBoxGuest.sys=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxGuest.sys ^
300 /NT3x/VBoxGuest.cat=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxGuest.cat ^
301 /NT3x/VBoxGuest.inf=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxGuest.inf ^
302 /NT3x/VBoxMouseNT.sys=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouseNT.sys ^
303 /NT3x/VBoxMouse.inf=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouse.inf ^
304 /NT3x/VBoxMouse.cat=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouse.cat ^
305 /NT3x/VBoxMouse.sys=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouse.sys ^
306 /NT3x/VBoxControl.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxControl.exe ^
307 /NT3x/VBoxService.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxService.exe ^
308 /VBoxWindowsAdditions-amd64.exe=%_MY_OPT_UNTAR_DIR%/win.amd64/release/bin/additions/VBoxWindowsAdditions-amd64.exe ^
309 /VBoxSolarisAdditions.pkg=%_MY_OPT_UNTAR_DIR%/solaris.x86/release/bin/additions/VBoxSolarisAdditions.pkg ^
310 /OS2/VBoxGuest.sys=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxGuest.sys ^
311 /OS2/VBoxSF.ifs=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxSF.ifs ^
312 /OS2/VBoxService.exe=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxService.exe ^
313 /OS2/VBoxControl.exe=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxControl.exe ^
314 /OS2/VBoxReplaceDll.exe=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxReplaceDll.exe ^
315 /OS2/libc06.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc06.dll ^
316 /OS2/libc061.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc061.dll ^
317 /OS2/libc062.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc062.dll ^
318 /OS2/libc063.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc063.dll ^
319 /OS2/libc064.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc064.dll ^
320 /OS2/libc065.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc065.dll ^
321 /OS2/libc066.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc066.dll ^
322 /OS2/readme.txt=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/readme.txt ^
323 /OS2/gengradd.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/gengradd.dll ^
324 /OS2/vboxmouse.sys=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/vboxmouse.sys ^
325 /VBoxLinuxAdditions.run=%_MY_OPT_UNTAR_DIR%/linux.x86/release/bin/additions/VBoxLinuxAdditions.run ^
326 /runasroot.sh=%_MY_OPT_UNTAR_DIR%/linux.x86/release/bin/additions/runasroot.sh ^
327 /autorun.sh=%_MY_OPT_UNTAR_DIR%/linux.x86/release/bin/additions/autorun.sh ^
328 /VBoxDarwinAdditions.pkg=%_MY_OPT_UNTAR_DIR%/darwin.amd64/release/dist/additions/VBoxGuestAdditions.pkg ^
329 /VBoxDarwinAdditionsUninstall.tool=%_MY_OPT_UNTAR_DIR%/darwin.amd64/release/dist/additions/VBoxDarwinAdditionsUninstall.tool ^
330 --chmod a+x:/VBoxLinuxAdditions.run --chmod a+x:/runasroot.sh --chmod a+x:/autorun.sh --chmod a+x:/VBoxDarwinAdditionsUninstall.tool ^
331 --volume-id="VBOXADDITIONS_@VBOX_VERSION_STRING@_@VBOX_SVN_REV@" ^
332 --name-setup=joliet ^
333 --volume-id="VBox_GAs_@VBOX_VERSION_STRING@"
334
335if not exist %_MY_OPT_OUTDIR%/VBoxGuestAdditions.iso goto end_failed
336call set _MY_OUT_FILES=%%VBoxGuestAdditions.iso
337
338rem
339rem That's that.
340rem
341echo **************************************************************************
342echo * The third and final step is done.
343echo *
344echo * Successfully created:
345for %%i in (%_MY_OUT_FILES%) do echo * "%_MY_OPT_OUTDIR%\%%i"
346goto end
347
348
349:end_failed
350@cd /d "%_MY_SAVED_CD%"
351@endlocal
352@endlocal
353@echo * Failed!
354@exit /b 1
355
356:end
357@cd /d "%_MY_SAVED_CD%"
358@endlocal
359@endlocal
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