Bug 1372521 - Support multi-line stub installer footer text. r?rstrong draft
authorMatt Howell <mhowell@mozilla.com>
Tue, 13 Jun 2017 13:47:59 -0700
changeset 593519 66aba0cd44b3654eba8085eec81d90e92bd9289d
parent 593303 a8f8e440d627d686fa8898483aa9c5da928a8fa4
child 633143 8df7a54333e42363f24414c772f7251815a2c217
push id63730
push usermhowell@mozilla.com
push dateTue, 13 Jun 2017 20:49:29 +0000
reviewersrstrong
bugs1372521
milestone56.0a1
Bug 1372521 - Support multi-line stub installer footer text. r?rstrong MozReview-Commit-ID: CVFRg2y3ruo
browser/installer/windows/nsis/defines.nsi.in
browser/installer/windows/nsis/stub.nsi
--- a/browser/installer/windows/nsis/defines.nsi.in
+++ b/browser/installer/windows/nsis/defines.nsi.in
@@ -123,11 +123,12 @@ VIAddVersionKey "ProductVersion"  "${App
 # non-default DPI settings
 !define OPTIONS_ITEM_EDGE_DU 90u
 !define OPTIONS_ITEM_WIDTH_DU 356u
 !define OPTIONS_SUBITEM_EDGE_DU 119u
 !define OPTIONS_SUBITEM_WIDTH_DU 327u
 !define NOW_INSTALLING_TOP_DU 70u
 !define INSTALL_BLURB_TOP_DU 137u
 !define INSTALL_FOOTER_TOP_DU -48u
+!define INSTALL_FOOTER_WIDTH_DU 300u
 !define PROGRESS_BAR_TOP_DU 112u
 !define APPNAME_BMP_EDGE_DU 19u
 !define APPNAME_BMP_TOP_DU 12u
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -826,19 +826,27 @@ Function createInstall
 
   ${NSD_CreateLabelCenter} 0% ${INSTALL_BLURB_TOP_DU} 100% 60u "$(STUB_BLURB1)"
   Pop $LabelBlurb
   SendMessage $LabelBlurb ${WM_SETFONT} $FontBlurb 0
   SetCtlColors $LabelBlurb ${INSTALL_BLURB_TEXT_COLOR} transparent
 
   StrCpy $CurrentBlurbIdx "0"
 
+  ; In some locales, the footer message may be too long to fit on one line.
+  ; Figure out how much height it needs and give it that much.
+  ${GetTextExtent} "$(STUB_BLURB_FOOTER)" $FontFooter $R1 $R2
+  StrCpy $1 0
+  ${While} $R1 > 0
+    IntOp $1 $1 + $R2
+    IntOp $R1 $R1 - ${INSTALL_FOOTER_WIDTH_DU}
+  ${EndWhile}
   nsDialogs::CreateControl STATIC ${DEFAULT_STYLES}|${SS_NOTIFY}|${SS_RIGHT} \
-    ${WS_EX_TRANSPARENT} -433u ${INSTALL_FOOTER_TOP_DU} 400u 20u \
-    "$(STUB_BLURB_FOOTER)"
+    ${WS_EX_TRANSPARENT} -320u ${INSTALL_FOOTER_TOP_DU} \
+    ${INSTALL_FOOTER_WIDTH_DU} "$1u" "$(STUB_BLURB_FOOTER)"
   Pop $0
   SendMessage $0 ${WM_SETFONT} $FontFooter 0
   SetCtlColors $0 ${INSTALL_BLURB_TEXT_COLOR} transparent
 
   ${NSD_CreateProgressBar} 20% ${PROGRESS_BAR_TOP_DU} 60% 12u ""
   Pop $Progressbar
   ${NSD_AddStyle} $Progressbar ${PBS_MARQUEE}
   SendMessage $Progressbar ${PBM_SETMARQUEE} 1 \