Bug 1405438 - Make sure the stub installer exit code is initialized before the user can exit it. r?agashlin draft
authorMatt Howell <mhowell@mozilla.com>
Tue, 03 Oct 2017 13:18:21 -0700
changeset 674532 eba8a1f18c510dadc7cc169a3d5e3e6483d455d2
parent 674396 9be05b2177667ed8221f9da4fdcc200dbdf3de62
child 734369 07346555d25d8eedf0ad17155ad014ada1d47a26
push id82876
push usermhowell@mozilla.com
push dateTue, 03 Oct 2017 23:00:23 +0000
reviewersagashlin
bugs1405438
milestone58.0a1
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
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