VirtualBox

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

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

Windows Additions installer: Touch the installer via the new VBoxNSISTool for verifying + repairing NSIS installer files. This is necessary for getting the CRC32 right after we've built the NSIS installer and set the version via VBoxSetPeVersion afterwards, which renders the initial checksum within the installer invalid and thus prevents starting the installer. bugref:10761

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