VirtualBox

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

Last change on this file since 90711 was 89675, checked in by vboxsync, 4 years ago

Audio/ValKit: More guest/host installer tweaking for shipping VKAT (now as VBoxAudioTest, to not clutter up files / naming conventions) [Additions build fix]. bugref:10008

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.0 KB
Line 
1# $Id: Makefile.kmk 89675 2021-06-14 10:08:24Z vboxsync $
2## @file
3# Sub-Makefile for the Windows Guest Additions Installer.
4#
5
6#
7# Copyright (C) 2006-2020 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21# Include Sub-Makefiles.
22include $(PATH_SUB_CURRENT)/Loader/Makefile.kmk
23include $(PATH_SUB_CURRENT)/InstallHelper/Makefile.kmk
24
25# Globals
26VBOX_PATH_WIN_ADD_INS_SRC := $(PATH_SUB_CURRENT)
27VBOX_PATH_ADDITIONS.win.x86 := $(PATH_OUT_BASE)/win.x86/$(KBUILD_TYPE)/bin/additions
28VBOX_WITH_GUEST_INSTALL_HELPER := 1 # Use our guest install helper DLL.
29
30## @todo VBOX_WIN_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/win
31
32
33PROGRAMS += VBoxDrvInst
34VBoxDrvInst_TEMPLATE= VBoxGuestR3Exe
35VBoxDrvInst_DEFS = _WIN32_WINNT=0x0400 _UNICODE UNICODE
36VBoxDrvInst_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
37ifdef VBOX_WITH_WDDM
38 VBoxDrvInst_DEFS += VBOX_WITH_WDDM
39endif
40VBoxDrvInst_DEPS = $(VBOX_SVN_REV_KMK)
41VBoxDrvInst_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST)
42VBoxDrvInst_LIBS = \
43 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/setupapi.lib \
44 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/newdev.lib
45VBoxDrvInst_SOURCES = \
46 VBoxDrvInst.cpp \
47 VBoxDrvInst.rc
48
49PROGRAMS += VBoxGuestDrvInst
50VBoxGuestDrvInst_TEMPLATE= VBoxGuestR3Exe
51VBoxGuestDrvInst_DEFS = _WIN32_WINNT=0x0400 UNICODE
52VBoxGuestDrvInst_SOURCES = \
53 VBoxGuestDrvInst.cpp \
54 VBoxGuestDrvInst.rc
55
56PROGRAMS += RegCleanup
57RegCleanup_TEMPLATE = VBoxGuestR3Exe
58RegCleanup_DEFS = _WIN32_WINNT=0x0400 UNICODE
59RegCleanup_SOURCES = \
60 RegCleanup.cpp \
61 RegCleanup.rc
62
63
64#
65# The installer.
66#
67PACKING += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
68OTHER_CLEAN += \
69 $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe \
70 $(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe
71
72## @todo r=andy Rename DRIVER_FILES to INST_FILES or something, as those files are not strictly driver-related files.
73
74DRIVER_FILES := \
75 $(PATH_STAGE_BIN)/additions/VBoxGuestDrvInst.exe \
76 $(PATH_STAGE_BIN)/additions/RegCleanup.exe \
77 $(PATH_STAGE_BIN)/additions/VBoxMouse.sys \
78 $(PATH_STAGE_BIN)/additions/VBoxGuest.sys \
79 $(PATH_STAGE_BIN)/additions/VBoxVideo.sys \
80 $(PATH_STAGE_BIN)/additions/VBoxDisp.dll \
81 $(PATH_STAGE_BIN)/additions/VBoxSF.sys \
82 $(PATH_STAGE_BIN)/additions/VBoxMRXNP.dll \
83 $(PATH_STAGE_BIN)/additions/VBoxTray.exe \
84 $(PATH_STAGE_BIN)/additions/VBoxControl.exe \
85 $(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe \
86 $(PATH_STAGE_BIN)/additions/VBoxService.exe
87ifeq ($(KBUILD_TARGET_ARCH),amd64)
88 # Also include 32-bit network provider DLLs on 64-bit guests to enable
89 # running 32-bit apps which use that.
90 DRIVER_FILES += \
91 $(PATH_STAGE_BIN)/additions/VBoxMRXNP-x86.dll
92endif
93ifeq ($(KBUILD_TARGET_ARCH),x86)
94DRIVER_FILES += \
95 $(PATH_STAGE_BIN)/additions/VBoxMouseNT.sys \
96 $(PATH_STAGE_BIN)/additions/VBoxSFW2K.sys
97endif
98DRIVER_FILES += \
99 $(PATH_STAGE_BIN)/additions/VBoxVideo.inf \
100 $(PATH_STAGE_BIN)/additions/VBoxGuest.inf
101ifdef VBOX_SIGN_ADDITIONS
102DRIVER_FILES += \
103 $(PATH_STAGE_BIN)/additions/VBoxVideo.cat \
104 $(PATH_STAGE_BIN)/additions/VBoxGuest.cat
105endif
106ifdef VBOX_WITH_WDDM
107DRIVER_FILES += \
108 $(PATH_STAGE_BIN)/additions/VBoxWddm.sys \
109 $(PATH_STAGE_BIN)/additions/VBoxWddm.inf \
110 $(PATH_STAGE_BIN)/additions/VBoxDispD3D.dll
111 ifdef VBOX_WITH_MESA3D
112DRIVER_FILES += \
113 $(PATH_STAGE_BIN)/additions/VBoxNine.dll \
114 $(PATH_STAGE_BIN)/additions/VBoxSVGA.dll \
115 $(PATH_STAGE_BIN)/additions/VBoxICD.dll \
116 $(PATH_STAGE_BIN)/additions/VBoxGL.dll
117 endif
118 ifdef VBOX_SIGN_ADDITIONS
119DRIVER_FILES += \
120 $(PATH_STAGE_BIN)/additions/VBoxWddm.cat
121 endif
122 ifeq ($(KBUILD_TARGET_ARCH),amd64)
123DRIVER_FILES += \
124 $(PATH_STAGE_BIN)/additions/VBoxDispD3D-x86.dll
125 ifdef VBOX_WITH_MESA3D
126DRIVER_FILES += \
127 $(PATH_STAGE_BIN)/additions/VBoxNine-x86.dll \
128 $(PATH_STAGE_BIN)/additions/VBoxSVGA-x86.dll \
129 $(PATH_STAGE_BIN)/additions/VBoxICD-x86.dll \
130 $(PATH_STAGE_BIN)/additions/VBoxGL-x86.dll
131 endif
132 endif
133endif
134
135ifdef env.VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
136 DRIVER_FILES += \
137 $(PATH_STAGE_BIN)/additions/VBoxAudioTest.exe
138endif
139
140VB_WIN_ADD_NSIS_ENV := \
141 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
142 -E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \
143 -E 'PATH_TARGET_X86=$(subst /,\,$(PATH_OUT_BASE)/win.x86/$(KBUILD_TYPE)/obj)' \
144 -E 'VBOX_PATH_ADDITIONS_WIN_X86=$(subst /,\,$(VBOX_PATH_ADDITIONS.win.x86))' \
145 -E 'VBOX_PATH_DIFX=$(subst /,\,$(VBOX_PATH_DIFX))' \
146 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
147 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
148 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
149 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
150 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
151 -E 'VBOX_VERSION_STRING_RAW=$(VBOX_VERSION_STRING_RAW)' \
152 -E 'VBOX_VERSION_MAJOR=$(VBOX_VERSION_MAJOR)' \
153 -E 'VBOX_VERSION_MINOR=$(VBOX_VERSION_MINOR)' \
154 -E 'VBOX_VERSION_BUILD=$(VBOX_VERSION_BUILD)' \
155 -E 'VBOX_SVN_REV=$(VBOX_SVN_REV)' \
156 -E 'VBOX_WINDOWS_ADDITIONS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ADDITIONS_ICON_FILE))' \
157 -E 'VBOX_NSIS_ICON_FILE=$(subst /,\,$(VBOX_NSIS_ICON_FILE))' \
158 -E 'VBOX_WITH_GUEST_INSTALL_HELPER=$(if $(VBOX_WITH_GUEST_INSTALL_HELPER),1,0)' \
159 -E 'VBOX_WITH_GUEST_INSTALLER_UNICODE=$(if $(VBOX_WITH_GUEST_INSTALLER_UNICODE),1,0)' \
160 -E 'VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST=$(if $(VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST),1,0)' \
161 -E 'VBOX_WITH_LICENSE_INSTALL_RTF=$(if $(VBOX_BRAND_LICENSE_RTF),1,0)' \
162 -E 'VBOX_WITH_WDDM=$(if $(VBOX_WITH_WDDM),1,0)' \
163 -E 'VBOX_WITH_MESA3D=$(if $(VBOX_WITH_MESA3D),1,0)' \
164 -E 'VBOX_BRAND_WIN_ADD_INST_DLGBMP=$(subst /,\,$(VBOX_BRAND_WIN_ADD_INST_DLGBMP))' \
165 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
166 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),-E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(VBOX_BRAND_$(lang)_LICENSE_RTF)') \
167 -E 'KBUILD_TYPE=$(KBUILD_TYPE)' \
168 -E 'KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)'
169
170ifdef VBOX_SIGNING_MODE
171#
172# This is a hack to sign the uninstaller.
173# See http://nsis.sourceforge.net/Signing_an_Uninstaller for more details.
174#
175OTHER_CLEAN += $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe
176
177$(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe: \
178 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
179 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
180 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
181 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
182 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
183 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
184 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
185 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
186 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
187 $(DRIVER_FILES) \
188 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
189 $(VBOX_NSIS_ICON_FILE) \
190 $(VBOX_VERSION_STAMP) \
191 $$(VBoxDrvInst_1_STAGE_TARGET) \
192 | $$(dir $$@)
193 $(call MSG_L1,Creating $@, from $<)
194 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
195 $(VB_WIN_ADD_NSIS_ENV) \
196 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
197 $(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
198 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
199 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
200 '/DUNINSTALLER_ONLY=1' \
201 '$(subst /,\,$<)'
202
203OTHER_CLEAN += $(PATH_TARGET)/uninst.exe
204$(PATH_TARGET)/uninst.exe: $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe | $$(dir $$@)
205 $(call MSG_L1,Creating $@, from $<)
206 $(QUIET)$(RM) -f $@
207 - $<
208 $(TEST) -f $@
209 $(call VBOX_SIGN_FILE_FN,$@)
210endif
211
212WHQLFAKE := $(PATH_SUB_CURRENT)/VBoxWHQLFake.au3
213
214$(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe:
215 $(call MSG_L1,Creating $@, from $<)
216 $(QUIET)$(EXEC_X86_WIN32) $(VBOX_PATH_AUTOIT3)/Aut2Exe/Aut2exe.exe \
217 /in $(WHQLFAKE) \
218 /out $(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe \
219 /icon $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
220 /comp 4 \
221 /unicode
222
223$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
224 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
225 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
226 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
227 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
228 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
229 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
230 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
231 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
232 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
233 $(DRIVER_FILES) \
234 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
235 $(VBOX_NSIS_ICON_FILE) \
236 $(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
237 $(VBOX_VERSION_STAMP) \
238 $$(VBoxDrvInst_1_STAGE_TARGET)
239 $(call MSG_L1,Creating $@, from $<)
240 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
241 $(VB_WIN_ADD_NSIS_ENV) \
242 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
243 $(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
244 $(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
245 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
246 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
247 '$(subst /,\,$<)'
248 $(call VBOX_SIGN_FILE_FN,$@)
249
250#
251# Repackaging scripts and files.
252#
253INSTALLS += RePackScriptsAdd
254RePackScriptsAdd_TEMPLATE = DUMMY
255RePackScriptsAdd_INST = repackadd/
256RePackScriptsAdd_INSTTYPE = stage
257RePackScriptsAdd_SOURCES = \
258 ../../../Installer/win/Scripts/UnpackBlessedDrivers.cmd \
259 $(RePackScriptsAdd_0_OUTDIR)/PackDriversForSubmission.cmd \
260 $(RePackScriptsAdd_0_OUTDIR)/Combined-1-Prepare.cmd \
261 $(RePackScriptsAdd_0_OUTDIR)/Combined-3-RepackAdditions.cmd \
262 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
263RePackScriptsAdd_CLEAN = \
264 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
265
266ifndef VBOX_OSE
267RePackScriptsAdd_SOURCES += \
268 $(RePackScriptsAdd_0_OUTDIR)/Combined-0-Additions.cmd \
269 $(RePackScriptsAdd_0_OUTDIR)/Combined-2-SignAdditions.cmd \
270 ../../../Installer/win/Scripts/sign-attestation.sh
271endif
272
273$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/PackDriversForSubmission.cmd,PackDriversForSubmission.cmd)
274$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-1-Prepare.cmd,Combined-1-Prepare.cmd)
275ifndef VBOX_OSE
276$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-0-Additions.cmd,Combined-0-Additions.cmd)
277$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-2-SignAdditions.cmd,Combined-2-SignAdditions.cmd)
278endif
279$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-3-RepackAdditions.cmd,Combined-3-RepackAdditions.cmd)
280
281# The %~dp1\ oddity is working around otherwise ending with \" during
282# expansion of the CCS command line which for a reason I cannot immediately
283# understand appends a " to the path.
284$$(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd: | $$(dir $$@)
285 $(APPEND) -nt "$@" \
286 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
287 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
288 'if ".%1" == "." (echo No .cab file specified & exit /b 1)' \
289 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
290 '( $(call VBOX_SIGN_EV_FILE_FN,%1,%~dp1\) ) || exit /b1' \
291 ) )
292
293#
294# Repacking resources.
295#
296INSTALLS += RePackScriptsAddResources
297RePackScriptsAddResources_TEMPLATE = DUMMY
298RePackScriptsAddResources_INST = repackadd/resources/
299RePackScriptsAddResources_INSTTYPE = stage
300RePackScriptsAddResources_DIRS = Languages
301RePackScriptsAddResources_SOURCES = \
302 welcome.bmp \
303 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE)=>VirtualBoxGA-vista.ico \
304 $(VBOX_NSIS_ICON_FILE)=>VirtualBoxGA-nsis.ico \
305 iexplore.ico \
306 $(PATH_ROOT)/doc/License-gpl-2.0.rtf \
307 VBoxGuestAdditions.nsi \
308 dumplog.nsh \
309 ReplaceDLL.nsh \
310 servicepack.nsh \
311 strstr.nsh \
312 VBoxGuestAdditionsCommon.nsh \
313 VBoxGuestAdditionsExternal.nsh \
314 VBoxGuestAdditionsLog.nsh\
315 VBoxGuestAdditionsNT4.nsh \
316 VBoxGuestAdditionsUninstall.nsh \
317 VBoxGuestAdditionsUninstallOld.nsh \
318 VBoxGuestAdditionsVista.nsh\
319 VBoxGuestAdditionsW2KXP.nsh\
320 winver.nsh \
321 ISO/AUTORUN.INF \
322 ISO/NT3xReadme.txt \
323 \
324 Languages/English.nsh=>Languages/English.nsh \
325 Languages/French.nsh=>Languages/French.nsh \
326 Languages/German.nsh=>Languages/German.nsh
327
328
329#
330# NT3.x installer.
331#
332# Just for fun, this one does not use the CRT more than it really really needs
333# to. This saves space and avoid compatiblity issues, it also makes for a
334# fun challenge.
335#
336PROGRAMS.win.x86 += VBoxAddInstallNt3x
337VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3NoCrtExe
338#VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3Exe
339VBoxAddInstallNt3x_SOURCES := \
340 VBoxAddInstallNt3x.cpp \
341
342
343VBoxAddInstallNt3x.cpp_DEPS = $(VBOX_SVN_REV_HEADER)
344
345
346include $(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