Index: installer/Makefile |
=================================================================== |
--- a/installer/Makefile |
+++ b/installer/Makefile |
@@ -1,133 +1,138 @@ |
-#---------------------------------- |
-# Makefile for Microsoft NMAKE |
-# |
-# Call with only the version parameter to set the default target to all installers. |
-# nmake VERSION=1.2.3 |
-# Call with a definition of the NMAKE variable ARCH on the command line |
-# nmake VERSION=1.2.3 ARCH=ia32 |
-# nmake VERSION=1.2.3 ARCH=x64 |
-# If an architecture is specified, the default target is constrained to it. |
-#---------------------------------- |
- |
-.SUFFIXES: .msi .wixobj .wxs |
- |
-Build_Dir_common = ..\build\ # |
-Build_Dir_ia32 = ..\build\ia32\ # comment prevents newline |
-Build_Dir_x64 = ..\build\x64\ # |
- |
-!ifndef Configuration |
-Configuration = Release |
-!endif |
- |
-!ifndef VERSION |
-VERSION = 99.9 |
-!endif |
- |
-#--------------------- |
-# Default Targets |
-# |
-# We change the default rule depending upon the ARCH (architecture) definition. |
-#--------------------- |
- |
-Installer_ia32 = $(Build_Dir_ia32)adblockplusie-$(VERSION)-en-us-ia32.msi |
-Installer_x64 = $(Build_Dir_x64)adblockplusie-$(VERSION)-en-us-x64.msi |
-Setup = $(Build_Dir_common)adblockplusie-$(VERSION).exe |
- |
-!ifndef ARCH |
-default: $(Installer_ia32) $(Installer_x64) |
-!elseif "$(ARCH)"=="ia32" |
-default: $(Installer_ia32) |
-!elseif "$(ARCH)"=="x64" |
-default: $(Installer_x64) |
-!else |
-!error Unknown variable ARCH=$(ARCH) |
-!endif |
- |
-default: |
- @echo Available targets |
- @echo - ia32 |
- @echo - x64 |
- @echo - setup |
- @echo - install-ia32 |
- @echo - install-x64 |
- |
-all: ia32 x64 setup |
- |
-ia32: $(Installer_ia32) |
- |
-x64: $(Installer_x64) |
- |
-setup: $(Setup) |
- |
-#--------------------- |
-# candle .wxs --> .wixobj |
-#--------------------- |
- |
-Candle = candle -nologo -dNoDefault -dVersion=$(VERSION) "-dConfiguration=$(Configuration)" $(CANDLE_FLAGS) $** -out $@ |
- |
-objects_common = $(Build_Dir_common)custom_WixUI_InstallDir.wixobj |
-$(objects_common): custom_WixUI_InstallDir.wxs |
- $(Candle) |
- |
-objects_ia32 = $(Build_Dir_ia32)adblockplusie-$(VERSION).wixobj |
-$(objects_ia32): adblockplusie.wxs |
- $(Candle) -arch x86 |
- |
-objects_x64 = $(Build_Dir_x64)adblockplusie-$(VERSION).wixobj |
-$(objects_x64): adblockplusie.wxs |
- $(Candle) -arch x64 |
- |
-object_setup = $(Build_Dir_common)setup-$(VERSION).wixobj |
-$(object_setup): setup.wxs |
- $(Candle) -ext WixBalExtension |
- |
-#--------------------- |
-# light .wixobj --> .msi |
-#--------------------- |
- |
-Light = light -notidy -nologo -cultures:en-us -ext WixUIExtension -out $@ |
- |
-$(Installer_ia32): $(objects_ia32) $(objects_common) "..\build\ia32\$(Configuration)\AdblockPlus.dll" "build\ia32\Debug\installer-ca.dll" |
- $(Light) $(objects_ia32) $(objects_common) -loc en-us.wxl -sval |
- |
-# TODO: Don't ignore errors here (fix install paths) |
-$(Installer_x64): $(objects_x64) $(objects_common) "..\build\ia32\$(Configuration)\AdblockPlus.dll" "..\build\x64\$(Configuration)\AdblockPlus.dll" |
- -$(Light) $(objects_x64) $(objects_common) -loc en-us.wxl |
- |
-#--------------------- |
-# light .wixobj --> .exe |
-#--------------------- |
- |
-$(Setup): $(object_setup) bootstrap-theme.xml bootstrap-theme.wxl |
- $(Light) $(object_setup) -ext WixBalExtension -loc bootstrap-theme.wxl |
- |
-#--------------------- |
-# msiexec .msi --> installed --> uninstalled |
-#--------------------- |
- |
-install-ia32: $(Installer_ia32) |
- call <<nmake_temporary.bat |
-pushd $(Build_Dir_ia32) |
-msiexec /i $(**F) /l*v install.log |
-popd |
-<< |
- |
-install-x64: $(Installer_x64) |
- call <<nmake_temporary.bat |
-pushd $(Build_Dir_x64) |
-msiexec /i $(**F) /l*v install.log |
-popd |
-<< |
- |
-uninstall: |
- msiexec /x {4f27c814-5ee0-4b25-b3ab-3ad565551918} |
- |
-install-setup: $(Setup) |
- $(Setup) -log ..\build\setup.log |
- |
-#--------------------- |
-# Miscellaneous |
-#--------------------- |
- |
-clean: |
- del $(objects_ia32) |
+#---------------------------------- |
+# Makefile for Microsoft NMAKE |
+# |
+# Argument: VERSION |
+# Version number to incorporate into the file names of targets |
+# Defaults to 99.9 if not specified. |
+# |
+# Target: ia32 |
+# Release version of the multilanguage, 32-bit MSI |
+# File name = adblockplusie-VERSION-multilanguage-ia32.msi |
+# Target: x64 |
+# Release version of the multilanguage, 64-bit MSI |
+# File name = adblockplusie-VERSION-multilanguage-x64.msi |
+# Target: setup |
+# Release version of the executable bundle of both of the above MSI |
+# File name = adblockplusie-VERSION.exe |
+#---------------------------------- |
+ |
+Build_Dir_ia32 = build\ia32\ # comment prevents newline |
+Build_Dir_x64 = build\x64\ # |
+Build_Dir_common = build\common\ # |
+ |
+!ifndef VERSION |
+VERSION = 99.9 |
+!endif |
+ |
+Installer_ia32_name = adblockplusie-$(VERSION)-multilanguage-ia32 |
+Installer_ia32_base = $(Build_Dir_ia32)$(Installer_ia32_name) |
+Installer_ia32_msi = $(Installer_ia32_base).msi |
+Installer_ia32_archive = $(Installer_ia32_base).7z |
+Installer_ia32_exe = $(Installer_ia32_base).exe |
+ |
+Installer_x64_name = adblockplusie-$(VERSION)-multilanguage-x64 |
+Installer_x64_base = $(Build_Dir_x64)$(Installer_x64_name) |
+Installer_x64_msi = $(Installer_x64_base).msi |
+Installer_x64_archive = $(Installer_x64_base).7z |
+Installer_x64_exe = $(Installer_x64_base).exe |
+ |
+Setup = $(Build_Dir_common)Release\adblockplusie-$(VERSION).exe |
+ |
+#--------------------- |
+# Top-Level Targets |
+#--------------------- |
+ |
+default: |
+ @echo Available targets |
+ @echo - ia32 |
+ @echo - x64 |
+ @echo - setup |
+ |
+ia32: $(Installer_ia32_msi) |
+ |
+x64: $(Installer_x64_msi) |
+ |
+setup: $(Setup) |
+ |
+ |
+#--------------------- |
+# MSI |
+# The real work happens in MSBuild. |
+# The output of MSBuild has a fixed name; we need a parametric one. |
+#--------------------- |
+ |
+MSBuild_Output_ia32 = $(Build_Dir_ia32)adblockplusie-FINAL-ia32.msi |
+MSBuild_Output_x64 = $(Build_Dir_x64)adblockplusie-FINAL-x64.msi |
+ |
+# |
+# NMAKE has no way of specifying that these MSBuild rules have their own |
+# dependencies and thus should be considered the moral equivalent of part of the |
+# Makefile. For -a (all) builds, this isn't a problem. For incremental builds, |
+# use the 'clean-*' targets below to delete the MSBuild outputs. This forces an |
+# invocation of MSBuild because its targets are absent. The last step of the |
+# MSBuild process is a file copy, so it's not expensive to clean and build. |
+# |
+$(Build_Dir_ia32)installer.sln $(Build_Dir_x64)installer.sln: |
+ createsolutions.bat |
+ |
+$(MSBuild_Output_ia32): $(Build_Dir_ia32)installer.sln |
+ msbuild /p:Configuration=Release $(Build_Dir_ia32)installer.sln |
+ |
+$(MSBuild_Output_x64): $(Build_Dir_x64)installer.sln |
+ msbuild /p:Configuration=Release $(Build_Dir_x64)installer.sln |
+ |
+$(Installer_ia32_msi): $(MSBuild_Output_ia32) |
+ copy $(MSBuild_Output_ia32) $(Installer_ia32_msi) |
+ |
+$(Installer_x64_msi): $(MSBuild_Output_x64) |
+ copy $(MSBuild_Output_x64) $(Installer_x64_msi) |
+ |
+ |
+clean-msi: clean-ia32 clean-x64 |
+ |
+clean-ia32: |
+ del $(MSBuild_Output_ia32) $(Installer_ia32_msi) |
+ |
+clean-x64: |
+ del $(MSBuild_Output_x64) $(Installer_x64_msi) |
+ |
+#--------------------- |
+# Bundle |
+#--------------------- |
+object_setup = $(Build_Dir_common)setup.wixobj |
+Source_Dir_setup = src\setup-exe\ # |
+setup_compile_sources = $(Source_Dir_setup)setup.wxs |
+setup_link_sources = $(Source_Dir_setup)bootstrap-theme.xml $(Source_Dir_setup)bootstrap-theme.wxl |
+ |
+$(object_setup): $(setup_compile_sources) |
+ candle -nologo -dVersion=$(VERSION) $(setup_compile_sources) -out $(object_setup) -ext WixBalExtension |
+ |
+$(Setup): $(Installer_ia32_msi) $(Installer_x64_msi) |
+$(Setup): $(object_setup) $(setup_link_sources) |
+ light -nologo -dVersion=$(VERSION) $(object_setup) -ext WixBalExtension -loc $(Source_Dir_setup)bootstrap-theme.wxl -out $(Setup) |
+ |
+#--------------------- |
+# msiexec .msi --> installed --> uninstalled |
+#--------------------- |
+ |
+uninstall: |
+ msiexec /x {4f27c814-5ee0-4b25-b3ab-3ad565551918} |
+ |
+install-setup: $(Setup) |
+ $(Setup) -log ..\build\setup.log |
+ |
+#--------------------- |
+# Self-extracting versions of the MSI |
+#--------------------- |
+ |
+# |
+# 7-Zip can't help but store directories (no command line switch to do otherwise). |
+# |
+$(Installer_ia32_exe): $(Installer_ia32_msi) $(Source_Dir_setup)self-extract-config-ia32.txt |
+ cd $(Build_Dir_ia32) & 7z a -t7z $(Installer_ia32_name).7z ..\..\$(MSBuild_Output_ia32) |
+ copy /b $(Source_Dir_setup)7zS.sfx + $(Source_Dir_setup)self-extract-config-ia32.txt + $(Installer_ia32_archive) $(Installer_ia32_exe) |
+ |
+$(Installer_x64_exe): $(Installer_x64_msi) $(Source_Dir_setup)self-extract-config-x64.txt |
+ cd $(Build_Dir_x64) & 7z a -t7z $(Installer_x64_name).7z ..\..\$(MSBuild_Output_x64) |
+ copy /b $(Source_Dir_setup)7zS.sfx + $(Source_Dir_setup)self-extract-config-x64.txt + $(Installer_x64_archive) $(Installer_x64_exe) |
+ |