Windows installer only - Bug 1042558 - remove display of decimals from sizes. r=bbondy

This commit is contained in:
Robert Strong 2014-11-19 20:05:05 -08:00
parent 2574c04357
commit 1ed96dce09
2 changed files with 6 additions and 24 deletions

View File

@ -92,8 +92,10 @@ VIAddVersionKey "ProductVersion" "${AppVersion}"
# VIAddVersionKey "Comments" "Comments" # VIAddVersionKey "Comments" "Comments"
# It isn't possible to get the size of the installation prior to downloading # It isn't possible to get the size of the installation prior to downloading
# so the stub installer uses an estimate. # so the stub installer uses an estimate. The size is derived from the size of
!define APPROXIMATE_REQUIRED_SPACE_MB "42.2" # 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 # Control positions in Dialog Units so they are placed correctly with
# non-default DPI settings # non-default DPI settings

View File

@ -1747,44 +1747,24 @@ Function UpdateFreeSpaceLabel
${If} $0 > 1024 ${If} $0 > 1024
${OrIf} $0 < 0 ${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 System::Int64Op $0 / 1024
Pop $0 Pop $0
StrCpy $1 "$(KILO)$(BYTE)" StrCpy $1 "$(KILO)$(BYTE)"
${If} $0 > 10240 ${If} $0 > 1024
${OrIf} $0 < 0 ${OrIf} $0 < 0
System::Int64Op $0 / 1024 System::Int64Op $0 / 1024
Pop $0 Pop $0
StrCpy $1 "$(MEGA)$(BYTE)" StrCpy $1 "$(MEGA)$(BYTE)"
${If} $0 > 10240 ${If} $0 > 1024
${OrIf} $0 < 0 ${OrIf} $0 < 0
System::Int64Op $0 / 1024 System::Int64Op $0 / 1024
Pop $0 Pop $0
StrCpy $1 "$(GIGA)$(BYTE)" StrCpy $1 "$(GIGA)$(BYTE)"
${EndIf} ${EndIf}
${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} ${EndIf}
SendMessage $LabelFreeSpace ${WM_SETTEXT} 0 "STR:$0 $1" SendMessage $LabelFreeSpace ${WM_SETTEXT} 0 "STR:$0 $1"
FunctionEnd FunctionEnd
Function OnChange_DirRequest Function OnChange_DirRequest