Bug 481374 - "Simplify / automate the addition of the pre-release suffix string (e.g. Alpha 1, Beta 2, etc.) - Port bug 468197 to TB" [r=Standard8,a=dmose (over irc)]
authorPhilippe M. Chiasson [Mozilla Messaging] <gozer@mozillamessaging.com>
Fri, 10 Jul 2009 19:37:03 +0100
changeset 3052 5037fd3fea1896db2cdb8e75c485c848a40bc883
parent 3051 8d44f1f7427e16bc87434150bac4a03557e4eb12
child 3053 291cbe3374b966af0f87972337db7f9800fbb87c
push idunknown
push userunknown
push dateunknown
reviewersStandard8, dmose
bugs481374, 468197
Bug 481374 - "Simplify / automate the addition of the pre-release suffix string (e.g. Alpha 1, Beta 2, etc.) - Port bug 468197 to TB" [r=Standard8,a=dmose (over irc)]
config/autoconf.mk.in
configure.in
mail/base/Makefile.in
mail/base/content/messageWindow.xul
mail/base/content/messenger.xul
mail/branding/nightly/branding.nsi
mail/confvars.sh
mail/installer/windows/Makefile.in
mail/installer/windows/nsis/defines.nsi.in
other-licenses/branding/thunderbird/branding.nsi
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -49,16 +49,17 @@ MOZILLA_1_9_1_BRANCH = @MOZILLA_1_9_1_BR
 THUNDERBIRD_VERSION	= @THUNDERBIRD_VERSION@
 SUNBIRD_VERSION = @SUNBIRD_VERSION@
 SEAMONKEY_VERSION	= @SEAMONKEY_VERSION@
 
 MOZ_BUILD_APP = @MOZ_BUILD_APP@
 MOZ_APP_NAME	= @MOZ_APP_NAME@
 MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
 MOZ_APP_VERSION = @MOZ_APP_VERSION@
+MOZ_APP_VERSION_TXT = @MOZ_APP_VERSION_TXT@
 
 MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
 
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
 includedir	= @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 libdir		= @libdir@
--- a/configure.in
+++ b/configure.in
@@ -7349,16 +7349,17 @@ AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
 AC_SUBST(MOZ_TIMELINE)
 AC_SUBST(WINCE)
 AC_SUBST(WINCE_SDK_DIR)
 AC_SUBST(TARGET_DEVICE)
 
 AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
 AC_SUBST(MOZ_APP_VERSION)
+AC_SUBST(MOZ_APP_VERSION_TXT)
 AC_SUBST(FIREFOX_VERSION)
 AC_SUBST(THUNDERBIRD_VERSION)
 AC_SUBST(SUNBIRD_VERSION)
 AC_SUBST(SEAMONKEY_VERSION)
 
 AC_SUBST(MOZ_PKG_SPECIAL)
 
 AC_SUBST(MAIL_PKG_SHARED)
--- a/mail/base/Makefile.in
+++ b/mail/base/Makefile.in
@@ -39,17 +39,21 @@ DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 DIRS = modules
 
-DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION)
+PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/mozilla/config/printprereleasesuffix.py \
+                      $(shell cat $(MOZ_APP_VERSION_TXT) ))
+
+DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
+           -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
 
 ifneq (,$(BUILD_OFFICIAL)$(MOZILLA_OFFICIAL))
 DEFINES += -DOFFICIAL_BUILD=1
 endif
 
 ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT)))
 DEFINES += -DHAVE_SHELL_SERVICE=1
 endif
--- a/mail/base/content/messageWindow.xul
+++ b/mail/base/content/messageWindow.xul
@@ -1,8 +1,9 @@
+#filter substitution
 <?xml version="1.0"?>
 
 # ***** BEGIN LICENSE BLOCK *****
 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
 #
 # The contents of this file are subject to the Mozilla Public License Version
 # 1.1 (the "License"); you may not use this file except in compliance with
 # the License. You may obtain a copy of the License at
@@ -58,18 +59,18 @@
 #endif
 ]>
 
 <!--
   - This window displays a single message.
   -->
 <window id="messengerWindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        title="&titledefault.label;"
-        titlemodifier="&titledefault.label;"
+        title="&titledefault.label;@PRE_RELEASE_SUFFIX@"
+        titlemodifier="&titledefault.label;@PRE_RELEASE_SUFFIX@"
         titlemenuseparator="&titleSeparator.label;"
         onload="OnLoadMessageWindow()"
         onunload="OnUnloadMessageWindow()"
         width="750"
         height="500"
         persist="width height screenX screenY sizemode"
         windowtype="mail:messageWindow">
 
--- a/mail/base/content/messenger.xul
+++ b/mail/base/content/messenger.xul
@@ -1,8 +1,9 @@
+#filter substitution
 <?xml version="1.0"?>
 
 # ***** BEGIN LICENSE BLOCK *****
 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
 #
 # The contents of this file are subject to the Mozilla Public License Version
 # 1.1 (the "License"); you may not use this file except in compliance with
 # the License. You may obtain a copy of the License at
@@ -59,18 +60,18 @@
 ]>
 
 <!--
   - The 'what you think of when you think of thunderbird' window;
   -  3-pane view inside of tabs.
   -->
 <window id="messengerWindow"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        title="&titledefault.label;"
-        titlemodifier="&titledefault.label;"
+        title="&titledefault.label;@PRE_RELEASE_SUFFIX@"
+        titlemodifier="&titledefault.label;@PRE_RELEASE_SUFFIX@"
         titlemenuseparator="&titleSeparator.label;"
         onload="OnLoadMessenger()"
         onunload="OnUnloadMessenger()"
         screenX="10" screenY="10"
         persist="width height screenX screenY sizemode"
         windowtype="mail:3pane">
 
 <stringbundleset id="stringbundleset">
--- a/mail/branding/nightly/branding.nsi
+++ b/mail/branding/nightly/branding.nsi
@@ -31,24 +31,16 @@
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 # NSIS defines for nightly builds.
 # The release build branding.nsi is located in other-license/branding/thunderbird/
-!define BrandShortName        "Shredder"
+
 # BrandFullNameInternal is used for some registry and file system values
 # instead of BrandFullName and typically should not be modified.
 !define BrandFullNameInternal "Shredder"
 !define CompanyName           "mozilla.org"
 !define URLInfoAbout          "http://www.mozilla.org/"
 !define URLUpdateInfo         "http://www.mozilla.org/products/thunderbird/"
 !define SurveyURL             "https://survey.mozilla.com/1/Mozilla%20Thunderbird/${AppVersion}/${AB_CD}/exit.html"
-
-# Everything below this line may be modified for Alpha / Beta releases.
-!define BrandFullName         "Shredder"
-
-# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation
-# directory in the registry and using that as the default. This prevents
-# Beta releases built with official branding from finding an existing install
-# of an official release and defaulting to its installation directory.
--- a/mail/confvars.sh
+++ b/mail/confvars.sh
@@ -50,15 +50,19 @@ if [ "$COMM_BUILD" ]; then
 fi
 MOZ_STATIC_MAIL_BUILD=1
 MOZ_COMPOSER=1
 MOZ_SAFE_BROWSING=1
 
 # Needed for the mozilla-central build side of the system.
 # Can be dropped when we branch MOZILLA_1_9_1_BRANCH
 MOZILLA_BRANCH_VERSION=`echo ${MOZILLA_VERSION} | sed -e 's/\(^[0-9]\.[0-9]\.[0-9]\).*/\1/;'`
+
 if test "$MOZILLA_BRANCH_VERSION" = "1.9.1"; then
-  MOZ_APP_VERSION=`cat $topsrcdir/$MOZ_BUILD_APP/config/version-191.txt`
+  MOZ_APP_VERSION_TXT=$topsrcdir/$MOZ_BUILD_APP/config/version-191.txt
 else
-  MOZ_APP_VERSION=`cat $topsrcdir/$MOZ_BUILD_APP/config/version.txt`
+  MOZ_APP_VERSION_TXT=$topsrcdir/$MOZ_BUILD_APP/config/version.txt
 fi
+
+MOZ_APP_VERSION=`cat $MOZ_APP_VERSION_TXT`
+
 THUNDERBIRD_VERSION=$MOZ_APP_VERSION
 MOZ_NO_XPCOM_OBSOLETE=1
--- a/mail/installer/windows/Makefile.in
+++ b/mail/installer/windows/Makefile.in
@@ -43,16 +43,21 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
 
 CONFIG_DIR = instgen
 SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/thunderbird/7zSD.sfx
 
+APP_VERSION := $(shell cat $(MOZ_APP_VERSION_TXT))
+DEFINES += -DAPP_VERSION=$(APP_VERSION)
+PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/mozilla/config/printprereleasesuffix.py $(APP_VERSION))
+DEFINES += -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
+
 PP_LOCALIZED_FILES = \
 	packages-static \
 	$(NULL)
 
 # All script and locale files used by the Unicode version of NSIS need to be
 # converted from UTF-8 to UTF-16LE
 INSTALLER_FILES_CONV = \
 	nsis/installer.nsi \
@@ -73,19 +78,17 @@ BRANDING_FILES_CONV = \
 BRANDING_FILES = \
 	wizHeader.bmp \
 	wizHeaderRTL.bmp \
 	wizWatermark.bmp \
 	$(NULL)
 
 DEFINES += \
 	-DAB_CD=$(AB_CD) \
-	-DPKG_BASENAME=$(PKG_BASENAME) \
-	-DPKG_INST_BASENAME=$(PKG_INST_BASENAME) \
-	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
+	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
 	-DMOZ_APP_DISPLAYNAME=${MOZ_APP_DISPLAYNAME} \
 	-DMOZILLA_VERSION=${MOZILLA_VERSION} \
 	$(NULL)
 
 include $(topsrcdir)/config/config.mk
 
 installer::
 	$(MAKE) -C .. installer-stage
--- a/mail/installer/windows/nsis/defines.nsi.in
+++ b/mail/installer/windows/nsis/defines.nsi.in
@@ -1,17 +1,27 @@
 #filter substitution
-!define AppVersion            "@MOZ_APP_VERSION@"
+!define AppVersion            "@APP_VERSION@"
 !define GREVersion            @MOZILLA_VERSION@
 !define AB_CD                 "@AB_CD@"
-!define FileInstallerEXE      "@PKG_INST_BASENAME@.exe"
-!define FileInstallerMSI      "@PKG_INST_BASENAME@.msi"
-!define FileInstallerNETRoot  "@PKG_BASENAME@.net-installer"
 
-!define FileMainEXE           "thunderbird.exe"
+!define FileMainEXE           "@MOZ_APP_NAME@.exe"
 !define WindowClass           "ThunderbirdMessageWindow"
 
 !define AppRegNameMail        "Thunderbird"
 !define AppRegNameNews        "Thunderbird (News)"
 
 !define ClientsRegName        "Mozilla Thunderbird"
 
 !define MinSupportedVer       "Microsoft Windows 2000"
+
+!define BrandShortName        "@MOZ_APP_DISPLAYNAME@"
+!define PreReleaseSuffix      "@PRE_RELEASE_SUFFIX@"
+!define BrandFullName         "${BrandFullNameInternal}${PreReleaseSuffix}"
+
+# NO_INSTDIR_FROM_REG is defined for pre-releases which have a PreReleaseSuffix
+# (e.g. Alpha X, Beta X, etc.) to prevent finding a non-default installation
+# directory in the registry and using that as the default. This prevents
+# Beta releases built with official branding from finding an existing install
+# of an official release and defaulting to its installation directory.
+!if "@PRE_RELEASE_SUFFIX@" != ""
+!define NO_INSTDIR_FROM_REG
+!endif
--- a/other-licenses/branding/thunderbird/branding.nsi
+++ b/other-licenses/branding/thunderbird/branding.nsi
@@ -31,24 +31,16 @@
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 # NSIS defines for official release builds.
 # The nightly build branding.nsi is located in mail/installer/windows/nsis
-!define BrandShortName        "Thunderbird"
+
 # BrandFullNameInternal is used for some registry and file system values
 # instead of BrandFullName and typically should not be modified.
 !define BrandFullNameInternal "Mozilla Thunderbird"
 !define CompanyName           "Mozilla Messaging"
 !define URLInfoAbout          "http://www.mozillamessaging.com/${AB_CD}/"
 !define URLUpdateInfo         "http://www.mozillamessaging.com/${AB_CD}/thunderbird/"
 !define SurveyURL             "https://survey.mozilla.com/1/Mozilla%20Thunderbird/${AppVersion}/${AB_CD}/exit.html"
-
-# Everything below this line may be modified for Alpha / Beta releases.
-!define BrandFullName         "Mozilla Thunderbird"
-
-# Add !define NO_INSTDIR_FROM_REG to prevent finding a non-default installation
-# directory in the registry and using that as the default. This prevents
-# Beta releases built with official branding from finding an existing install
-# of an official release and defaulting to its installation directory.