VirtualBox

source: vbox/trunk/src/VBox/Installer/win/Makefile.kmk@ 32359

Last change on this file since 32359 was 32113, checked in by vboxsync, 14 years ago

Drop TallowCOM.sed. nits.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 25.1 KB
Line 
1# $Id: Makefile.kmk 32113 2010-08-31 08:51:21Z vboxsync $
2## @file
3# Makefile for the Windows installer.
4#
5
6#
7# Copyright (C) 2006-2010 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
21ifneq ($(KBUILD_HOST),win)
22 $(error "The Windows installer can only be built on Windows!")
23endif
24
25#
26# Include Sub-Makefiles.
27#
28include $(PATH_SUB_CURRENT)/InstallHelper/Makefile.kmk
29
30ifdef VBOX_WITH_BUNDLED_INSTALLER
31 ifeq ($(KBUILD_TARGET_ARCH),x86)
32 include $(PATH_SUB_CURRENT)/BundleMachine/Makefile.kmk
33 endif
34endif
35
36ifeq ($(KBUILD_TARGET_ARCH),x86)
37 include $(PATH_SUB_CURRENT)/Stub/Makefile.kmk
38 include $(PATH_SUB_CURRENT)/StubBld/Makefile.kmk
39 ifdef VBOX_BRAND_WIN_AS_MENU
40 include $(PATH_SUB_CURRENT)/AutoStartMenu/Makefile.kmk
41 endif
42endif
43
44#
45# Globals and targets.
46#
47VBOX_INSTALLER_LANGUAGES = en_US
48VBOX_INSTALLER_LANGUAGES += $(VBOX_INSTALLER_ADD_LANGUAGES)
49
50VBOX_PATH_WIN_INST_SRC := $(PATH_SUB_CURRENT)
51VBOX_WIN_INST_OUT_DIR := $(PATH_TARGET)/Installer/win
52
53
54## @todo VBOX_ prefixes!
55PACKAGE_BASE := VirtualBox-$(VBOX_VERSION_STRING)
56PACKAGE_NAME_LANG := $(PACKAGE_BASE)-r$(VBOX_SVN_REV)
57PACKAGE_NAME_FINAL := $(PATH_BIN)/$(PACKAGE_NAME_LANG).msi
58
59ifdef VBOX_WITH_COMBINED_PACKAGE
60 PATH_MULTIARCH_TEMP := $(PATH_OUT_BASE)/win.x86/$(KBUILD_TYPE)/obj/Installer
61 PATH_MULTIARCH_GUEST_ADDITIONS_ISO := $(PATH_OUT_BASE)/win.amd64/$(KBUILD_TYPE)/bin/additions
62 PACKAGE_NAME_MULTIARCH := $(PACKAGE_NAME_LANG)-MultiArch
63 PACKAGE_NAME_MULTIARCH.x86 := $(PACKAGE_NAME_MULTIARCH)_x86.msi
64 PACKAGE_NAME_MULTIARCH.amd64 := $(PACKAGE_NAME_MULTIARCH)_amd64.msi
65 PACKAGE_NAME_FINAL := $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.$(KBUILD_TARGET_ARCH))
66 PACKAGE_NAME_MULTIARCH_FINAL := $(PACKAGE_NAME_MULTIARCH).exe
67 PACKAGE_NAME_MULTIARCH_COMMONCAB := common.cab
68
69 BLDDIRS += $(PATH_MULTIARCH_TEMP)
70 PACKING += $(PACKAGE_NAME_FINAL)
71 ifeq ($(KBUILD_TARGET_ARCH),x86)
72 PACKING += $(PATH_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL)
73 endif
74else
75 PACKING += $(PACKAGE_NAME_FINAL)
76endif
77BLDDIRS += \
78 $(VBOX_WIN_INST_OUT_DIR) \
79 $(VBOX_WIN_INST_OUT_DIR)/Languages/
80
81OTHER_CLEAN += \
82 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj \
83 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep \
84 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
85 $(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi \
86 $(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
87 $(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
88 $(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl \
89 $(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl \
90 $(VBOX_WIN_INST_OUT_DIR)/Languages/$(lang).mst \
91 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_$(lang).wixobj \
92 $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_$(lang).msi) \
93 $(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi \
94 $(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi
95
96ifdef VBOX_WITH_COMBINED_PACKAGE
97 ifeq ($(KBUILD_TARGET_ARCH),x86)
98 OTHER_CLEAN += \
99 $(PATH_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL) \
100 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
101 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.am64) \
102 $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_MULTIARCH_COMMONCAB)
103 else
104 # Nothing to do here yet.
105 endif
106else
107 OTHER_CLEAN += \
108 $(PACKAGE_NAME_FINAL)
109endif
110
111ifdef VBOX_WITH_BUNDLED_INSTALLER
112 ifeq ($(KBUILD_TARGET),darwin)
113 VBOX_TMP_DIR ?= /VBox
114 ZIP = /usr/bin/zip
115 else
116 VBOX_TMP_DIR ?= c:\Temp
117 ZIP = zip
118 endif
119
120 ifndef VBOX_PATH_PACK_TMP
121 VBOX_PATH_PACK_TMP := $(VBOX_WIN_INST_OUT_DIR)
122 endif
123
124 VBOX_PATH_PACK_BUNDLE_TMP = $(PATH_BIN)/VBoxWinBundleInstaller
125 VBOX_PATH_PACK_BUNDLE_ZIP = $(PATH_BIN)/VBoxWinBundleInstaller-$(KBUILD_TARGET_ARCH).zip
126
127 VBOX_BRAND_WIN_INST_NAME.x86 = $(PACKAGE_BASE)-Win_x86$(VBOX_BRAND_WIN_INST_EXT).msi
128 VBOX_BRAND_WIN_INST_NAME.amd64 = $(PACKAGE_BASE)-Win_amd64$(VBOX_BRAND_WIN_INST_EXT).msi
129
130 PACKING.win += $(VBOX_PATH_PACK_BUNDLE_ZIP)
131endif
132
133
134#
135# Create intermediate XML file for languages (needed for .MSI linking).
136#
137# Note: The double escaping of $(dir $@) in the prereq/dep list is because we first have
138# to escape the expansion of the $(eval ) argument and then the definition of the
139# rule. The statement is finally expanded during second dependency expansion, which
140# takes place after all makefiles has been loaded and with the @ variable defined.
141#
142define def_vbox_lang_xml
143$(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl: $(VBOX_PATH_WIN_INST_SRC)/Languages/$(lang).wxl | $$$$(dir $$$$@)
144 $$(call MSG_GENERATE,,$$@,$$<)
145 $(QUIET)$(INSTALL) -m 0644 $$< $$@
146endef
147
148$(foreach lang,$(VBOX_INSTALLER_LANGUAGES),$(eval $(def_vbox_lang_xml)))
149
150
151#
152# Create intermediate XML file for licenses (needed for .MSI linking).
153# These files are created from the original .RTF files in the /docs directory.
154#
155# Note: The redirect command below will open $$@ as stdout in append+text mode
156# and then exec cat, thus appending the license file to the result file.
157#
158# Note: The license_file variable has to be created before def_vbox_license_xml
159# is expanded by the 2nd eval because we rely on the that expansion
160# replacing all $(license_file) (and $(lang)) references before evaluation.
161#
162# Note: The REDIRECT + ECHO_EXT is because WiX gets upset if there a newline
163# between the tag and the RTF license text.
164#
165define def_vbox_license_xml
166$(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl: $(license_file) $(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
167 $$(call MSG_GENERATE,,$$@,$$<)
168 $(APPEND) -t $$@ '<?xml version="1.0" encoding="utf-8"?>'
169 $(APPEND) $$@ '<WixLocalization xmlns="http://schemas.microsoft.com/wix/2003/11/localization" Codepage="1252">'
170
171 $(REDIRECT) -a+to $$@ -- $(ECHO_EXT) -n '<String Id=\"LicenseText\">'
172 $(REDIRECT) -a+to $$@ -- $(SED) -e "s|<|\&lt;|g" -e "s|>|\&gt;|g" $(license_file)
173 $(APPEND) $$@ '</String>'
174
175 $(APPEND) $$@ '<String Id="LicenseFile">$(license_file)</String>'
176 $(APPEND) $$@ '<String Id="LicenseInstallFileLong">License_$(lang).rtf</String>'
177 $(APPEND) $$@ '<String Id="LicenseInstallFileShort">L_$(lang).rtf</String>'
178
179 $(APPEND) $$@ '</WixLocalization>'
180endef
181
182$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
183 $(eval local license_file := $(VBOX_BRAND_$(subst en_US_,,$(lang)_)LICENSE_RTF)) \
184 $(eval $(def_vbox_license_xml)))
185
186
187#
188# Create one intermediate WXI (Windows Installer Include) file for all installers (needed for .MSI compiling).
189# This file includes all language-specific files (PDFs, CHMs, ...) to install.
190#
191# Note: When using the -n switch, append will append a new line after each
192# argument. The -t switch makes it truncate the file.
193#
194$(VBOX_WIN_INST_OUT_DIR)/Files_Main.wxi: $(MAKEFILE_CURRENT) | $$(dir $$@)
195 $(call MSG_GENERATE,,$@,$<)
196 $(APPEND) -t $@ '<?xml version="1.0" ?>'
197 $(APPEND) $@ '<Include>'
198ifdef VBOX_WITH_COMBINED_PACKAGE
199 ifdef VBOX_WITH_DOCS_CHM
200 $(APPEND) $@ ' <File Id="VirtualBox.chm" Name="VBox.chm" LongName="VirtualBox.chm" DiskId="2" Vital="yes" Source="$(PATH_BIN)/VirtualBox.chm"></File>'
201 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
202 ' <File Id="VirtualBox_$(lang).chm" Name="VB_$(lang).chm" LongName="VirtualBox_$(lang).chm" DiskId="2" Vital="yes" Source="$(PATH_BIN)/VirtualBox_$(lang).chm"></File>')
203 endif
204else
205 ifdef VBOX_WITH_DOCS_CHM
206 $(APPEND) $@ ' <File Id="userManCHM" Name="VBox.chm" LongName="VirtualBox.chm" DiskId="1" Vital="yes" Source="$(PATH_BIN)/VirtualBox.chm"></File>'
207 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
208 ' <File Id="userManCHM_$(lang)" Name="VB_$(lang).chm" LongName="VirtualBox_$(lang).chm" DiskId="1" Vital="yes" Source="$(PATH_BIN)/VirtualBox_$(lang).chm"></File>')
209 endif
210endif
211 $(APPEND) $@ '</Include>'
212
213$(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi: $(MAKEFILE_CURRENT) | $$(dir $$@)
214 $(call MSG_GENERATE,,$@,$<)
215 $(APPEND) -t $@ '<?xml version="1.0" ?>'
216 $(APPEND) $@ '<Include>'
217ifdef VBOX_WITH_COMBINED_PACKAGE
218 $(APPEND) $@ ' <File Id="UserManual.pdf" Name="Manual.pdf" LongName="UserManual.pdf" DiskId="2" Vital="yes" Source="$(PATH_BIN)/UserManual.pdf">'
219 $(APPEND) $@ ' <Shortcut Id="startmenuManPDF_en_US" Directory="ProgramMenuDir" Name="M_en_US" LongName="$$(loc.StartMenu_UserManual) (English)" WorkingDirectory="INSTALLDIR"/>'
220 $(APPEND) $@ ' </File>'
221 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
222 ' <File Id="UserManual_$(lang).pdf" Name="Mn_$(lang).pdf" LongName="UserManual_$(lang).pdf" DiskId="2" Vital="yes" Source="$(PATH_BIN)/UserManual_$(lang).pdf">' \
223 ' <Shortcut Id="startmenuManPDF_$(lang)" Directory="ProgramMenuDir" Name="M_$(lang)" LongName="$$(loc.StartMenu_UserManual) ($(VBOX_BRAND_$(lang)_LANG_NAME))" WorkingDirectory="INSTALLDIR"/>' \
224 ' </File>')
225else
226 $(APPEND) $@ ' <File Id="userManPDF" Name="Manual.pdf" LongName="UserManual.pdf" DiskId="1" Vital="yes" Source="$(PATH_BIN)/UserManual.pdf">'
227 $(APPEND) $@ ' <Shortcut Id="startmenuManPDF_en_US" Directory="ProgramMenuDir" Name="M_en_US" LongName="$$(loc.StartMenu_UserManual) (English)" WorkingDirectory="INSTALLDIR"/>'
228 $(APPEND) $@ ' </File>'
229 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
230 ' <File Id="userManPDF_$(lang)" Name="Mn_$(lang).pdf" LongName="UserManual_$(lang).pdf" DiskId="1" Vital="yes" Source="$(PATH_BIN)/UserManual_$(lang).pdf">' \
231 ' <Shortcut Id="startmenuManPDF_$(lang)" Directory="ProgramMenuDir" Name="M_$(lang)" LongName="$$(loc.StartMenu_UserManual) ($(VBOX_BRAND_$(lang)_LANG_NAME))" WorkingDirectory="INSTALLDIR"/>' \
232 ' </File>')
233endif
234 $(APPEND) $@ '</Include>'
235
236$(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi: $(MAKEFILE_CURRENT) | $$(dir $$@)
237 $(call MSG_GENERATE,,$@,$<)
238 $(APPEND) -t $@ '<?xml version="1.0" ?>'
239 $(APPEND) $@ '<Include>'
240ifdef VBOX_WITH_COMBINED_PACKAGE
241 $(APPEND) $@ ' <File Id="License_en_US.rtf" Name="Li_en_US.rtf" LongName="License_en_US.rtf" DiskId="2" Vital="yes" Source="$(VBOX_BRAND_LICENSE_RTF)">'
242 $(APPEND) $@ ' <Shortcut Id="startmenuLicRTF_en_US" Directory="ProgramMenuDir" Name="L_en_US" LongName="$$(loc.StartMenu_License) (English)" WorkingDirectory="INSTALLDIR"/>'
243 $(APPEND) $@ ' </File>'
244 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
245 ' <File Id="License_$(lang).rtf" Name="Li_$(lang).rtf" LongName="License_$(lang).rtf" DiskId="2" Vital="yes" Source="$(VBOX_BRAND_$(lang)_LICENSE_RTF)">' \
246 ' <Shortcut Id="startmenuLicRTF_$(lang)" Directory="ProgramMenuDir" Name="L_$(lang)" LongName="$$(loc.StartMenu_License) ($(VBOX_BRAND_$(lang)_LANG_NAME))" WorkingDirectory="INSTALLDIR"/>' \
247 ' </File>')
248else
249 $(APPEND) $@ ' <File Id="licenseRTF_en_US" Name="Li_en_US.rtf" LongName="License_en_US.rtf" DiskId="1" Vital="yes" Source="$(VBOX_BRAND_LICENSE_RTF)">'
250 $(APPEND) $@ ' <Shortcut Id="startmenuLicRTF_en_US" Directory="ProgramMenuDir" Name="L_en_US" LongName="$$(loc.StartMenu_License) (English)" WorkingDirectory="INSTALLDIR"/>'
251 $(APPEND) $@ ' </File>'
252 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
253 ' <File Id="licenseRTF_$(lang)" Name="Li_$(lang).rtf" LongName="License_$(lang).rtf" DiskId="1" Vital="yes" Source="$(VBOX_BRAND_$(lang)_LICENSE_RTF)">' \
254 ' <Shortcut Id="startmenuLicRTF_$(lang)" Directory="ProgramMenuDir" Name="L_$(lang)" LongName="$$(loc.StartMenu_License) ($(VBOX_BRAND_$(lang)_LANG_NAME))" WorkingDirectory="INSTALLDIR"/>' \
255 ' </File>')
256endif
257 $(APPEND) $@ '</Include>'
258
259
260#
261# .MSI link (all languages).
262#
263# Note: This will clean up any previous .msi to prevent dep build boxes from
264# filling up with old files.
265#
266define def_vbox_link_msi
267$(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_$(lang).msi: \
268 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_$(lang).wixobj \
269 $(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl \
270 $(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl \
271 $(PATH_BIN)/VBoxInstallHelper.dll \
272 $(MAKEFILE_CURRENT) \
273 | $$$$(dir $$$$@)
274 $$(call MSG_L1,Linking installer $$@)
275 $(QUIET)$(RM) -f $$(wildcard $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_BASE)-r*_$(lang).msi)
276 $(VBOX_PATH_WIX)/light.exe -nologo \
277 -loc $(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl \
278 -loc $(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl \
279 -out $$@ \
280 $$< \
281 $(VBOX_PATH_WIX)/wixca.wixlib \
282 $(VBOX_PATH_DIFX)/DIFxApp.wixlib
283 $(RM) -f $(VBOX_WIN_INST_OUT_DIR)/Languages/$(lang).mst
284 $(call VBOX_SIGN_FILE_FN,$$@)
285endef
286
287$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), $(eval $(def_vbox_link_msi)))
288
289
290#
291# Load and adjust the MSI compile step dependencies.
292#
293-include $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep
294
295# Filter out some files depending on build type and compiler.
296VBOX_MSI_DEPENDENCIES := $(filter-out wixca.dll, $(VBOX_MSI_DEPENDENCIES))
297ifeq ($(KBUILD_TYPE),release)
298 VBOX_MSI_DEPENDENCIES := $(filer-out $(PATH_OUT)/bin/VBoxDbg3.dll, $(VBOX_MSI_DEPENDENCIES))
299endif
300ifndef VBOX_SIGNING_MODE
301 VBOX_MSI_DEPENDENCIES := $(filer-out %.cat, $(VBOX_MSI_DEPENDENCIES))
302endif
303ifdef VBOX_USE_VCC80
304 VBOX_MSI_DEPENDENCIES := $(filter-out \
305 $(PATH_OUT)/bin/msvcrt.dll \
306 $(PATH_OUT)/bin/msvcr71.dll \
307 $(PATH_OUT)/bin/msvcp71.dll \
308 $(PATH_OUT)/bin/SDL_ttf.dll \
309 , $(VBOX_MSI_DEPENDENCIES))
310else
311 VBOX_MSI_DEPENDENCIES := $(filter-out \
312 $(PATH_OUT)/bin/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
313 $(PATH_OUT)/bin/Microsoft.VC80.CRT/msvcr80.dll \
314 $(PATH_OUT)/bin/Microsoft.VC80.CRT/msvcp80.dll \
315 $(PATH_OUT)/bin/Microsoft.VC80.CRT/msvcm80.dll \
316 , $(VBOX_MSI_DEPENDENCIES))
317endif
318ifneq ($(KBUILD_TARGET_ARCH),amd64)
319 VBOX_MSI_DEPENDENCIES := $(filter-out \
320 $(PATH_OUT)/bin/VBoxREM2.rel \
321 , $(VBOX_MSI_DEPENDENCIES))
322else
323 VBOX_MSI_DEPENDENCIES := $(filter-out \
324 $(PATH_OUT)/bin/VBoxREM32.dll \
325 $(PATH_OUT)/bin/VBoxREM64.dll \
326 , $(VBOX_MSI_DEPENDENCIES))
327endif
328
329# Add dependencies that makes sure necessary bits gets built since
330# VBOX_MSI_DEPENDENCIES will be zero the first time around.
331# For combined packages we always use the .ISO from the amd64 build.
332ifdef VBOX_WITH_COMBINED_PACKAGE
333 VBOX_MSI_DEPENDENCIES += \
334 $(if $(VBOX_WITH_ADDITIONS_PACKING),$(PATH_MULTIARCH_GUEST_ADDITIONS_ISO)/VBoxGuestAdditions.iso)
335else
336 VBOX_MSI_DEPENDENCIES += \
337 $(if $(VBOX_WITH_ADDITIONS_PACKING),$(VBOX_PATH_ADDITIONS)/VBoxGuestAdditions.iso)
338endif
339
340#
341# MSI compile.
342#
343define def_vbox_compile_wixobj
344$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_$(lang).wixobj: \
345 $(PATH_SUB_CURRENT)/VirtualBox.wxs \
346 $(PATH_SUB_CURRENT)/UserInterface.wxi \
347 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
348 $(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
349 $(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi \
350 $(VBOX_MSI_DEPENDENCIES) \
351 $(VBOX_VERSION_STAMP) \
352 | $$$$(dir $$$$@)
353 $(QUIET)$(RM) -f $@
354 $(REDIRECT) \
355 -E 'PATH_OUT=$(subst /,\\,$(PATH_OUT))' \
356 -E 'PATH_TARGET=$(subst /,\\,$(VBOX_WIN_INST_OUT_DIR))' \
357 -E 'PATH_ROOT=$(subst /,\\,$(PATH_ROOT))' \
358 -E 'PATH_MULTIARCH_GUEST_ADDITIONS_ISO=$(subst /,\\,$(PATH_MULTIARCH_GUEST_ADDITIONS_ISO))' \
359 -E 'VBOX_PATH_WIN_INST_SRC=$(subst /,\\,$(VBOX_PATH_WIN_INST_SRC))' \
360 -E 'VBOX_BRAND_WIN_INST_DLGBMP=$(subst /,\\,$(VBOX_BRAND_WIN_INST_DLGBMP))' \
361 -E 'VBOX_ADD_LANGUAGES=$(VBOX_INSTALLER_ADD_LANGUAGES)' \
362 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\\,$(VBOX_BRAND_LICENSE_RTF))' \
363 $(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
364 -E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(subst /,\\,$(VBOX_BRAND_$(subst en_US_,,$(lang)_)LICENSE_RTF))') \
365 -E 'VBOX_BUILD_NR_FOR_INST=$(VBOX_VERSION_BUILD)' \
366 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
367 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
368 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
369 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
370 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
371 -E 'VBOX_VERSION_MAJOR_INST=$(VBOX_VERSION_MAJOR)' \
372 -E 'VBOX_VERSION_MINOR_INST=$(VBOX_VERSION_MINOR)' \
373 -E 'VBOX_SIGNING_MODE=$(strip $(if $(VBOX_SIGNING_MODE),$(VBOX_SIGNING_MODE),none))' \
374 -E 'VBOX_GUI_USE_QGL=$(if $(VBOX_GUI_USE_QGL),yes,no)' \
375 -E 'VBOX_WITH_ADDITIONS_PACKING=$(if $(VBOX_WITH_ADDITIONS_PACKING),yes,no)' \
376 -E 'VBOX_WITH_COMBINED_PACKAGE=$(if $(VBOX_WITH_COMBINED_PACKAGE),yes,no)' \
377 -E 'VBOX_WITH_CROGL=$(if $(VBOX_WITH_CROGL),yes,no)' \
378 -E 'VBOX_WITH_DEBUGGER_GUI=$(if-expr defined(VBOX_WITH_DEBUGGER_GUI) && defined(VBOX_WITH_QTGUI),yes,no)' \
379 -E 'VBOX_WITH_DOCS_PACKING=$(if $(VBOX_WITH_DOCS_PACKING),yes,no)' \
380 -E 'VBOX_WITH_EFIFW_PACKING=$(if $(VBOX_WITH_EFIFW_PACKING),yes,no)' \
381 -E 'VBOX_WITH_GUEST_CONTROL=$(if $(VBOX_WITH_GUEST_CONTROL),yes,no)' \
382 -E 'VBOX_WITH_GUEST_PROPS=$(if $(VBOX_WITH_GUEST_PROPS),yes,no)' \
383 -E 'VBOX_WITH_NETFLT=$(if $(VBOX_WITH_NETFLT),yes,no)' \
384 -E 'VBOX_WITH_PYTHON=$(if $(VBOX_WITH_PYTHON),yes,no)' \
385 -E 'VBOX_WITH_QTGUI=$(if $(VBOX_WITH_QTGUI),yes,no)' \
386 -E 'VBOX_WITH_VIDEOHWACCEL=$(if $(VBOX_WITH_VIDEOHWACCEL),yes,no)' \
387 -E 'VBOX_WITH_VRDP=$(if $(VBOX_WITH_VRDP),yes,no)' \
388 -E 'VBOX_WITH_WEBSERVICES=$(if $(VBOX_WITH_WEBSERVICES),yes,no)' \
389 -E 'VBOX_WITH_SECURELABEL=$(if $(VBOX_WITH_SECURELABEL),yes,no)' \
390 -E 'VBOX_WITH_SERIALNUMBER_INSTALL=$(if $(VBOX_WITH_SERIALNUMBER_INSTALL),yes,no)' \
391 -E 'VBOX_WINDOWS_ICON_FILE=$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))' \
392 -E 'BUILD_TYPE=$(KBUILD_TYPE)' \
393 -E 'BUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
394 -E 'VBOX_USE_VCC80=$(if $(VBOX_USE_VCC80),yes,no)' \
395 -- \
396 $(VBOX_PATH_WIX)/candle.exe $(filter-out $(VBOX_VERSION_STAMP),$$<) -out $$@
397ifeq ($(lang),en_US)
398#
399# Generate dependency file, we share this between all the languages.
400#
401 $(APPEND) -t $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep 'VBOX_MSI_DEPENDENCIES = \'
402 $(SED) -f $(VBOX_PATH_WIN_INST_SRC)/dep.sed \
403 --append $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep \
404 $(VBOX_PATH_WIN_INST_SRC)/VirtualBox.wxs \
405 $(VBOX_PATH_WIN_INST_SRC)/UserInterface.wxi \
406 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi
407 $(APPEND) $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep ''
408endif
409endef
410
411$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
412 $(eval $(def_vbox_compile_wixobj)))
413
414#
415# VirtualBox Type Library definition.
416#
417$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi: \
418 $(PATH_SUB_CURRENT)/VirtualBox_TypeLib.xsl \
419 $(VBOX_XIDL_FILE) \
420 | $$(dir $$@)
421 $(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
422
423#
424# Construct the list of GUI translations.
425# ('-t' -- truncate file; '-n' -- new line between arguments)
426#
427include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
428$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi: $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk $(MAKEFILE_CURRENT) | $$(dir $$@)
429 $(APPEND) -t $@ '<?xml version="1.0" ?>'
430 $(APPEND) $@ '<Include>'
431 $(APPEND) -n $@ $(foreach lang,$(VBOX_APPROVED_GUI_LANGUAGES), \
432 ' <File Id="nlsqt${lang}" Name="qt_${lang}.qm" LongName="qt_${lang}.qm" DiskId="1" Vital="yes" src="$$(env.PATH_OUT)\bin\nls\qt_${lang}.qm" />' \
433 ' <File Id="nlsgui${lang}" Name="vb_${lang}.qm" LongName="VirtualBox_${lang}.qm" DiskId="1" Vital="yes" src="$$(env.PATH_OUT)\bin\nls\VirtualBox_${lang}.qm" />')
434 $(APPEND) $@ '</Include>'
435
436#
437# Edit the version stored in the registry.
438#
439$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi: $(PATH_SUB_CURRENT)/VBoxKey.wxi $(VBOX_VERSION_STAMP) | $$(dir $$@)
440 $(SED) -e 's/%VER%/$(VBOX_VERSION_STRING)/' --output $@ $<
441
442#
443# Build the multi-language version of the .MSI installer (final installer).
444# This is done by creating binary .MST diffs of all the language-specific installers
445# and then merging the diffs into the existing .MSI using tools from the MS Installer SDK.
446#
447# .MSI link (all languages).
448#
449# Note: Prereqs of the special .NOTPARALLEL target will be executed with parallel
450# make jobs temporarily disabled. This is a hack to work around what seems
451# to be a problem with the sharing mode set by one or more of the three
452# programs / scripts involved in this step.
453#
454define def_vbox_create_mst
455.NOTPARALLEL: $(VBOX_WIN_INST_OUT_DIR)/Languages/$(lang).mst
456$(VBOX_WIN_INST_OUT_DIR)/Languages/$(lang).mst: \
457 $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi \
458 $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_$(lang).msi \
459 | $$$$(dir $$$$@)
460 $(call MSG_L1,Integrating language ($(lang)))
461 $(REDIRECT) -C $$(@D) -- $(VBOX_PATH_MSITRAN) -g $$< $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_$(lang).msi $(lang).mst
462 $(REDIRECT) -C $$(@D) -- $(VBOX_PATH_MSIDB) -d $$< -r $(lang).mst
463 $(REDIRECT) -C $$(@D) -- wscript.exe $(VBOX_PATH_WISUBSTG) $$< $(lang).mst $(lang_id)
464endef
465
466$(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES), \
467 $(eval local lang_id := $(VBOX_BRAND_$(lang)_LANG_ID)) \
468 $(eval $(def_vbox_create_mst)))
469
470#
471# Create all xxx_<Lang>.msi installers and prepare the final xxx_MultiLang.msi installer.
472#
473## @todo this rule must not modify $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi but a copy of it. def_vbox_compile_wixobj is
474# where en_US.msi is created, it shouldn't be changed after that (if possible). Also, document the path length issue.
475VBOX_INS_PROD_ARCH.amd64 = x64
476VBOX_INS_PROD_ARCH.x86 = Intel
477VBOX_INS_PROD_ARCH := $(VBOX_INS_PROD_ARCH.$(KBUILD_TARGET_ARCH))
478$(if $(VBOX_INS_PROD_ARCH),,$(error VBOX_INS_PROD_ARCH is empty!))
479VBOX_INS_PROD_LANG := 7="$(VBOX_INS_PROD_ARCH);1033
480$(foreach lang, $(VBOX_INSTALLER_ADD_LANGUAGES), $(eval VBOX_INS_PROD_LANG := $(VBOX_INS_PROD_LANG)$(COMMA)$(VBOX_BRAND_$(lang)_LANG_ID)))
481VBOX_INS_PROD_LANG := $(VBOX_INS_PROD_LANG)"
482
483$(PACKAGE_NAME_FINAL): \
484 $(VBOX_WIN_INST_OUT_DIR)/Files_Main.wxi \
485 $(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi \
486 $(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi \
487 $(foreach lang,$(VBOX_INSTALLER_LANGUAGES), $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_$(lang).msi) \
488 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_WIN_INST_OUT_DIR)/Languages/$(lang).mst) \
489 | $$(dir $$@)
490 $(QUIET)$(RM) -f $(wildcard $(PATH_BIN)/$(PACKAGE_BASE)-r*.msi)
491 $(REDIRECT) -C $(@D) -- \
492 wscript.exe $(VBOX_PATH_WISUMINFO) $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi $(VBOX_INS_PROD_LANG)
493 $(CP) -f $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi $@
494 $(call VBOX_SIGN_FILE_FN,$@)
495
496
497if defined(VBOX_WITH_COMBINED_PACKAGE) && "$(KBUILD_TARGET_ARCH)" == "x86"
498#
499# Make the multi-architecture installer by calling our stub builder
500# with both platform installers (x86 and amd64) + common cab. We only
501# need to do this once; so do it on x86 only.
502#
503$(PATH_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL): \
504 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
505 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.amd64)
506 $(call MSG_L1,Building Windows combined package)
507 $(call VBOX_SIGN_FILE_FN,$(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_MULTIARCH_COMMONCAB))
508 $(REDIRECT) -C $(@D) -- \
509 VBoxStubBld -out $@ \
510 -target-x86 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
511 -target-amd64 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.amd64) \
512 -target-all $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_MULTIARCH_COMMONCAB) \
513 -stub $(PATH_BIN)/VBoxStub.exe
514 $(call VBOX_SIGN_FILE_FN,$@)
515endif
516
517
518#
519# Make the bundle installer (for retail ISOs) (zip-file).
520#
521$(VBOX_PATH_PACK_BUNDLE_ZIP): \
522 $(PACKAGE_NAME_FINAL) \
523 $(if-expr "$(KBUILD_TARGET_ARCH)" == "x86", \
524 $(PATH_BIN)/VBoxBundleMachine.exe \
525 $(if $(VBOX_BRAND_WIN_AS_MENU), $(PATH_BIN)/AutoStartMenu.exe) \
526 $(if $(VBOX_WITH_COMBINED_PACKAGE), $(PATH_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL)),)
527 $(RM) -Rf -- $(VBOX_PATH_PACK_BUNDLE_TMP)/
528 $(MKDIR) -p $(VBOX_PATH_PACK_BUNDLE_TMP)/
529ifndef VBOX_WITH_COMBINED_PACKAGE
530 $(CP) $(PACKAGE_NAME_FINAL) $(VBOX_PATH_PACK_BUNDLE_TMP)/$(VBOX_BRAND_WIN_INST_NAME.$(KBUILD_TARGET_ARCH))
531endif
532ifeq ($(KBUILD_TARGET_ARCH),x86)
533 ifdef VBOX_WITH_COMBINED_PACKAGE
534 $(CP) $(PATH_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL) $(VBOX_PATH_PACK_BUNDLE_TMP)/$(PACKAGE_NAME_MULTIARCH_FINAL)
535 endif
536 $(CP) $(PATH_BIN)/VBoxBundleMachine.exe $(VBOX_PATH_PACK_BUNDLE_TMP)/
537 $(CP) $(PATH_BIN)/AutoStartMenu.exe $(VBOX_PATH_PACK_BUNDLE_TMP)/
538 ifdef VBOX_BRAND_WIN_AS_MENU
539 $(MKDIR) -p $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/Graphics/
540 $(CP) $(VBOX_BRAND_WIN_AS_CONTENT) $(VBOX_PATH_PACK_BUNDLE_TMP)/
541 $(CP) $(VBOX_BRAND_WIN_AS_MENU_CONTENT) $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/
542 $(CP) $(VBOX_BRAND_WIN_AS_MENU_CONTENT_GFX) $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/Graphics/
543 ifdef VBOX_WITH_COMBINED_PACKAGE
544 $(SED) -e 's/VBOXEXE/$(PACKAGE_NAME_MULTIARCH_FINAL)/g' \
545 --output $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/index.html \
546 $(VBOX_BRAND_WIN_AS_MENU)/index_combined.html
547 else
548 $(SED) -e 's/VBOX32EXE/$(VBOX_BRAND_WIN_INST_NAME.x86)/g' \
549 -e 's/VBOX64EXE/$(VBOX_BRAND_WIN_INST_NAME.amd64)/g' \
550 --output $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/index.html \
551 $(VBOX_BRAND_WIN_AS_MENU)/index.html
552 endif
553 endif
554endif
555ifeq ($(KBUILD_TARGET_ARCH),amd64)
556 ifndef VBOX_WITH_COMBINED_PACKAGE
557 # Only needed if *not* combined package -- otherwise the 64-bit build
558 # has nothing to do here since the one and only amd64 .MSI file is already
559 # included in the x86 combined package.
560 $(REDIRECT) -C $(VBOX_PATH_PACK_BUNDLE_TMP) -- $(ZIP) -9r $@ .
561 endif
562else
563 # Do a bundle .zip in every case on x86. On a combined package this also
564 # will include the amd64 installer we left out in the block above (see comment).
565 $(REDIRECT) -C $(VBOX_PATH_PACK_BUNDLE_TMP) -- $(ZIP) -9r $@ .
566endif
567
568include $(KBUILD_PATH)/subfooter.kmk
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