bug 313956: expand installer .exe contents to make complete mar. r=ted.
authorRail Aliiev <rail@mozilla.com>
Tue, 29 Mar 2011 15:04:02 -0400
changeset 64168 f4da8c0c48d9910b9ed546d389ebb20dd4230617
parent 64167 3eb5a574319fdbf02e2672bd82c5ffb714c7f78c
child 64169 b6eb0a3037ec716081f41af058532b3c12e939f3
child 64574 7fa779c9592f459dda00e9547f4d70ca4fccfb5b
push idunknown
push userunknown
push dateunknown
reviewersted
bugs313956
milestone2.2a1pre
bug 313956: expand installer .exe contents to make complete mar. r=ted.
toolkit/locales/l10n.mk
toolkit/mozapps/installer/packager.mk
tools/update-packaging/Makefile.in
--- a/toolkit/locales/l10n.mk
+++ b/toolkit/locales/l10n.mk
@@ -58,18 +58,16 @@
 #   language pack and zip package.
 #   Other targets like windows installers might be listed, too, and should
 #   be defined in the including makefile.
 # The including makefile should provide values for the variables
 #   MOZ_APP_VERSION and MOZ_LANGPACK_EID.
 
 
 run_for_effects := $(shell if test ! -d $(DIST); then $(NSINSTALL) -D $(DIST); fi)
-_ABS_DIST := $(shell cd $(DIST) && pwd)
-
 
 # This makefile uses variable overrides from the libs-% target to
 # build non-default locales to non-default dist/ locations. Be aware!
 
 AB = $(firstword $(subst -, ,$(AB_CD)))
 
 core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
 
@@ -125,16 +123,24 @@ endif
 
 unpack: $(STAGEDIST)
 	@echo done unpacking
 
 # The path to the object dir for the mozilla-central build system,
 # may be overridden if necessary.
 MOZDEPTH ?= $(DEPTH)
 
+ifdef MOZ_MAKE_COMPLETE_MAR
+MAKE_COMPLETE_MAR = 1
+ifeq ($(OS_ARCH), WINNT)
+ifneq ($(MOZ_PKG_FORMAT), SFX7Z)
+MAKE_COMPLETE_MAR =
+endif
+endif
+endif
 repackage-zip: UNPACKAGE="$(ZIP_IN)"
 repackage-zip:  libs-$(AB_CD)
 # Adjust jar logs with the new locale (can't use sed -i because of bug 373784)
 	-$(PERL) -pi -e "s/en-US/$(AB_CD)/g" $(_ABS_DIST)/jarlog/*.jar.log
 # call a hook for apps to put their uninstall helper.exe into the package
 	$(UNINSTALLER_PACKAGE_HOOK)
 # copy xpi-stage over, but not install.rdf and chrome.manifest,
 # those are just for language packs
@@ -148,17 +154,17 @@ endif
 endif
 	$(NSINSTALL) -D $(DIST)/l10n-stage/$(PKG_PATH)
 	cd $(DIST)/l10n-stage; \
 	  $(MAKE_PACKAGE)
 ifeq (WINCE,$(OS_ARCH))
 	cd $(DIST)/l10n-stage; \
 	  $(MAKE_CAB)
 endif
-ifdef MOZ_MAKE_COMPLETE_MAR
+ifdef MAKE_COMPLETE_MAR
 	$(MAKE) -C $(MOZDEPTH)/tools/update-packaging full-update AB_CD=$(AB_CD) \
 	  MOZ_PKG_PRETTYNAMES=$(MOZ_PKG_PRETTYNAMES) \
 	  PACKAGE_BASE_DIR="$(_ABS_DIST)/l10n-stage" \
 	  DIST="$(_ABS_DIST)"
 endif
 # packaging done, undo l10n stuff
 ifneq (en,$(AB))
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -143,17 +143,17 @@ ifeq ($(MOZ_PKG_FORMAT),SFX7Z)
 PKG_SUFFIX	= .exe
 INNER_MAKE_PACKAGE	= rm -f app.7z && \
   mv $(MOZ_PKG_DIR) core && \
   $(CYGWIN_WRAPPER) 7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d24 \
     -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 && \
   mv core $(MOZ_PKG_DIR) && \
   cat $(SFX_HEADER) app.7z > $(PACKAGE) && \
   chmod 0755 $(PACKAGE)
-INNER_UNMAKE_PACKAGE	= $(CYGWIN_WRAPPER) 7z x $(UNPACKAGE) && \
+INNER_UNMAKE_PACKAGE	= $(CYGWIN_WRAPPER) 7z x $(UNPACKAGE) core && \
   mv core $(MOZ_PKG_DIR)
 endif
 ifeq ($(MOZ_PKG_FORMAT),APK)
 
 # we have custom stuff for Android
 MOZ_OMNIJAR =
 
 JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
--- a/tools/update-packaging/Makefile.in
+++ b/tools/update-packaging/Makefile.in
@@ -39,18 +39,16 @@
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
-
 # input location for the build, usually $(DIST)
 # set this to $(DIST)/l10n-stage per override for L10n builds
 PACKAGE_BASE_DIR	= $(DIST)
 
 # Default output location for update archive
 STAGE_DIR	= $(DIST)/$(PKG_UPDATE_PATH)
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
@@ -67,25 +65,41 @@ else
 PACKAGE_DIR	= $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)
 endif
 
 MAR_BIN	= $(LIBXUL_DIST)/host/bin/mar$(HOST_BIN_SUFFIX)
 MBSDIFF_BIN	= $(LIBXUL_DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX)
 
 full-update:: complete-patch
 
+ifeq ($(OS_TARGET), WINNT)
+MOZ_PKG_FORMAT	:= SFX7Z
+UNPACKAGE	= "$(subst $(DIST),$(_ABS_DIST),$(INSTALLER_PACKAGE))"
+ifdef AB_CD
+ifdef MOZ_PKG_PRETTYNAMES
+UNPACKAGE	= "$(PACKAGE_BASE_DIR)/$(PACKAGE)"
+endif
+endif
+endif
+
 complete-patch::
+ifeq ($(OS_TARGET), WINNT)
+	test -f $(UNPACKAGE)
+	$(RM) -rf "$(PACKAGE_DIR)"
+	cd $(PACKAGE_BASE_DIR) && $(INNER_UNMAKE_PACKAGE)
+endif
 	mkdir -p $(STAGE_DIR)
 	MAR=$(MAR_BIN) \
 	  $(srcdir)/make_full_update.sh \
 	  "$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).complete.mar" \
 	  "$(PACKAGE_DIR)"
 
 partial-patch::
 	mkdir -p $(STAGE_DIR)
 	MAR=$(MAR_BIN) \
 	MBSDIFF=$(MBSDIFF_BIN) \
 	  $(srcdir)/make_incremental_update.sh \
 	  "$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar" \
 	  "$(SRC_BUILD)" \
 	  "$(DST_BUILD)"
 
 include $(topsrcdir)/config/rules.mk
+include $(topsrcdir)/toolkit/mozapps/installer/packager.mk