VirtualBox

source: vbox/trunk/src/VBox/Installer/win/Scripts/UnpackBlessedDrivers.cmd@ 71991

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

Installer/win: Submission packing fixes. bugref:8691

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1@echo off
2rem $Id: UnpackBlessedDrivers.cmd 71991 2018-04-24 07:11:35Z vboxsync $
3rem rem @file
4rem Windows NT batch script for unpacking drivers after being signed.
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 Parse arguments.
25rem
26set _MY_OPT_BINDIR=..\bin
27set _MY_OPT_INPUT=
28set _MY_OPT_SIGN_CAT=1
29
30:argument_loop
31if ".%1" == "." goto no_more_arguments
32
33if ".%1" == ".-h" goto opt_h
34if ".%1" == ".-?" goto opt_h
35if ".%1" == "./h" goto opt_h
36if ".%1" == "./H" goto opt_h
37if ".%1" == "./?" goto opt_h
38if ".%1" == ".-help" goto opt_h
39if ".%1" == ".--help" goto opt_h
40
41if ".%1" == ".-b" goto opt_b
42if ".%1" == ".--bindir" goto opt_b
43if ".%1" == ".-i" goto opt_i
44if ".%1" == ".--input" goto opt_i
45if ".%1" == ".-n" goto opt_n
46if ".%1" == ".--no-sign-cat" goto opt_n
47echo syntax error: Unknown option: %1
48echo Try --help to list valid options.
49goto end_failed
50
51:argument_loop_next_with_value
52shift
53shift
54goto argument_loop
55
56:opt_b
57if ".%2" == "." goto syntax_error_missing_value
58set _MY_OPT_BINDIR=%2
59goto argument_loop_next_with_value
60
61:opt_h
62echo This script unpacks the zip-file containing the blessed driver files from
63echo Microsoft, replacing original files in the bin directory. The catalog files
64echo will be signed again and the Microsoft signature merged with ours.
65echo .
66echo Usage: UnpackBlessedDrivers.cmd [-b bindir] [-n/--no-sign-cat] -i input.zip
67echo .
68echo Warning! This script should normally be invoked from the repack directory
69goto end_failed
70
71:opt_i
72if ".%2" == "." goto syntax_error_missing_value
73set _MY_OPT_INPUT=%2
74goto argument_loop_next_with_value
75
76:opt_n
77set _MY_OPT_SIGN_CAT=0
78shift
79goto argument_loop
80
81:syntax_error_missing_value
82echo syntax error: missing or empty option value after %1
83goto end_failed
84
85:error_bindir_does_not_exist
86echo syntax error: Specified BIN directory does not exist: "%_MY_OPT_BINDIR%"
87goto end_failed
88
89:error_input_not_found
90echo error: Input file does not exist: "%_MY_OPT_INPUT%"
91goto end_failed
92
93:no_more_arguments
94rem validate specified options
95if not exist "%_MY_OPT_BINDIR%" goto error_bindir_does_not_exist
96
97rem figure defaults here: if ".%_MY_OPT_INPUT%" == "." if exist "%_MY_OPT_BINDIR%\x86" set _MY_OPT_INPUT=VBoxDrivers-amd64.cab
98rem figure defaults here: if ".%_MY_OPT_INPUT%" == "." set _MY_OPT_INPUT=VBoxDrivers-x86.cab
99if not exist "%_MY_OPT_INPUT%" goto error_input_exists
100
101rem
102rem Unpack the stuff.
103rem ASSUME .cab capable expand on system. The -i option means skipping
104rem subdirectories and just put all the files in the specified bin dir.
105rem
106
107rem We're getting ZIP files back now.
108rem expand "%_MY_OPT_INPUT%" "%_MY_OPT_BINDIR%" -i -f:* || goto end_failed
109echo fixme
110goto end_failed
111
112
113rem
114rem Modify the catalog signatures.
115rem
116for %cat in (VBoxDrv.cat VBoxNetAdp6.cat VBoxNetLwf.cat VBoxUSB.cat VBoxUSBMon.cat) do (
117 copy /y "%_MY_OPT_BINDIR%\%cat%" "%_MY_OPT_BINDIR%\%cat%.ms" || goto end_failed
118 call sign-dual.cmd "%_MY_OPT_BINDIR%\%cat%" || goto end_failed
119 "%_MY_OPT_BINDIR%\tools\RTSignTool.exe" add-nested-exe-signature -v "%_MY_OPT_BINDIR%\%cat%" "%_MY_OPT_BINDIR%\%cat%.ms" || goto end_failed
120)
121
122goto end
123
124:end_failed
125@endlocal
126@endlocal
127@exit /b 1
128
129:end
130@endlocal
131@endlocal
132
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