Bug 1405438 - Make sure the stub installer exit code is initialized before the user can exit it. r?agashlin
Also make sure the download phase time is initialized, so it will always be
correct in affected pings.
MozReview-Commit-ID: 3aLHbMiRUZl
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -414,20 +414,23 @@ Function .onInit
${EndIf}
StrCpy $CheckboxSetAsDefault "0"
; The interval in MS used for the progress bars set as marquee.
StrCpy $ProgressbarMarqueeIntervalMS "10"
; Initialize the majority of variables except those that need to be reset
; when a page is displayed.
+ StrCpy $ExitCode "${ERR_DOWNLOAD_CANCEL}"
StrCpy $IntroPhaseSeconds "0"
StrCpy $OptionsPhaseSeconds "0"
StrCpy $EndPreInstallPhaseTickCount "0"
StrCpy $EndInstallPhaseTickCount "0"
+ StrCpy $StartDownloadPhaseTickCount "0"
+ StrCpy $EndDownloadPhaseTickCount "0"
StrCpy $InitialInstallRequirementsCode ""
StrCpy $IsDownloadFinished ""
StrCpy $FirefoxLaunchCode "0"
StrCpy $CheckboxShortcuts "1"
StrCpy $CheckboxSendPing "1"
StrCpy $CheckboxCleanupProfile "0"
!ifdef MOZ_MAINTENANCE_SERVICE
; We can only install the maintenance service if the user is an admin.
@@ -815,19 +818,17 @@ Function createInstall
EnableWindow $0 0
; Set $DownloadReset to true so the first download tick count is measured.
StrCpy $DownloadReset "true"
StrCpy $IsDownloadFinished "false"
StrCpy $DownloadRetryCount "0"
StrCpy $DownloadedBytes "0"
StrCpy $StartLastDownloadTickCount ""
- StrCpy $EndDownloadPhaseTickCount ""
StrCpy $DownloadFirstTransferSeconds ""
- StrCpy $ExitCode "${ERR_DOWNLOAD_CANCEL}"
StrCpy $OpenedDownloadPage "0"
ClearErrors
ReadINIStr $ExistingVersion "$INSTDIR\application.ini" "App" "Version"
${If} ${Errors}
StrCpy $ExistingVersion "0"
${EndIf}
@@ -1166,17 +1167,16 @@ Function SendPing
System::Call "kernel32::GetTickCount()l .s"
Pop $EndFinishPhaseTickCount
; When the value of $IsDownloadFinished is false the download was started
; but didn't finish. In this case the tick count stored in
; $EndFinishPhaseTickCount is used to determine how long the download was
; in progress.
${If} "$IsDownloadFinished" == "false"
- ${OrIf} "$EndDownloadPhaseTickCount" == ""
StrCpy $EndDownloadPhaseTickCount "$EndFinishPhaseTickCount"
; Cancel the download in progress
InetBgDL::Get /RESET /END
${EndIf}
; When $DownloadFirstTransferSeconds equals an empty string the download
; never successfully started so set the value to 0. It will be possible to