Bug 799215 - Stub installer's dual progress bars are confusing. Use a single progress bar for both. ui-r=philipp, r=bbondy
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 19 Mar 2014 10:40:04 -0700
changeset 174361 19671f8c658f9a3ab4d5c06753104cc4d99249f1
parent 174360 4a3cf7c3db77853a1c19d7d446365a266349140f
child 174362 1830613f98cd41ab6dfd1e38932fad78751ede13
push idunknown
push userunknown
push dateunknown
reviewersphilipp, bbondy
bugs799215
milestone31.0a1
Bug 799215 - Stub installer's dual progress bars are confusing. Use a single progress bar for both. ui-r=philipp, r=bbondy
browser/branding/aurora/branding.nsi
browser/branding/nightly/branding.nsi
browser/branding/official/branding.nsi
browser/branding/unofficial/branding.nsi
browser/installer/windows/nsis/stub.nsi
browser/locales/en-US/installer/nsisstrings.properties
toolkit/mozapps/installer/windows/nsis/common.nsh
--- a/browser/branding/aurora/branding.nsi
+++ b/browser/branding/aurora/branding.nsi
@@ -37,9 +37,8 @@
 !define FOOTER_CONTROL_TEXT_COLOR_FADED 0x999999
 !define FOOTER_BKGRD_COLOR 0xFFFFFF
 !define INTRO_BLURB_TEXT_COLOR 0xFFFFFF
 !define OPTIONS_TEXT_COLOR_NORMAL 0xFFFFFF
 !define OPTIONS_TEXT_COLOR_FADED 0xA1AAB3
 !define OPTIONS_BKGRD_COLOR 0x0F1B26
 !define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF
 !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF
-!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0xA1AAB3
--- a/browser/branding/nightly/branding.nsi
+++ b/browser/branding/nightly/branding.nsi
@@ -37,9 +37,8 @@
 !define FOOTER_CONTROL_TEXT_COLOR_FADED 0x999999
 !define FOOTER_BKGRD_COLOR 0xFFFFFF
 !define INTRO_BLURB_TEXT_COLOR 0xFFFFFF
 !define OPTIONS_TEXT_COLOR_NORMAL 0xFFFFFF
 !define OPTIONS_TEXT_COLOR_FADED 0xA1AAB3
 !define OPTIONS_BKGRD_COLOR 0x0F1B26
 !define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF
 !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF
-!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0xA1AAB3
--- a/browser/branding/official/branding.nsi
+++ b/browser/branding/official/branding.nsi
@@ -41,9 +41,8 @@
 !define FOOTER_CONTROL_TEXT_COLOR_FADED 0x666666
 !define FOOTER_BKGRD_COLOR 0xFFFFFF
 !define INTRO_BLURB_TEXT_COLOR 0x666666
 !define OPTIONS_TEXT_COLOR_NORMAL 0x000000
 !define OPTIONS_TEXT_COLOR_FADED 0x666666
 !define OPTIONS_BKGRD_COLOR 0xF0F0F0
 !define INSTALL_BLURB_TEXT_COLOR 0x666666
 !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0x666666
-!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0x999999
--- a/browser/branding/unofficial/branding.nsi
+++ b/browser/branding/unofficial/branding.nsi
@@ -37,9 +37,8 @@
 !define FOOTER_CONTROL_TEXT_COLOR_FADED 0x999999
 !define FOOTER_BKGRD_COLOR 0xFFFFFF
 !define INTRO_BLURB_TEXT_COLOR 0xFFFFFF
 !define OPTIONS_TEXT_COLOR_NORMAL 0xFFFFFF
 !define OPTIONS_TEXT_COLOR_FADED 0xA1AAB3
 !define OPTIONS_BKGRD_COLOR 0x0F1B26
 !define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF
 !define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF
-!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0xA1AAB3
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -16,22 +16,19 @@ SetDatablockOptimize on
 SetCompress off
 CRCCheck on
 
 RequestExecutionLevel user
 
 !addplugindir ./
 
 Var Dialog
-Var ProgressbarDownload
-Var ProgressbarInstall
-Var LabelDownloadingDown
-Var LabelDownloadingInProgress
-Var LabelInstallingInProgress
-Var LabelInstallingToBeDone
+Var Progressbar
+Var LabelDownloading
+Var LabelInstalling
 Var LabelFreeSpace
 Var CheckboxSetAsDefault
 Var CheckboxShortcutOnBar ; Used for Quicklaunch or Taskbar as appropriate
 Var CheckboxShortcutInStartMenu
 Var CheckboxShortcutOnDesktop
 Var CheckboxSendPing
 Var CheckboxInstallMaintSvc
 Var DirRequest
@@ -58,16 +55,17 @@ Var DownloadSizeBytes
 Var HalfOfDownload
 Var DownloadReset
 Var ExistingTopDir
 Var SpaceAvailableBytes
 Var InitialInstallDir
 Var HandleDownload
 Var CanSetAsDefault
 Var InstallCounterStep
+Var InstallStepSize
 Var TmpVal
 
 Var ExitCode
 Var FirefoxLaunchCode
 
 ; The first three tick counts are for the start of a phase and equate equate to
 ; the display of individual installer pages.
 Var StartIntroPhaseTickCount
@@ -1096,50 +1094,32 @@ Function createInstall
   IntOp $R1 $R1 + $3
   ${NSD_CreateLabel} $R1 ${INSTALL_BLURB_TOP_DU} $5 $6 "${INSTALL_BLURB3}"
   Pop $LabelBlurb3
   SendMessage $LabelBlurb3 ${WM_SETFONT} $FontBlurb 0
   SetCtlColors $LabelBlurb3 ${INSTALL_BLURB_TEXT_COLOR} transparent
   ShowWindow $BitmapBlurb3 ${SW_HIDE}
   ShowWindow $LabelBlurb3 ${SW_HIDE}
 
-  nsDialogs::CreateControl /NOUNLOAD STATIC ${DEFAULT_STYLES}|${SS_SUNKEN} 0 260u 166u 1u 30u ""
-  Pop $0
-
-  ${NSD_CreateLabelCenter} 103u 180u 157u 20u "$(DOWNLOADING_IN_PROGRESS)"
-  Pop $LabelDownloadingInProgress
-  SendMessage $LabelDownloadingInProgress ${WM_SETFONT} $FontNormal 0
-  SetCtlColors $LabelDownloadingInProgress ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
-
-  ${NSD_CreateLabelCenter} 103u 180u 157u 20u "$(DOWNLOADING_DONE)"
-  Pop $LabelDownloadingDown
-  SendMessage $LabelDownloadingDown ${WM_SETFONT} $FontItalic 0
-  SetCtlColors $LabelDownloadingDown ${INSTALL_PROGRESS_TEXT_COLOR_FADED} transparent
-  ShowWindow $LabelDownloadingDown ${SW_HIDE}
-
-  ${NSD_CreateLabelCenter} 260uu 180u 84u 20u "$(INSTALLING_TO_BE_DONE)"
-  Pop $LabelInstallingToBeDone
-  SendMessage $LabelInstallingToBeDone ${WM_SETFONT} $FontItalic 0
-  SetCtlColors $LabelInstallingToBeDone ${INSTALL_PROGRESS_TEXT_COLOR_FADED} transparent
-
-  ${NSD_CreateLabelCenter} 260uu 180u 84u 20u "$(INSTALLING_IN_PROGRESS)"
-  Pop $LabelInstallingInProgress
-  SendMessage $LabelInstallingInProgress ${WM_SETFONT} $FontNormal 0
-  SetCtlColors $LabelInstallingInProgress ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
-  ShowWindow $LabelInstallingInProgress ${SW_HIDE}
-
-  ${NSD_CreateProgressBar} 103u 166u 157u 9u ""
-  Pop $ProgressbarDownload
-  ${NSD_AddStyle} $ProgressbarDownload ${PBS_MARQUEE}
-  SendMessage $ProgressbarDownload ${PBM_SETMARQUEE} 1 \
+  ${NSD_CreateProgressBar} 103u 166u 241u 9u ""
+  Pop $Progressbar
+  ${NSD_AddStyle} $Progressbar ${PBS_MARQUEE}
+  SendMessage $Progressbar ${PBM_SETMARQUEE} 1 \
               ${ProgressbarMarqueeIntervalMS} ; start=1|stop=0 interval(ms)=+N
 
-  ${NSD_CreateProgressBar} 260u 166u 84u 9u ""
-  Pop $ProgressbarInstall
-  SendMessage $ProgressbarInstall ${PBM_SETRANGE32} 0 ${InstallProgresSteps}
+  ${NSD_CreateLabelCenter} 103u 180u 241u 20u "$(DOWNLOADING_LABEL)"
+  Pop $LabelDownloading
+  SendMessage $LabelDownloading ${WM_SETFONT} $FontNormal 0
+  SetCtlColors $LabelDownloading ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
+
+  ${NSD_CreateLabelCenter} 103u 180u 241u 20u "$(INSTALLING_LABEL)"
+  Pop $LabelInstalling
+  SendMessage $LabelInstalling ${WM_SETFONT} $FontNormal 0
+  SetCtlColors $LabelInstalling ${INSTALL_PROGRESS_TEXT_COLOR_NORMAL} transparent
+  ShowWindow $LabelInstalling ${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 $3
@@ -1242,18 +1222,18 @@ Function OnDownload
   # /RESET must be used if status $0 > 299 (e.g. failure)
   # When status is $0 =< 299 it is handled by InetBgDL
   StrCpy $DownloadServerIP "$5"
   ${If} $0 > 299
     ${NSD_KillTimer} OnDownload
     IntOp $DownloadRetryCount $DownloadRetryCount + 1
     ${If} "$DownloadReset" != "true"
       StrCpy $DownloadedBytes "0"
-      ${NSD_AddStyle} $ProgressbarDownload ${PBS_MARQUEE}
-      SendMessage $ProgressbarDownload ${PBM_SETMARQUEE} 1 \
+      ${NSD_AddStyle} $Progressbar ${PBS_MARQUEE}
+      SendMessage $Progressbar ${PBM_SETMARQUEE} 1 \
                   ${ProgressbarMarqueeIntervalMS} ; start=1|stop=0 interval(ms)=+N
     ${EndIf}
     InetBgDL::Get /RESET /END
     StrCpy $DownloadSizeBytes ""
     StrCpy $DownloadReset "true"
 
     ${If} $DownloadRetryCount >= ${DownloadMaxRetries}
       StrCpy $ExitCode "${ERR_DOWNLOAD_TOO_MANY_RETRIES}"
@@ -1297,19 +1277,23 @@ Function OnDownload
         ${NSD_CreateTimer} StartDownload ${DownloadIntervalMS}
       ${EndIf}
       Return
     ${EndIf}
 
     StrCpy $DownloadSizeBytes "$4"
     System::Int64Op $4 / 2
     Pop $HalfOfDownload
-    SendMessage $ProgressbarDownload ${PBM_SETMARQUEE} 0 0 ; start=1|stop=0 interval(ms)=+N
-    ${RemoveStyle} $ProgressbarDownload ${PBS_MARQUEE}
-    SendMessage $ProgressbarDownload ${PBM_SETRANGE32} 0 $DownloadSizeBytes
+    System::Int64Op $HalfOfDownload / ${InstallProgresSteps}
+    Pop $InstallStepSize
+    SendMessage $Progressbar ${PBM_SETMARQUEE} 0 0 ; start=1|stop=0 interval(ms)=+N
+    ${RemoveStyle} $Progressbar ${PBS_MARQUEE}
+    System::Int64Op $HalfOfDownload + $DownloadSizeBytes
+    Pop $R9
+    SendMessage $Progressbar ${PBM_SETRANGE32} 0 $R9
   ${EndIf}
 
   ; Don't update the status until after the download starts
   ${If} $2 != 0
   ${AndIf} "$4" == ""
     Return
   ${EndIf}
 
@@ -1356,22 +1340,24 @@ Function OnDownload
           ${NSD_CreateTimer} StartDownload ${DownloadIntervalMS}
         ${EndIf}
         Return
       ${EndIf}
 
       LockWindow on
       ; Update the progress bars first in the UI change so they take affect
       ; before other UI changes.
-      SendMessage $ProgressbarDownload ${PBM_SETPOS} $DownloadSizeBytes 0
-      SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0
-      ShowWindow $LabelDownloadingInProgress ${SW_HIDE}
-      ShowWindow $LabelInstallingToBeDone ${SW_HIDE}
-      ShowWindow $LabelInstallingInProgress ${SW_SHOW}
-      ShowWindow $LabelDownloadingDown ${SW_SHOW}
+      SendMessage $Progressbar ${PBM_SETPOS} $DownloadSizeBytes 0
+      System::Int64Op $InstallStepSize * ${InstallProgressFirstStep}
+      Pop $R9
+      SendMessage $Progressbar ${PBM_SETSTEP} $R9 0
+      SendMessage $Progressbar ${PBM_STEPIT} 0 0
+      SendMessage $Progressbar ${PBM_SETSTEP} $InstallStepSize 0
+      ShowWindow $LabelDownloading ${SW_HIDE}
+      ShowWindow $LabelInstalling ${SW_SHOW}
       ShowWindow $LabelBlurb2 ${SW_HIDE}
       ShowWindow $BitmapBlurb2 ${SW_HIDE}
       ShowWindow $LabelBlurb3 ${SW_SHOW}
       ShowWindow $BitmapBlurb3 ${SW_SHOW}
       ; Disable the Cancel button during the install
       GetDlgItem $5 $HWNDPARENT 2
       EnableWindow $5 0
       LockWindow off
@@ -1471,17 +1457,17 @@ Function OnDownload
         LockWindow on
         ShowWindow $LabelBlurb1 ${SW_HIDE}
         ShowWindow $BitmapBlurb1 ${SW_HIDE}
         ShowWindow $LabelBlurb2 ${SW_SHOW}
         ShowWindow $BitmapBlurb2 ${SW_SHOW}
         LockWindow off
       ${EndIf}
       StrCpy $DownloadedBytes "$3"
-      SendMessage $ProgressbarDownload ${PBM_SETPOS} $3 0
+      SendMessage $Progressbar ${PBM_SETPOS} $3 0
     ${EndIf}
   ${EndIf}
 FunctionEnd
 
 Function OnPing
   InetBgDL::GetStats
   # $0 = HTTP status code, 0=Completed
   # $1 = Completed files
@@ -1506,17 +1492,17 @@ FunctionEnd
 Function StartInstall
   ${NSD_KillTimer} StartInstall
 
   System::Call "kernel32::GetTickCount()l .s"
   Pop $EndPreInstallPhaseTickCount
 
   IntOp $InstallCounterStep $InstallCounterStep + 1
   LockWindow on
-  SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0
+  SendMessage $Progressbar ${PBM_STEPIT} 0 0
   LockWindow off
 
   Exec "$\"$PLUGINSDIR\download.exe$\" /INI=$PLUGINSDIR\${CONFIG_INI}"
   ${NSD_CreateTimer} CheckInstall ${InstallIntervalMS}
 FunctionEnd
 
 Function CheckInstall
   IntOp $InstallCounterStep $InstallCounterStep + 1
@@ -1525,17 +1511,17 @@ Function CheckInstall
     ; Close the handle that prevents modification of the full installer
     System::Call 'kernel32::CloseHandle(i $HandleDownload)'
     StrCpy $ExitCode "${ERR_INSTALL_TIMEOUT}"
     ; Use a timer so the UI has a chance to update
     ${NSD_CreateTimer} DisplayDownloadError ${InstallIntervalMS}
     Return
   ${EndIf}
 
-  SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0
+  SendMessage $Progressbar ${PBM_STEPIT} 0 0
 
   ${If} ${FileExists} "$INSTDIR\install.log"
     Delete "$INSTDIR\install.tmp"
     CopyFiles /SILENT "$INSTDIR\install.log" "$INSTDIR\install.tmp"
 
     ; When the full installer completes the installation the install.log will no
     ; longer be in use.
     ClearErrors
@@ -1544,36 +1530,42 @@ Function CheckInstall
       ${NSD_KillTimer} CheckInstall
       ; Close the handle that prevents modification of the full installer
       System::Call 'kernel32::CloseHandle(i $HandleDownload)'
       Rename "$INSTDIR\install.tmp" "$INSTDIR\install.log"
       Delete "$PLUGINSDIR\download.exe"
       Delete "$PLUGINSDIR\${CONFIG_INI}"
       System::Call "kernel32::GetTickCount()l .s"
       Pop $EndInstallPhaseTickCount
+      System::Int64Op $InstallStepSize * 20
+      Pop $InstallStepSize
+      SendMessage $Progressbar ${PBM_SETSTEP} $InstallStepSize 0
       ${NSD_CreateTimer} FinishInstall ${InstallIntervalMS}
     ${EndUnless}
   ${EndIf}
 FunctionEnd
 
 Function FinishInstall
-  ; The full installer has complete but we still need to finish the progress
-  ; bar so increase the size of the step
+  ; The full installer has completed but the progress bar still needs to finish
+  ; so increase the size of the step.
   IntOp $InstallCounterStep $InstallCounterStep + 20
   ${If} ${InstallProgresSteps} < $InstallCounterStep
     StrCpy $InstallCounterStep "${InstallProgresSteps}"
   ${EndIf}
 
-  SendMessage $ProgressbarInstall ${PBM_SETPOS} $InstallCounterStep 0
   ${If} ${InstallProgresSteps} != $InstallCounterStep
+    SendMessage $Progressbar ${PBM_STEPIT} 0 0
     Return
   ${EndIf}
 
   ${NSD_KillTimer} FinishInstall
 
+  SendMessage $Progressbar ${PBM_GETRANGE} 0 0 $R9
+  SendMessage $Progressbar ${PBM_SETPOS} $R9 0
+
   ${If} "$CheckboxSetAsDefault" == "1"
     ${GetParameters} $0
     ClearErrors
     ${GetOptions} "$0" "/UAC:" $0
     ${If} ${Errors} ; Not elevated
       Call ExecSetAsDefaultAppUser
     ${Else} ; Elevated - execute the function in the unelevated process
       GetFunctionAddress $0 ExecSetAsDefaultAppUser
@@ -1598,16 +1590,29 @@ Function FinishInstall
 
   ${If} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-upgrade"
     Delete "$INSTDIR\${FileMainEXE}"
     Rename "$INSTDIR\${FileMainEXE}.moz-upgrade" "$INSTDIR\${FileMainEXE}"
   ${EndIf}
 
   StrCpy $ExitCode "${ERR_SUCCESS}"
 
+  StrCpy $InstallCounterStep 0
+  ${NSD_CreateTimer} FinishProgressBar ${InstallIntervalMS}
+FunctionEnd
+
+Function FinishProgressBar
+  IntOp $InstallCounterStep $InstallCounterStep + 1
+
+  ${If} $InstallCounterStep < 10
+    Return
+  ${EndIf}
+
+  ${NSD_KillTimer} FinishProgressBar
+
   Call LaunchApp
 
   Call SendPing
 FunctionEnd
 
 Function OnBack
   StrCpy $WasOptionsButtonClicked "1"
   StrCpy $R9 "1" ; Goto the next page
--- a/browser/locales/en-US/installer/nsisstrings.properties
+++ b/browser/locales/en-US/installer/nsisstrings.properties
@@ -47,19 +47,17 @@ ADD_CheckboxShortcutOnDesktop=On my &Des
 SPACE_REQUIRED=Space Required:
 SPACE_AVAILABLE=Space Available:
 ONE_MOMENT=One moment, $BrandShortName will launch as soon as the install is complete…
 INSTALL_MAINT_SERVICE=&Install the $BrandShortName background update service
 SEND_PING=S&end information about this installation to Mozilla
 BROWSE_BUTTON=B&rowse…
 DEST_FOLDER=Destination Folder
 
-DOWNLOADING_IN_PROGRESS=Downloading…
-DOWNLOADING_DONE=Downloaded
-INSTALLING_TO_BE_DONE=Installing
-INSTALLING_IN_PROGRESS=Installing…
+DOWNLOADING_LABEL=Downloading $BrandShortName…
+INSTALLING_LABEL=Installing $BrandShortName…
 
 SELECT_FOLDER_TEXT=Select the folder to install $BrandShortName in.
 
 BYTE=B
 KILO=K
 MEGA=M
 GIGA=G
--- a/toolkit/mozapps/installer/windows/nsis/common.nsh
+++ b/toolkit/mozapps/installer/windows/nsis/common.nsh
@@ -79,17 +79,19 @@
 ; NSIS provided macros that we have overridden.
 !include overrides.nsh
 
 !define SHORTCUTS_LOG "shortcuts_log.ini"
 !define TO_BE_DELETED "to_be_deleted"
 
 ; !define SHCNF_DWORD     0x0003
 ; !define SHCNF_FLUSH     0x1000
-!define SHCNF_DWORDFLUSH  0x1003
+!ifndef SHCNF_DWORDFLUSH
+  !define SHCNF_DWORDFLUSH 0x1003
+!endif
 !ifndef SHCNE_ASSOCCHANGED
   !define SHCNE_ASSOCCHANGED 0x08000000
 !endif
 
 ################################################################################
 # Macros for debugging
 
 /**
@@ -944,18 +946,22 @@
     !insertmacro WriteRegStrHKCR
 
     !undef _MOZFUNC_UN
     !define _MOZFUNC_UN
     !verbose pop
   !endif
 !macroend
 
-!define KEY_SET_VALUE 0x0002
-!define KEY_WOW64_64KEY 0x0100
+!ifndef KEY_SET_VALUE
+  !define KEY_SET_VALUE 0x0002
+!endif
+!ifndef KEY_WOW64_64KEY
+  !define KEY_WOW64_64KEY 0x0100
+!endif
 !ifndef HAVE_64BIT_OS
   !define CREATE_KEY_SAM ${KEY_SET_VALUE}
 !else
   !define CREATE_KEY_SAM ${KEY_SET_VALUE}|${KEY_WOW64_64KEY}
 !endif
 
 /**
  * Creates a registry key. This will log the actions to the install and
@@ -7245,34 +7251,63 @@
     !verbose pop
   !endif
 !macroend
 
 
 ################################################################################
 # Helpers for the new user interface
 
-!define MAXDWORD 0xffffffff
-
-!define DT_WORDBREAK 0x0010
-!define DT_SINGLELINE 0x0020
-!define DT_NOCLIP 0x0100
-!define DT_CALCRECT 0x0400
-!define DT_EDITCONTROL 0x2000
-!define DT_RTLREADING 0x00020000
-!define DT_NOFULLWIDTHCHARBREAK 0x00080000
-
-!define WS_EX_NOINHERITLAYOUT 0x00100000
-!define WS_EX_LAYOUTRTL 0x00400000
-
-!define PBS_MARQUEE 0x08
-
-!define /math PBM_SETRANGE32 ${WM_USER} + 6
-
-!define SHACF_FILESYSTEM 1
+!ifndef MAXDWORD
+  !define MAXDWORD 0xffffffff
+!endif
+
+!ifndef DT_WORDBREAK
+  !define DT_WORDBREAK 0x0010
+!endif
+!ifndef DT_SINGLELINE
+  !define DT_SINGLELINE 0x0020
+!endif
+!ifndef DT_NOCLIP
+  !define DT_NOCLIP 0x0100
+!endif
+!ifndef DT_CALCRECT
+  !define DT_CALCRECT 0x0400
+!endif
+!ifndef DT_EDITCONTROL
+  !define DT_EDITCONTROL 0x2000
+!endif
+!ifndef DT_RTLREADING
+  !define DT_RTLREADING 0x00020000
+!endif
+!ifndef DT_NOFULLWIDTHCHARBREAK
+  !define DT_NOFULLWIDTHCHARBREAK 0x00080000
+!endif
+
+!ifndef WS_EX_NOINHERITLAYOUT
+  !define WS_EX_NOINHERITLAYOUT 0x00100000
+!endif
+!ifndef WS_EX_LAYOUTRTL
+  !define WS_EX_LAYOUTRTL 0x00400000
+!endif
+
+!ifndef PBS_MARQUEE
+  !define PBS_MARQUEE 0x08
+!endif
+
+!ifndef PBM_SETRANGE32
+  !define PBM_SETRANGE32 0x406
+!endif
+!ifndef PBM_GETRANGE
+  !define PBM_GETRANGE 0x407
+!endif
+
+!ifndef SHACF_FILESYSTEM
+  !define SHACF_FILESYSTEM 1
+!endif
 
 !define MOZ_LOADTRANSPARENT ${LR_LOADFROMFILE}|${LR_LOADTRANSPARENT}|${LR_LOADMAP3DCOLORS}
 
 ; Extend nsDialogs.nsh to support creating centered labels if it is already
 ; included
 !ifmacrodef __NSD_DefineControl
 !insertmacro __NSD_DefineControl LabelCenter
 !define __NSD_LabelCenter_CLASS STATIC