Bug 1405438 - Make sure the stub installer exit code is initialized before the user can exit it. r=agashlin, a=ritu
authorMatt Howell <mhowell@mozilla.com>
Tue, 03 Oct 2017 13:18:21 -0700
changeset 432369 5a16f28245b01b4483311578572adfc8eca9efe2
parent 432368 3ff5988c85fb0e30a73e2a2dcbfd8c57fad9b4ce
child 432370 fad5c108c84a9af12b9126101bdbe2772bdc59aa
push id7946
push userryanvm@gmail.com
push dateWed, 11 Oct 2017 17:47:53 +0000
treeherdermozilla-beta@465b880a2af9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagashlin, ritu
bugs1405438
milestone57.0
Bug 1405438 - Make sure the stub installer exit code is initialized before the user can exit it. r=agashlin, a=ritu Also make sure the download phase time is initialized, so it will always be correct in affected pings. MozReview-Commit-ID: 3aLHbMiRUZl
browser/installer/windows/nsis/stub.nsi
--- 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