VirtualBox

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

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

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.9 KB
Line 
1# $Id: Makefile.kmk 82968 2020-02-04 10:35:17Z 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
32PROGRAMS += VBoxDrvInst
33VBoxDrvInst_TEMPLATE= VBoxGuestR3Exe
34VBoxDrvInst_DEFS = _WIN32_WINNT=0x0400 _UNICODE UNICODE
35VBoxDrvInst_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
36ifdef VBOX_WITH_WDDM
37 VBoxDrvInst_DEFS += VBOX_WITH_WDDM
38endif
39VBoxDrvInst_DEPS = $(VBOX_SVN_REV_KMK)
40VBoxDrvInst_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST)
41VBoxDrvInst_LIBS = \
42 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/setupapi.lib \
43 $(PATH_SDK_$(VBOX_WINDDK_GST)_LIB)/newdev.lib
44VBoxDrvInst_SOURCES = \
45 VBoxDrvInst.cpp \
46 VBoxDrvInst.rc
47
48PROGRAMS += VBoxGuestDrvInst
49VBoxGuestDrvInst_TEMPLATE= VBoxGuestR3Exe
50VBoxGuestDrvInst_DEFS = _WIN32_WINNT=0x0400 UNICODE
51VBoxGuestDrvInst_SOURCES = \
52 VBoxGuestDrvInst.cpp \
53 VBoxGuestDrvInst.rc
54
55PROGRAMS += RegCleanup
56RegCleanup_TEMPLATE = VBoxGuestR3Exe
57RegCleanup_DEFS = _WIN32_WINNT=0x0400 UNICODE
58RegCleanup_SOURCES = \
59 RegCleanup.cpp \
60 RegCleanup.rc
61
62
63#
64# The installer.
65#
66PACKING += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
67OTHER_CLEAN += \
68 $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe \
69 $(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe
70
71DRIVER_FILES := \
72 $(PATH_STAGE_BIN)/additions/VBoxGuestDrvInst.exe \
73 $(PATH_STAGE_BIN)/additions/RegCleanup.exe \
74 $(PATH_STAGE_BIN)/additions/VBoxMouse.sys \
75 $(PATH_STAGE_BIN)/additions/VBoxGuest.sys \
76 $(PATH_STAGE_BIN)/additions/VBoxVideo.sys \
77 $(PATH_STAGE_BIN)/additions/VBoxDisp.dll \
78 $(PATH_STAGE_BIN)/additions/VBoxSF.sys \
79 $(PATH_STAGE_BIN)/additions/VBoxMRXNP.dll \
80 $(PATH_STAGE_BIN)/additions/VBoxTray.exe \
81 $(PATH_STAGE_BIN)/additions/VBoxControl.exe \
82 $(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe \
83 $(PATH_STAGE_BIN)/additions/VBoxService.exe
84ifeq ($(KBUILD_TARGET_ARCH),amd64)
85 # Also include 32-bit network provider DLLs on 64-bit guests to enable
86 # running 32-bit apps which use that.
87 DRIVER_FILES += \
88 $(PATH_STAGE_BIN)/additions/VBoxMRXNP-x86.dll
89endif
90ifeq ($(KBUILD_TARGET_ARCH),x86)
91DRIVER_FILES += \
92 $(PATH_STAGE_BIN)/additions/VBoxMouseNT.sys
93endif
94DRIVER_FILES += \
95 $(PATH_STAGE_BIN)/additions/VBoxVideo.inf \
96 $(PATH_STAGE_BIN)/additions/VBoxGuest.inf
97ifdef VBOX_SIGN_ADDITIONS
98DRIVER_FILES += \
99 $(PATH_STAGE_BIN)/additions/VBoxVideo.cat \
100 $(PATH_STAGE_BIN)/additions/VBoxGuest.cat
101endif
102ifdef VBOX_WITH_WDDM
103DRIVER_FILES += \
104 $(PATH_STAGE_BIN)/additions/VBoxWddm.sys \
105 $(PATH_STAGE_BIN)/additions/VBoxWddm.inf \
106 $(PATH_STAGE_BIN)/additions/VBoxDispD3D.dll
107 ifdef VBOX_WITH_MESA3D
108DRIVER_FILES += \
109 $(PATH_STAGE_BIN)/additions/VBoxNine.dll \
110 $(PATH_STAGE_BIN)/additions/VBoxSVGA.dll \
111 $(PATH_STAGE_BIN)/additions/VBoxICD.dll \
112 $(PATH_STAGE_BIN)/additions/VBoxGL.dll
113 endif
114 ifdef VBOX_SIGN_ADDITIONS
115DRIVER_FILES += \
116 $(PATH_STAGE_BIN)/additions/VBoxWddm.cat
117 endif
118 ifeq ($(KBUILD_TARGET_ARCH),amd64)
119DRIVER_FILES += \
120 $(PATH_STAGE_BIN)/additions/VBoxDispD3D-x86.dll
121 ifdef VBOX_WITH_MESA3D
122DRIVER_FILES += \
123 $(PATH_STAGE_BIN)/additions/VBoxNine-x86.dll \
124 $(PATH_STAGE_BIN)/additions/VBoxSVGA-x86.dll \
125 $(PATH_STAGE_BIN)/additions/VBoxICD-x86.dll \
126 $(PATH_STAGE_BIN)/additions/VBoxGL-x86.dll
127 endif
128 endif
129endif
130VB_WIN_ADD_NSIS_ENV := \
131 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
132 -E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \
133 -E 'PATH_TARGET_X86=$(subst /,\,$(PATH_OUT_BASE)/win.x86/$(KBUILD_TYPE)/obj)' \
134 -E 'VBOX_PATH_ADDITIONS_WIN_X86=$(subst /,\,$(VBOX_PATH_ADDITIONS.win.x86))' \
135 -E 'VBOX_PATH_DIFX=$(subst /,\,$(VBOX_PATH_DIFX))' \
136 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
137 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
138 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
139 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
140 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
141 -E 'VBOX_VERSION_STRING_RAW=$(VBOX_VERSION_STRING_RAW)' \
142 -E 'VBOX_VERSION_MAJOR=$(VBOX_VERSION_MAJOR)' \
143 -E 'VBOX_VERSION_MINOR=$(VBOX_VERSION_MINOR)' \
144 -E 'VBOX_VERSION_BUILD=$(VBOX_VERSION_BUILD)' \
145 -E 'VBOX_SVN_REV=$(VBOX_SVN_REV)' \
146 -E 'VBOX_WINDOWS_ADDITIONS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ADDITIONS_ICON_FILE))' \
147 -E 'VBOX_NSIS_ICON_FILE=$(subst /,\,$(VBOX_NSIS_ICON_FILE))' \
148 -E 'VBOX_WITH_GUEST_INSTALL_HELPER=$(if $(VBOX_WITH_GUEST_INSTALL_HELPER),1,0)' \
149 -E 'VBOX_WITH_GUEST_INSTALLER_UNICODE=$(if $(VBOX_WITH_GUEST_INSTALLER_UNICODE),1,0)' \
150 -E 'VBOX_WITH_LICENSE_INSTALL_RTF=$(if $(VBOX_BRAND_LICENSE_RTF),1,0)' \
151 -E 'VBOX_WITH_WDDM=$(if $(VBOX_WITH_WDDM),1,0)' \
152 -E 'VBOX_WITH_MESA3D=$(if $(VBOX_WITH_MESA3D),1,0)' \
153 -E 'VBOX_BRAND_WIN_ADD_INST_DLGBMP=$(subst /,\,$(VBOX_BRAND_WIN_ADD_INST_DLGBMP))' \
154 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
155 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),-E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(VBOX_BRAND_$(lang)_LICENSE_RTF)') \
156 -E 'BUILD_TYPE=$(KBUILD_TYPE)' \
157 -E 'BUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)'
158
159ifdef VBOX_SIGNING_MODE
160#
161# This is a hack to sign the uninstaller.
162# See http://nsis.sourceforge.net/Signing_an_Uninstaller for more details.
163#
164OTHER_CLEAN += $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe
165
166$(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe: \
167 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
168 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
169 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
170 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
171 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
172 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
173 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
174 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
175 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
176 $(DRIVER_FILES) \
177 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
178 $(VBOX_NSIS_ICON_FILE) \
179 $(VBOX_VERSION_STAMP) \
180 $$(VBoxDrvInst_1_STAGE_TARGET) \
181 | $$(dir $$@)
182 $(call MSG_L1,Creating $@, from $<)
183 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
184 $(VB_WIN_ADD_NSIS_ENV) \
185 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
186 $(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
187 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
188 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
189 '/DUNINSTALLER_ONLY=1' \
190 '$(subst /,\,$<)'
191
192OTHER_CLEAN += $(PATH_TARGET)/uninst.exe
193$(PATH_TARGET)/uninst.exe: $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe | $$(dir $$@)
194 $(call MSG_L1,Creating $@, from $<)
195 $(QUIET)$(RM) -f $@
196 - $<
197 $(TEST) -f $@
198 $(call VBOX_SIGN_FILE_FN,$@)
199endif
200
201WHQLFAKE := $(PATH_SUB_CURRENT)/VBoxWHQLFake.au3
202
203$(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe:
204 $(call MSG_L1,Creating $@, from $<)
205 $(QUIET)$(EXEC_X86_WIN32) $(VBOX_PATH_AUTOIT3)/Aut2Exe/Aut2exe.exe \
206 /in $(WHQLFAKE) \
207 /out $(PATH_STAGE_BIN)/additions/VBoxWHQLFake.exe \
208 /icon $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
209 /comp 4 \
210 /unicode
211
212$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
213 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
214 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
215 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
216 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
217 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
218 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
219 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
220 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
221 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
222 $(DRIVER_FILES) \
223 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
224 $(VBOX_NSIS_ICON_FILE) \
225 $(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
226 $(VBOX_VERSION_STAMP) \
227 $$(VBoxDrvInst_1_STAGE_TARGET)
228 $(call MSG_L1,Creating $@, from $<)
229 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
230 $(VB_WIN_ADD_NSIS_ENV) \
231 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
232 $(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
233 $(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
234 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
235 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
236 '$(subst /,\,$<)'
237 $(call VBOX_SIGN_FILE_FN,$@)
238
239#
240# Repackaging scripts and files.
241#
242INSTALLS += RePackScriptsAdd
243RePackScriptsAdd_TEMPLATE = DUMMY
244RePackScriptsAdd_INST = repackadd/
245RePackScriptsAdd_INSTTYPE = stage
246RePackScriptsAdd_SOURCES = \
247 ../../../Installer/win/Scripts/UnpackBlessedDrivers.cmd \
248 $(RePackScriptsAdd_0_OUTDIR)/PackDriversForSubmission.cmd \
249 $(RePackScriptsAdd_0_OUTDIR)/Combined-1-Prepare.cmd \
250 $(RePackScriptsAdd_0_OUTDIR)/Combined-2-SignAdditions.cmd \
251 $(RePackScriptsAdd_0_OUTDIR)/Combined-3-RepackAdditions.cmd \
252 ../../../Installer/win/Scripts/sign-attestation.sh \
253 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
254RePackScriptsAdd_CLEAN = \
255 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
256
257$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/PackDriversForSubmission.cmd,PackDriversForSubmission.cmd)
258$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-1-Prepare.cmd,Combined-1-Prepare.cmd)
259$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-2-SignAdditions.cmd,Combined-2-SignAdditions.cmd)
260$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-3-RepackAdditions.cmd,Combined-3-RepackAdditions.cmd)
261
262# The %~dp1\ oddity is working around otherwise ending with \" during
263# expansion of the CCS command line which for a reason I cannot immediately
264# understand appends a " to the path.
265$$(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd: | $$(dir $$@)
266 $(APPEND) -nt "$@" \
267 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
268 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
269 'if ".%1" == "." (echo No .cab file specified & exit /b 1)' \
270 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
271 '( $(call VBOX_SIGN_EV_FILE_FN,%1,%~dp1\) ) || exit /b1' \
272 ) )
273
274#
275# Repacking resources.
276#
277INSTALLS += RePackScriptsAddResources
278RePackScriptsAddResources_TEMPLATE = DUMMY
279RePackScriptsAddResources_INST = repackadd/resources/
280RePackScriptsAddResources_INSTTYPE = stage
281RePackScriptsAddResources_DIRS = Languages
282RePackScriptsAddResources_SOURCES = \
283 welcome.bmp \
284 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE)=>VirtualBoxGA-vista.ico \
285 $(VBOX_NSIS_ICON_FILE)=>VirtualBoxGA-nsis.ico \
286 iexplore.ico \
287 $(PATH_ROOT)/doc/License-gpl-2.0.rtf \
288 VBoxGuestAdditions.nsi \
289 dumplog.nsh \
290 ReplaceDLL.nsh \
291 servicepack.nsh \
292 strstr.nsh \
293 VBoxGuestAdditionsCommon.nsh \
294 VBoxGuestAdditionsExternal.nsh \
295 VBoxGuestAdditionsLog.nsh\
296 VBoxGuestAdditionsNT4.nsh \
297 VBoxGuestAdditionsUninstall.nsh \
298 VBoxGuestAdditionsUninstallOld.nsh \
299 VBoxGuestAdditionsVista.nsh\
300 VBoxGuestAdditionsW2KXP.nsh\
301 winver.nsh \
302 ISO/AUTORUN.INF \
303 ISO/NT3xReadme.txt \
304 \
305 Languages/English.nsh=>Languages/English.nsh \
306 Languages/French.nsh=>Languages/French.nsh \
307 Languages/German.nsh=>Languages/German.nsh
308
309
310include $(FILE_KBUILD_SUB_FOOTER)
311
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