Windows installer only - Bug 1042558 - remove display of decimals from sizes. r=bbondy
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 19 Nov 2014 20:05:05 -0800
changeset 216559 94e9fc62355f9698506678269d25a83fdf5f757e
parent 216558 f04a2780f2530802a8d87309829aa5f7ce6ea8f7
child 216560 cc4e62b85d77b09c619097fdb3554bce111d1c13
child 216744 0e0ea79db23a2be07a76629f7cbaf3dd70621f14
push idunknown
push userunknown
push dateunknown
reviewersbbondy
bugs1042558
milestone36.0a1
Windows installer only - Bug 1042558 - remove display of decimals from sizes. r=bbondy
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
@@ -87,18 +87,20 @@ VIAddVersionKey "LegalTrademarks" "${Bra
 #endif
 VIAddVersionKey "LegalCopyright"  "${CompanyName}"
 VIAddVersionKey "FileVersion"     "${AppVersion}"
 VIAddVersionKey "ProductVersion"  "${AppVersion}"
 # Comments is not used but left below commented out for future reference
 # VIAddVersionKey "Comments"        "Comments"
 
 # It isn't possible to get the size of the installation prior to downloading
-# so the stub installer uses an estimate.
-!define APPROXIMATE_REQUIRED_SPACE_MB "42.2"
+# so the stub installer uses an estimate. The size is derived from the size of
+# the complete installer, the size of the extracted complete installer, and at
+# least 15 MB additional for working room.
+!define APPROXIMATE_REQUIRED_SPACE_MB "145"
 
 # Control positions in Dialog Units so they are placed correctly with
 # 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 INSTALL_BLURB_TOP_DU 78u
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -1742,54 +1742,34 @@ Function UpdateFreeSpaceLabel
   Call CheckSpace
 
   StrCpy $0 "$SpaceAvailableBytes"
 
   StrCpy $1 "$(BYTE)"
 
   ${If} $0 > 1024
   ${OrIf} $0 < 0
-    ; Multiply by 10 so it is possible to display a decimal in the size
-    System::Int64Op $0 * 10
-    Pop $0
     System::Int64Op $0 / 1024
     Pop $0
     StrCpy $1 "$(KILO)$(BYTE)"
-    ${If} $0 > 10240
+    ${If} $0 > 1024
     ${OrIf} $0 < 0
       System::Int64Op $0 / 1024
       Pop $0
       StrCpy $1 "$(MEGA)$(BYTE)"
-      ${If} $0 > 10240
+      ${If} $0 > 1024
       ${OrIf} $0 < 0
         System::Int64Op $0 / 1024
         Pop $0
         StrCpy $1 "$(GIGA)$(BYTE)"
       ${EndIf}
     ${EndIf}
-    StrLen $3 "$0"
-    ${If} $3 > 1
-      StrCpy $2 "$0" -1 ; All characters except the last one
-      StrCpy $0 "$0" "" -1 ; The last character
-      ${If} "$0" == "0"
-        StrCpy $0 "$2" ; Don't display the decimal if it is 0
-      ${Else}
-        StrCpy $0 "$2.$0"
-      ${EndIf}
-    ${ElseIf} $3 == 1
-      StrCpy $0 "0.$0"
-    ${Else}
-      ; This should never happen
-      System::Int64Op $0 / 10
-      Pop $0
-    ${EndIf}
   ${EndIf}
 
   SendMessage $LabelFreeSpace ${WM_SETTEXT} 0 "STR:$0 $1"
-
 FunctionEnd
 
 Function OnChange_DirRequest
   Pop $0
   System::Call 'user32::GetWindowTextW(i $DirRequest, w .r0, i ${NSIS_MAX_STRLEN})'
   StrCpy $1 "$0" 1 ; the first character
   ${If} "$1" == "$\""
     StrCpy $1 "$0" "" -1 ; the last character