VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk@ 106247

Last change on this file since 106247 was 106247, checked in by vboxsync, 7 weeks ago

Additions/NT/Installer,Config.kmk: Use the same signing commands for the additions installer and uninstaller image as for signing all other executables. VBOX_SIGN_FILE_FN would work differently from VBOX_SIGN_IMAGE_FN when corp signing plans b & c. This caused trouble when the installer loader stub compared its signature with that of the actual installers or the build certificate. bugref:10771

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.9 KB
Line 
1# $Id: Makefile.kmk 106247 2024-10-08 21:50:21Z vboxsync $
2## @file
3# Sub-Makefile for the Windows Guest Additions Installer.
4#
5
6#
7# Copyright (C) 2006-2024 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31#
32# Include Sub-Makefiles.
33#
34include $(PATH_SUB_CURRENT)/Loader/Makefile.kmk
35include $(PATH_SUB_CURRENT)/InstallHelper/Makefile.kmk
36
37
38#
39# Globals
40#
41VBOX_PATH_WIN_ADD_INS_SRC := $(PATH_SUB_CURRENT)
42VBOX_WITH_GUEST_INSTALL_HELPER := 1 # Use our guest install helper DLL.
43## @todo VBOX_WIN_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/win
44
45ifdef VBOX_WIN_ATTESTATION_SIGNING
46 VBOX_DRIVERS_PACK_NAME := VBoxDrivers-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)r$(VBOX_SVN_REV)-$(KBUILD_TARGET_ARCH).cab
47 VBOX_SIGNED_DRIVERS_ZIP_NAME := $(VBOX_DRIVERS_PACK_NAME).Signed.zip
48 include $(KBUILD_PATH)/tools/ZIP.kmk
49 TOOL_ZIP_PACK ?= zip
50endif
51
52
53#
54# VBoxDrvInst - Helps with driver installation.
55#
56PROGRAMS += VBoxDrvInst
57VBoxDrvInst_TEMPLATE = VBoxGuestR3Exe
58VBoxDrvInst_DEFS = _WIN32_WINNT=0x0400 _UNICODE UNICODE
59VBoxDrvInst_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
60ifdef VBOX_WITH_WDDM
61 VBoxDrvInst_DEFS += VBOX_WITH_WDDM
62endif
63VBoxDrvInst_DEPS = $(VBOX_SVN_REV_KMK)
64VBoxDrvInst_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST) VBoxWinNewDevLib
65VBoxDrvInst_INCS = ../include
66VBoxDrvInst_LIBS = \
67 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/setupapi.lib
68VBoxDrvInst_SOURCES = \
69 VBoxDrvInst.cpp \
70 VBoxDrvInst.rc
71VBoxDrvInst_VBOX_IMPORT_CHECKER.win.x86 := nt4 # setupapi was introduced in NT4
72
73
74#
75# RegCleanup - A NT4 post-install registry cleanup helper preventing the
76# display config dialog from popping up on subsequent reboots.
77#
78PROGRAMS += RegCleanup
79RegCleanup_TEMPLATE := VBoxGuestR3Exe
80RegCleanup_BLD_TRG_ARCH := x86
81RegCleanup_DEFS := _WIN32_WINNT=0x0400
82RegCleanup_SOURCES := \
83 RegCleanup.cpp \
84 RegCleanup.rc
85RegCleanup_VBOX_IMPORT_CHECKER.win.x86 := nt4
86
87
88#
89# Install all the certificates we use.
90#
91INSTALLS += AdditionsInstCertFiles
92AdditionsInstCertFiles_TEMPLATE := VBoxGuestR3Exe
93AdditionsInstCertFiles_SOURCES =
94AdditionsInstCertFiles_CLEAN =
95if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
96 define def_VBoxAdditionsInstCertFiles
97 AdditionsInstCertFiles_SOURCES += $$(AdditionsInstCertFiles_0_OUTDIR)/$(1)=>$1
98 AdditionsInstCertFiles_CLEAN += $$(AdditionsInstCertFiles_0_OUTDIR)/$(1)
99 $$$$(AdditionsInstCertFiles_0_OUTDIR)/$(1): $$(2) | $$$$(dir $$$$@) $(VBOX_RTSIGNTOOL)
100 $(QUIET)$(RM) -f -- "$$@"
101 $(VBOX_RTSIGNTOOL) $3 --signature-index $4 --input "$$<" --output "$$@"
102 endef
103
104 if !defined(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME) && !$(intersects win all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
105 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
106 extract-exe-signer-cert, 0)
107 VBOX_GA_CERT_ROOT_SHA1 := vbox-root.cer
108 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
109 extract-signer-root --self-signed-roots-from-system, 0)
110 ifdef VBOX_TSA_URL_ARGS
111 VBOX_GA_CERT_ROOT_SHA1_TS := vbox-timestamp-root.cer
112 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
113 extract-timestamp-root --self-signed-roots-from-system, 0)
114 endif
115 else
116 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha1.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
117 extract-exe-signer-cert, 0)
118 VBOX_GA_CERT_ROOT_SHA1 := vbox-sha1-root.cer
119 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
120 extract-signer-root --self-signed-roots-from-system, 0)
121 ifdef VBOX_TSA_URL_ARGS
122 VBOX_GA_CERT_ROOT_SHA1_TS := vbox-sha1-timestamp-root.cer
123 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
124 extract-timestamp-root --self-signed-roots-from-system, 0)
125 endif
126
127 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha256.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
128 extract-exe-signer-cert, 1)
129 VBOX_GA_CERT_ROOT_SHA2 := vbox-sha256-root.cer
130 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
131 extract-signer-root --self-signed-roots-from-system, 1)
132 ifdef VBOX_TSA_SHA2_URL_ARGS
133 VBOX_GA_CERT_ROOT_SHA2_TS := vbox-sha256-timestamp-root.cer
134 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
135 extract-timestamp-root --self-signed-roots-from-system, 1)
136 endif
137
138 if !$(intersects win, $(VBOX_WITH_CORP_CODE_SIGNING)) && $(intersects win_planb,$(VBOX_WITH_CORP_CODE_SIGNING))
139 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha256-r3.cer,$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
140 extract-exe-signer-cert, 1)
141 VBOX_GA_CERT_ROOT_SHA2_R3 := vbox-sha256-r3-root.cer
142 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_R3),$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
143 extract-signer-root --self-signed-roots-from-system, 1)
144 VBOX_GA_CERT_ROOT_SHA2_R3_TS := vbox-sha256-r3-timestamp-root.cer
145 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_R3_TS),$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
146 extract-timestamp-root --self-signed-roots-from-system, 1)
147 endif
148 endif
149endif
150
151#
152# The installer.
153#
154PACKING += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
155OTHER_CLEAN += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
156
157VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES := \
158 $(PATH_STAGE_BIN)/additions/VBoxGuest.inf \
159 $(PATH_STAGE_BIN)/additions/VBoxGuest.sys \
160 $(PATH_STAGE_BIN)/additions/VBoxTray.exe \
161 $(PATH_STAGE_BIN)/additions/VBoxControl.exe \
162 \
163 $(PATH_STAGE_BIN)/additions/VBoxMouse.inf \
164 $(PATH_STAGE_BIN)/additions/VBoxMouse.sys \
165 \
166 $(PATH_STAGE_BIN)/additions/VBoxVideo.inf \
167 $(PATH_STAGE_BIN)/additions/VBoxVideo.sys \
168 $(PATH_STAGE_BIN)/additions/VBoxDisp.dll \
169 \
170 $(PATH_STAGE_BIN)/additions/VBoxSF.sys \
171 $(PATH_STAGE_BIN)/additions/VBoxMRXNP.dll
172
173ifeq ($(KBUILD_TARGET_ARCH),amd64) # 32-bit network provider DLLs for 32-bit apps running on a 64-bit system
174 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
175 $(PATH_STAGE_BIN)/additions/VBoxMRXNP-x86.dll
176endif
177
178ifeq ($(KBUILD_TARGET_ARCH),x86)
179 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
180 $(PATH_STAGE_BIN)/additions/VBoxGuestEarlyNT.inf \
181 $(PATH_STAGE_BIN)/additions/VBoxVideoEarlyNT.inf
182endif
183
184if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
185 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
186 $(PATH_STAGE_BIN)/additions/VBoxVideo.cat \
187 $(PATH_STAGE_BIN)/additions/VBoxVideo-PreW10.cat \
188 $(PATH_STAGE_BIN)/additions/VBoxGuest.cat \
189 $(PATH_STAGE_BIN)/additions/VBoxGuest-PreW10.cat \
190 $(PATH_STAGE_BIN)/additions/VBoxMouse.cat \
191 $(PATH_STAGE_BIN)/additions/VBoxMouse-PreW10.cat
192 ifeq ($(KBUILD_TARGET_ARCH),x86)
193 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
194 $(PATH_STAGE_BIN)/additions/VBoxGuestEarlyNT.cat \
195 $(PATH_STAGE_BIN)/additions/VBoxVideoEarlyNT.cat
196 endif
197endif
198
199VBOX_WINDOWS_ADDITIONS_OTHER_FILES := \
200 $(PATH_STAGE_BIN)/additions/VBoxService.exe \
201 $(PATH_STAGE_BIN)/additions/VBoxHook.dll \
202 $(PATH_STAGE_BIN)/additions/RegCleanup.exe
203
204ifeq ($(KBUILD_TARGET_ARCH),x86)
205 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
206 $(PATH_STAGE_BIN)/additions/VBoxMouseNT.sys \
207 $(PATH_STAGE_BIN)/additions/VBoxSFW2K.sys
208endif
209
210ifdef VBOX_WITH_WDDM
211 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
212 $(PATH_STAGE_BIN)/additions/VBoxWddm.inf \
213 $(PATH_STAGE_BIN)/additions/VBoxWddm.sys \
214 $(PATH_STAGE_BIN)/additions/VBoxDispD3D.dll
215 ifeq ($(KBUILD_TARGET_ARCH),amd64)
216 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
217 $(PATH_STAGE_BIN)/additions/VBoxDispD3D-x86.dll
218 endif
219
220 ifdef VBOX_WITH_WDDM_DX
221 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
222 $(PATH_STAGE_BIN)/additions/VBoxDX.dll
223 ifeq ($(KBUILD_TARGET_ARCH),amd64)
224 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
225 $(PATH_STAGE_BIN)/additions/VBoxDX-x86.dll
226 endif
227 endif
228
229 ifdef VBOX_WITH_MESA3D
230 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
231 $(PATH_STAGE_BIN)/additions/VBoxNine.dll \
232 $(PATH_STAGE_BIN)/additions/VBoxSVGA.dll \
233 $(PATH_STAGE_BIN)/additions/VBoxGL.dll
234 ifeq ($(KBUILD_TARGET_ARCH),amd64)
235 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
236 $(PATH_STAGE_BIN)/additions/VBoxNine-x86.dll \
237 $(PATH_STAGE_BIN)/additions/VBoxSVGA-x86.dll \
238 $(PATH_STAGE_BIN)/additions/VBoxGL-x86.dll
239 endif
240 endif
241
242 if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
243 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
244 $(PATH_STAGE_BIN)/additions/VBoxWddm.cat \
245 $(PATH_STAGE_BIN)/additions/VBoxWddm-PreW10.cat
246 endif
247endif # VBOX_WITH_WDDM
248
249ifdef env.VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
250 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
251 $(PATH_STAGE_BIN)/additions/VBoxAudioTest.exe
252endif
253
254VBOX_WINDOWS_ADDITIONS_OTHER_FILES += $(addprefix $(PATH_STAGE_BIN)/additions/, \
255 $(VBOX_GA_CERT_ROOT_SHA1) \
256 $(VBOX_GA_CERT_ROOT_SHA1_TS) \
257 $(VBOX_GA_CERT_ROOT_SHA2) \
258 $(VBOX_GA_CERT_ROOT_SHA2_TS) \
259 $(VBOX_GA_CERT_ROOT_SHA2_R3) \
260 $(VBOX_GA_CERT_ROOT_SHA2_R3_TS))
261
262VB_WIN_ADD_NSIS_ENV := \
263 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
264 -E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \
265 -E 'VBOX_PATH_DIFX=$(subst /,\,$(VBOX_PATH_DIFX))' \
266 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
267 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
268 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
269 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
270 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
271 -E 'VBOX_VERSION_STRING_RAW=$(VBOX_VERSION_STRING_RAW)' \
272 -E 'VBOX_VERSION_MAJOR=$(VBOX_VERSION_MAJOR)' \
273 -E 'VBOX_VERSION_MINOR=$(VBOX_VERSION_MINOR)' \
274 -E 'VBOX_VERSION_BUILD=$(VBOX_VERSION_BUILD)' \
275 -E 'VBOX_SVN_REV=$(VBOX_SVN_REV)' \
276 -E 'VBOX_WINDOWS_ADDITIONS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ADDITIONS_ICON_FILE))' \
277 -E 'VBOX_NSIS_ICON_FILE=$(subst /,\,$(VBOX_NSIS_ICON_FILE))' \
278 -E 'VBOX_WITH_GUEST_INSTALL_HELPER=$(if $(VBOX_WITH_GUEST_INSTALL_HELPER),1,0)' \
279 -E 'VBOX_WITH_GUEST_INSTALLER_UNICODE=$(if $(VBOX_WITH_GUEST_INSTALLER_UNICODE),1,0)' \
280 -E 'VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST=$(if $(VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST),1,0)' \
281 -E 'VBOX_WITH_LICENSE_INSTALL_RTF=$(if $(VBOX_BRAND_LICENSE_RTF),1,0)' \
282 -E 'VBOX_WITH_WDDM=$(if $(VBOX_WITH_WDDM),1,0)' \
283 -E 'VBOX_WITH_WDDM_DX=$(if $(VBOX_WITH_WDDM_DX),1,0)' \
284 -E 'VBOX_WITH_MESA3D=$(if $(VBOX_WITH_MESA3D),1,0)' \
285 -E 'VBOX_BRAND_WIN_ADD_INST_DLGBMP=$(subst /,\,$(VBOX_BRAND_WIN_ADD_INST_DLGBMP))' \
286 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
287 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),-E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(VBOX_BRAND_$(lang)_LICENSE_RTF)') \
288 -E 'KBUILD_TYPE=$(KBUILD_TYPE)' \
289 -E 'KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
290 $(foreach base, VBOX_GA_CERT_ROOT_SHA1 VBOX_GA_CERT_ROOT_SHA2 VBOX_GA_CERT_ROOT_SHA2_R3 \
291 ,-E '$(base)=$(firstword $($(base)) none)' -E '$(base)_TS=$(firstword $($(base)_TS) none)')
292
293$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
294 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
295 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
296 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
297 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
298 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
299 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
300 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
301 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
302 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
303 $(PATH_SUB_CURRENT)/dumplog.nsh \
304 $(PATH_SUB_CURRENT)/ReplaceDLL.nsh \
305 $(PATH_SUB_CURRENT)/servicepack.nsh \
306 $(PATH_SUB_CURRENT)/strstr.nsh \
307 $(PATH_SUB_CURRENT)/winver.nsh \
308 $(PATH_SUB_CURRENT)/Languages/English.nsh \
309 $(PATH_SUB_CURRENT)/Languages/German.nsh \
310 $(PATH_SUB_CURRENT)/Languages/French.nsh \
311 $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) \
312 $(VBOX_WINDOWS_ADDITIONS_OTHER_FILES) \
313 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
314 $(VBOX_NSIS_ICON_FILE) \
315 $(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
316 $(if $(VBOX_WIN_ATTESTATION_SIGNING),$(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME)) \
317 $(VBOX_VERSION_STAMP) \
318 $$(VBoxDrvInst_1_STAGE_TARGET) \
319 | $(VBOX_SIGN_IMAGE_ORDERDEPS)
320 $(call MSG_L1,Creating $@, from $<)
321ifdef VBOX_WIN_ATTESTATION_SIGNING # Unpack the attestation signed drivers - this is an ugly as 'ing heck hack!
322 $(TOOL_ZIP_UNPACK) -oj $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME) -d $(PATH_STAGE_BIN)/additions/
323endif
324 $(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
325 $(VB_WIN_ADD_NSIS_ENV) \
326 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
327 $(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
328 $(if-expr defined(VBOX_SIGN_ADDITIONS) && defined(VBOX_SIGNING_MODE), \
329 '/DVBOX_SIGN_ADDITIONS=1' \
330 $(if-expr defined(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
331 ,) \
332 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
333 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
334 '$(subst /,\,$<)'
335 $(call VBOX_SIGN_IMAGE_FN,$@)
336
337
338ifdef VBOX_SIGNING_MODE
339 #
340 # This is a hack to sign the uninstaller.
341 # See http://nsis.sourceforge.net/Signing_an_Uninstaller for more details.
342 #
343 OTHER_CLEAN += \
344 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe \
345 $(PATH_TARGET)/uninst.exe
346 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe: \
347 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
348 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
349 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
350 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
351 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
352 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
353 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
354 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
355 $(PATH_SUB_CURRENT)/dumplog.nsh \
356 $(PATH_SUB_CURRENT)/ReplaceDLL.nsh \
357 $(PATH_SUB_CURRENT)/servicepack.nsh \
358 $(PATH_SUB_CURRENT)/strstr.nsh \
359 $(PATH_SUB_CURRENT)/winver.nsh \
360 $(PATH_SUB_CURRENT)/Languages/English.nsh \
361 $(PATH_SUB_CURRENT)/Languages/German.nsh \
362 $(PATH_SUB_CURRENT)/Languages/French.nsh \
363 $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) \
364 $(VBOX_WINDOWS_ADDITIONS_OTHER_FILES) \
365 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
366 $(VBOX_NSIS_ICON_FILE) \
367 $(VBOX_VERSION_STAMP) \
368 $$(VBoxDrvInst_1_STAGE_TARGET) \
369 | $$(dir $$@)
370 $(call MSG_L1,Creating $@, from $<)
371 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
372 $(VB_WIN_ADD_NSIS_ENV) \
373 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
374 $(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
375 $(if $(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
376 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
377 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
378 '/DUNINSTALLER_ONLY=1' \
379 '$(subst /,\,$<)'
380
381 $(PATH_TARGET)/uninst.exe: \
382 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe | $$(dir $$@) $(VBOX_SIGN_IMAGE_ORDERDEPS)
383 $(call MSG_L1,Creating $@, from $<)
384 $(QUIET)$(RM) -f $@
385 -$(REDIRECT) -E __COMPAT_LAYER=RUNASINVOKER -- $<
386 $(TEST) -f $@
387 $(call VBOX_SIGN_IMAGE_FN,$@)
388
389endif # VBOX_SIGNING_MODE
390
391
392if defined(VBOX_WIN_ATTESTATION_SIGNING) && defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
393 #
394 # This automagically attestation signs the GA drivers.
395 #
396 $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME): \
397 $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
398 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.zip
399 cd $(PATH_OUT)/repackadd && $(VBOX_RETRY) $(VBOX_WIN_ATTESTATION_SIGNING_EXE) "VirtualBox GA drivers $(KBUILD_TARGET_ARCH) $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)r$(VBOX_SVN_REV)" "$(KBUILD_TARGET_ARCH)" "r$(VBOX_SVN_REV)" "$(VBOX_DRIVERS_PACK_NAME)"
400
401 #
402 # This creates a .CAB file of the driver files that should be attestation signed.
403 #
404 $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME): \
405 $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd \
406 # $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) - is is unsafe, because of the 'ing ugly hack replacing most of them above during packing.
407 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.cab
408 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.ddf
409 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.inf
410 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.rpt
411 $(EXEC_X86_WIN32) cmd /c $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd -b $(PATH_STAGE_BIN) -a $(KBUILD_TARGET_ARCH) \
412 -x -n --no-main --ga -o $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
413 $(call VBOX_SIGN_EV_FILE_FN,$@)
414endif # VBOX_WIN_ATTESTATION_SIGNING && VBOX_SIGNING_MODE && VBOX_SIGN_ADDITIONS
415
416
417#
418# Repackaging scripts and files.
419#
420INSTALLS += RePackScriptsAdd
421RePackScriptsAdd_TEMPLATE = DUMMY
422RePackScriptsAdd_INST = repackadd/
423RePackScriptsAdd_INSTTYPE = stage
424RePackScriptsAdd_SOURCES = \
425 ../../../Installer/win/Scripts/UnpackBlessedDrivers.cmd \
426 $(RePackScriptsAdd_0_OUTDIR)/PackDriversForSubmission.cmd \
427 $(RePackScriptsAdd_0_OUTDIR)/Combined-1-Prepare.cmd \
428 $(RePackScriptsAdd_0_OUTDIR)/Combined-3-RepackAdditions.cmd \
429 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
430RePackScriptsAdd_CLEAN = \
431 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
432
433ifndef VBOX_OSE
434 RePackScriptsAdd_SOURCES += \
435 $(RePackScriptsAdd_0_OUTDIR)/Combined-0-Additions.cmd \
436 $(RePackScriptsAdd_0_OUTDIR)/Combined-2-SignAdditions.cmd
437endif
438
439$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/PackDriversForSubmission.cmd,PackDriversForSubmission.cmd)
440$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-1-Prepare.cmd,Combined-1-Prepare.cmd)
441ifndef VBOX_OSE
442 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-0-Additions.cmd,Combined-0-Additions.cmd)
443 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-2-SignAdditions.cmd,Combined-2-SignAdditions.cmd)
444endif
445$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-3-RepackAdditions.cmd,Combined-3-RepackAdditions.cmd)
446
447# The %~dp1\ oddity is working around otherwise ending with \" during
448# expansion of the CCS command line which for a reason I cannot immediately
449# understand appends a " to the path.
450$$(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd: | $$(dir $$@)
451 $(APPEND) -nt "$@" \
452 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
453 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
454 'if ".%1" == "." (echo No .cab file specified & exit /b 1)' \
455 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
456 '( $(call VBOX_SIGN_EV_FILE_FN,%1,%~dp1\) ) || exit /b1' \
457 ) )
458
459#
460# Repacking resources.
461#
462INSTALLS += RePackScriptsAddResources
463RePackScriptsAddResources_TEMPLATE = DUMMY
464RePackScriptsAddResources_INST = repackadd/resources/
465RePackScriptsAddResources_INSTTYPE = stage
466RePackScriptsAddResources_DIRS = Languages
467RePackScriptsAddResources_SOURCES = \
468 welcome.bmp \
469 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE)=>VirtualBoxGA-vista.ico \
470 $(VBOX_NSIS_ICON_FILE)=>VirtualBoxGA-nsis.ico \
471 $(PATH_ROOT)/doc/License-gpl-3.0.rtf \
472 VBoxGuestAdditions.nsi \
473 dumplog.nsh \
474 ReplaceDLL.nsh \
475 servicepack.nsh \
476 strstr.nsh \
477 VBoxGuestAdditionsCommon.nsh \
478 VBoxGuestAdditionsExternal.nsh \
479 VBoxGuestAdditionsLog.nsh \
480 VBoxGuestAdditionsNT4.nsh \
481 VBoxGuestAdditionsUninstall.nsh \
482 VBoxGuestAdditionsUninstallOld.nsh \
483 VBoxGuestAdditionsVista.nsh \
484 VBoxGuestAdditionsW2KXP.nsh \
485 winver.nsh \
486 ISO/AUTORUN.INF \
487 ISO/NT3xReadme.txt \
488 \
489 Languages/English.nsh=>Languages/English.nsh \
490 Languages/French.nsh=>Languages/French.nsh \
491 Languages/German.nsh=>Languages/German.nsh
492
493
494#
495# NT3.x installer.
496#
497# Just for fun, this one does not use the CRT more than it really really needs
498# to. This saves space and avoid compatiblity issues, it also makes for a
499# fun challenge.
500#
501PROGRAMS.win.x86 += VBoxAddInstallNt3x
502ifdef VBOX_WITH_NOCRT_STATIC
503 ## @todo noCRT: the result is much too big. Got rid of log.cpp, but still pretty big. Work on reducing it.
504 VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3Exe
505else
506 VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3NoCrtExe
507endif
508VBoxAddInstallNt3x_SOURCES := VBoxAddInstallNt3x.cpp
509VBoxAddInstallNt3x.cpp_DEPS = $(VBOX_SVN_REV_HEADER)
510
511
512include $(FILE_KBUILD_SUB_FOOTER)
513
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