Remove the 'Back' button from the stub installer options page - Bug 799172 - 'Back' after 'Options' just returns to the first dialog. r=bbondy, ui-r=shorlander - Windows stub installer only which is only built when building the nightly - DONTBUILD
authorRobert Strong <robert.bugzilla@gmail.com>
Tue, 30 Apr 2013 14:15:49 -0700
changeset 141344 89063545e4b3c30a38e37e20f7ae23347a79c3d9
parent 141343 320d1b78f9630b201012fa9871ba6e7af5c70c9f
child 141345 9f86b0aa679e2acc961eede5047e9eaef3b89058
child 141346 04c51ac7fa21208b01983d372cd3a355f88ca0eb
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy, shorlander
bugs799172
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Remove the 'Back' button from the stub installer options page - Bug 799172 - 'Back' after 'Options' just returns to the first dialog. r=bbondy, ui-r=shorlander - Windows stub installer only which is only built when building the nightly - DONTBUILD
browser/installer/windows/nsis/stub.nsi
browser/locales/en-US/installer/nsisstrings.properties
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -50,17 +50,16 @@ Var HWndBitmapBlurb3
 Var FontNormal
 Var FontItalic
 Var FontBlurb
 
 Var WasOptionsButtonClicked
 Var CanWriteToInstallDir
 Var HasRequiredSpaceAvailable
 Var IsDownloadFinished
-Var Initialized
 Var DownloadSizeBytes
 Var HalfOfDownload
 Var DownloadReset
 Var ExistingTopDir
 Var SpaceAvailableBytes
 Var InitialInstallDir
 Var HandleDownload
 Var CanSetAsDefault
@@ -378,16 +377,17 @@ Function .onInit
     SetShellVarContext current ; Set SHCTX to HKCU
     ${GetSingleInstallPath} "Software\Mozilla\${BrandFullNameInternal}" $R9
   ${EndIf}
 
   ${If} "$R9" != "false"
     StrCpy $INSTDIR "$R9"
   ${EndIf}
 
+  ; Used to determine if the default installation directory was used.
   StrCpy $InitialInstallDir "$INSTDIR"
 
   ClearErrors
   WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" \
                    "Write Test"
 
   ${If} ${Errors}
   ${OrIf} ${AtLeastWin8}
@@ -404,16 +404,26 @@ Function .onInit
   StrCpy $OptionsPhaseSeconds "0"
   StrCpy $EndPreInstallPhaseTickCount "0"
   StrCpy $EndInstallPhaseTickCount "0"
   StrCpy $IntroPageShownCount "0"
   StrCpy $OptionsPageShownCount "0"
   StrCpy $InitialInstallRequirementsCode ""
   StrCpy $IsDownloadFinished ""
   StrCpy $FirefoxLaunchCode "0"
+  StrCpy $CheckboxShortcutOnBar "1"
+  StrCpy $CheckboxShortcutInStartMenu "1"
+  StrCpy $CheckboxShortcutOnDesktop "1"
+  StrCpy $CheckboxSendPing "1"
+!ifdef MOZ_MAINTENANCE_SERVICE
+  StrCpy $CheckboxInstallMaintSvc "1"
+!else
+  StrCpy $CheckboxInstallMaintSvc "0"
+!endif
+  StrCpy $WasOptionsButtonClicked "0"
 
   CreateFont $FontBlurb "$(^Font)" "12" "500"
   CreateFont $FontNormal "$(^Font)" "11" "500"
   CreateFont $FontItalic "$(^Font)" "11" "500" /ITALIC
 
   InitPluginsDir
   File /oname=$PLUGINSDIR\bgintro.bmp "bgintro.bmp"
   File /oname=$PLUGINSDIR\bgplain.bmp "bgplain.bmp"
@@ -637,29 +647,16 @@ Function SendPing
     Call RelativeGotoPage
   ${EndIf}
 FunctionEnd
 
 Function createDummy
 FunctionEnd
 
 Function createIntro
-  ; If Back is clicked on the options page reset variables
-  StrCpy $INSTDIR "$InitialInstallDir"
-  StrCpy $CheckboxShortcutOnBar "1"
-  StrCpy $CheckboxShortcutInStartMenu "1"
-  StrCpy $CheckboxShortcutOnDesktop "1"
-  StrCpy $CheckboxSendPing "1"
-!ifdef MOZ_MAINTENANCE_SERVICE
-  StrCpy $CheckboxInstallMaintSvc "1"
-!else
-  StrCpy $CheckboxInstallMaintSvc "0"
-!endif
-  StrCpy $WasOptionsButtonClicked "0"
-
   nsDialogs::Create /NOUNLOAD 1018
   Pop $Dialog
 
   GetFunctionAddress $0 OnBack
   nsDialogs::OnBack /NOUNLOAD $0
 
 !ifdef ${AB_CD}_rtl
   ; For RTL align the text with the top of the F in the Firefox bitmap
@@ -668,43 +665,33 @@ Function createIntro
   ; For LTR align the text with the top of the x in the Firefox bitmap
   StrCpy $0 "${INTRO_BLURB_LTR_TOP_DU}"
 !endif
   ${NSD_CreateLabel} ${INTRO_BLURB_EDGE_DU} $0 ${INTRO_BLURB_WIDTH_DU} 76u "${INTRO_BLURB}"
   Pop $0
   SendMessage $0 ${WM_SETFONT} $FontBlurb 0
   SetCtlColors $0 ${INTRO_BLURB_TEXT_COLOR} transparent
 
-  ${If} "$Initialized" == "true"
-    ; When the user clicked back from the options page.
-    System::Call "kernel32::GetTickCount()l .s"
-    Pop $0
-    ${GetSecondsElapsed} "$StartOptionsPhaseTickCount" "$0" $1
-    ; This is added to the previous value of $OptionsPhaseSeconds because the
-    ; options page can be displayed multiple times.
-    IntOp $OptionsPhaseSeconds $OptionsPhaseSeconds + $1
+  SetCtlColors $HWNDPARENT ${FOOTER_CONTROL_TEXT_COLOR_NORMAL} ${FOOTER_BKGRD_COLOR}
+  GetDlgItem $0 $HWNDPARENT 10 ; Default browser checkbox
+  ; Set as default is not supported in the installer for Win8 and above so
+  ; only display it on Windows 7 and below
+  ${If} "$CanSetAsDefault" == "true"
+    ; The uxtheme must be disabled on checkboxes in order to override the
+    ; system font color.
+    System::Call 'uxtheme::SetWindowTheme(i $0 , w " ", w " ")'
+    SendMessage $0 ${WM_SETFONT} $FontNormal 0
+    SendMessage $0 ${WM_SETTEXT} 0 "STR:$(MAKE_DEFAULT)"
+    SendMessage $0 ${BM_SETCHECK} 1 0
+    SetCtlColors $0 ${FOOTER_CONTROL_TEXT_COLOR_NORMAL} ${FOOTER_BKGRD_COLOR}
   ${Else}
-    SetCtlColors $HWNDPARENT ${FOOTER_CONTROL_TEXT_COLOR_NORMAL} ${FOOTER_BKGRD_COLOR}
-    GetDlgItem $0 $HWNDPARENT 10 ; Default browser checkbox
-    ; Set as default is not supported in the installer for Win8 and above so
-    ; only display it on Windows 7 and below
-    ${If} "$CanSetAsDefault" == "true"
-      ; The uxtheme must be disabled on checkboxes in order to override the
-      ; system font color.
-      System::Call 'uxtheme::SetWindowTheme(i $0 , w " ", w " ")'
-      SendMessage $0 ${WM_SETFONT} $FontNormal 0
-      SendMessage $0 ${WM_SETTEXT} 0 "STR:$(MAKE_DEFAULT)"
-      SendMessage $0 ${BM_SETCHECK} 1 0
-      SetCtlColors $0 ${FOOTER_CONTROL_TEXT_COLOR_NORMAL} ${FOOTER_BKGRD_COLOR}
-    ${Else}
-      ShowWindow $0 ${SW_HIDE}
-    ${EndIf}
-    GetDlgItem $0 $HWNDPARENT 11
     ShowWindow $0 ${SW_HIDE}
   ${EndIf}
+  GetDlgItem $0 $HWNDPARENT 11
+  ShowWindow $0 ${SW_HIDE}
 
   ${NSD_CreateBitmap} ${APPNAME_BMP_EDGE_DU} ${APPNAME_BMP_TOP_DU} \
                       ${APPNAME_BMP_WIDTH_DU} ${APPNAME_BMP_HEIGHT_DU} ""
   Pop $2
   ${SetStretchedTransparentImage} $2 $PLUGINSDIR\appname.bmp $0
 
   ${NSD_CreateBitmap} 0 0 100% 100% ""
   Pop $2
@@ -712,31 +699,29 @@ Function createIntro
 
   GetDlgItem $0 $HWNDPARENT 1 ; Install button
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
   ${NSD_SetFocus} $0
 
   GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(CANCEL_BUTTON)"
 
-  GetDlgItem $0 $HWNDPARENT 3 ; Back and Options button
+  GetDlgItem $0 $HWNDPARENT 3 ; Back button used for Options
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(OPTIONS_BUTTON)"
 
   IntOp $IntroPageShownCount $IntroPageShownCount + 1
 
   System::Call "kernel32::GetTickCount()l .s"
   Pop $StartIntroPhaseTickCount
 
   LockWindow off
   nsDialogs::Show
 
   ${NSD_FreeImage} $0
   ${NSD_FreeImage} $1
-
-  StrCpy $Initialized "true"
 FunctionEnd
 
 Function leaveIntro
   LockWindow on
 
   System::Call "kernel32::GetTickCount()l .s"
   Pop $0
   ${GetSecondsElapsed} "$StartIntroPhaseTickCount" "$0" $1
@@ -768,18 +753,18 @@ Function leaveIntro
   ${If} ${FileExists} "$INSTDIR"
     ; Always display the long path if the path exists.
     ${GetLongPath} "$INSTDIR" $INSTDIR
   ${EndIf}
 
 FunctionEnd
 
 Function createOptions
-  ; Check whether the requirements to install are satisfied the first time the
-  ; options page is displayed for metrics.
+  ; Check whether the install requirements are satisfied using the default
+  ; values for metrics.
   ${If} "$InitialInstallRequirementsCode" == ""
     ${If} "$CanWriteToInstallDir" != "true"
     ${AndIf} "$HasRequiredSpaceAvailable" != "true"
       StrCpy $InitialInstallRequirementsCode "1"
     ${ElseIf} "$CanWriteToInstallDir" != "true"
       StrCpy $InitialInstallRequirementsCode "2"
     ${ElseIf} "$HasRequiredSpaceAvailable" != "true"
       StrCpy $InitialInstallRequirementsCode "3"
@@ -965,18 +950,19 @@ Function createOptions
 
   GetDlgItem $0 $HWNDPARENT 1 ; Install button
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
   ${NSD_SetFocus} $0
 
   GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(CANCEL_BUTTON)"
 
-  GetDlgItem $0 $HWNDPARENT 3 ; Back and Options button
-  SendMessage $0 ${WM_SETTEXT} 0 "STR:$(BACK_BUTTON)"
+  GetDlgItem $0 $HWNDPARENT 3 ; Back button used for Options
+  EnableWindow $0 0
+  ShowWindow $0 ${SW_HIDE}
 
   ; If the option button was not clicked display the reason for what needs to be
   ; resolved to continue the installation.
   ${If} "$WasOptionsButtonClicked" != "1"
     ${If} "$CanWriteToInstallDir" == "false"
       MessageBox MB_OK|MB_ICONEXCLAMATION "$(WARN_WRITE_ACCESS)"
     ${ElseIf} "$HasRequiredSpaceAvailable" == "false"
       MessageBox MB_OK|MB_ICONEXCLAMATION "$(WARN_DISK_SPACE)"
@@ -1147,17 +1133,17 @@ Function createInstall
   ${NSD_CreateBitmap} 0 0 100% 100% ""
   Pop $3
   ${NSD_SetStretchedImage} $3 $PLUGINSDIR\bgplain.bmp $1
 
   GetDlgItem $0 $HWNDPARENT 1 ; Install button
   EnableWindow $0 0
   ShowWindow $0 ${SW_HIDE}
 
-  GetDlgItem $0 $HWNDPARENT 3 ; Back and Options button
+  GetDlgItem $0 $HWNDPARENT 3 ; Back button used for Options
   EnableWindow $0 0
   ShowWindow $0 ${SW_HIDE}
 
   GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(CANCEL_BUTTON)"
   ; Focus the Cancel button otherwise it isn't possible to tab to it since it is
   ; the only control that can be tabbed to.
   ${NSD_SetFocus} $0
--- a/browser/locales/en-US/installer/nsisstrings.properties
+++ b/browser/locales/en-US/installer/nsisstrings.properties
@@ -30,17 +30,16 @@ WARN_WRITE_ACCESS=You don't have access 
 WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location.
 WARN_ROOT_INSTALL=Unable to install to the root of your disk.\n\nClick OK to select a different location.
 WARN_MANUALLY_CLOSE_APP_LAUNCH=$BrandShortName is already running.\n\nPlease close $BrandShortName prior to launching the version you have just installed.
 
 ERROR_DOWNLOAD=Your download was interrupted.\n\nPlease click the OK button to continue.
 
 INSTALL_BUTTON=&Install
 UPGRADE_BUTTON=&Upgrade
-BACK_BUTTON=&Back
 CANCEL_BUTTON=Cancel
 OPTIONS_BUTTON=&Options
 
 MAKE_DEFAULT=&Make $BrandShortName my default browser
 CREATE_SHORTCUTS=Create Shortcuts for $BrandShortName:
 ADD_SC_TASKBAR=On my &Task bar
 ADD_SC_QUICKLAUNCHBAR=On my &Quick Launch bar
 ADD_CheckboxShortcutInStartMenu=In my &Start Menu Programs Folder