VirtualBox

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

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

Windows host installer: Now using VBoxRes.dll for own icons of ".vbox", ".vbox-extpack", ".ova" and ".ovf" file extensions.

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