Bug 802734 - Add a checkbox for sending telemetry ping information. r=jimm
authorBrian R. Bondy <netzen@gmail.com>
Thu, 01 Nov 2012 17:35:54 -0400
changeset 112038 de2e5f230811124a1a255030270fd8d77b4956cc
parent 112037 5a37fa4fe004a37b95fd1ed465789ccdde18f3db
child 112039 570c7cb5b03dc844b22b7d39cdf05f0c91906fc8
push id23787
push userbbondy@mozilla.com
push dateThu, 01 Nov 2012 21:36:34 +0000
treeherdermozilla-central@de2e5f230811 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs802734
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 802734 - Add a checkbox for sending telemetry ping information. r=jimm
browser/installer/windows/nsis/stub.nsi
browser/locales/en-US/installer/nsisstrings.properties
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -28,16 +28,17 @@ Var LabelDownloadingDown
 Var LabelDownloadingInProgress
 Var LabelInstallingInProgress
 Var LabelInstallingToBeDone
 Var LabelFreeSpace
 Var CheckboxSetAsDefault
 Var CheckboxShortcutOnBar ; Used for Quicklaunch or Taskbar as appropriate
 Var CheckboxShortcutInStartMenu
 Var CheckboxShortcutOnDesktop
+Var CheckboxSendPing
 Var CheckboxInstallMaintSvc
 Var DirRequest
 Var ButtonBrowse
 Var LabelBlurb1
 Var LabelBlurb2
 Var LabelBlurb3
 Var BitmapBlurb1
 Var BitmapBlurb2
@@ -351,16 +352,17 @@ Function .onGUIEnd
   ; The value of $IsDownloadFinished will be false if the download was attempted
   ; and wasn't completed. Get the seconds elapsed trying to download.
   ${If} $IsDownloadFinished == "false"
     Call GetSecondsToDownload
   ${EndIf}
 
   ; Try to send a ping if a download was attempted
   ${If} $IsDownloadFinished != ""
+  ${AndIf} $CheckboxSendPing == 1
     System::Int64Op $DownloadedAmount / 1024
     Pop $DownloadedAmount
     InetBgDL::Get "${BaseURLStubPing}${Channel}/${AB_CD}/$ExitCode/" \
                   "$FirefoxLaunch/$SecondsToDownload/$DownloadedAmount/" \
                   "$ExistingProfile/$ExistingInstall/" "$PLUGINSDIR\_temp" /END
   ${EndIf}
 
   ${UnloadUAC}
@@ -383,16 +385,17 @@ Function createDummy
 FunctionEnd
 
 Function createIntro
   ; If Back is clicked on the options page reset variables
   StrCpy $INSTDIR "$InitialInstallDir"
   StrCpy $CheckboxShortcutOnBar 1
   StrCpy $CheckboxShortcutInStartMenu 1
   StrCpy $CheckboxShortcutOnDesktop 1
+  StrCpy $CheckboxSendPing 1
 !ifdef MOZ_MAINTENANCE_SERVICE
   StrCpy $CheckboxInstallMaintSvc 1
 !else
   StrCpy $CheckboxInstallMaintSvc 0
 !endif
 
   nsDialogs::Create /NOUNLOAD 1018
   Pop $Dialog
@@ -623,16 +626,26 @@ Function createOptions
   ; UpdateFreeSpaceLabel
   ${NSD_CreateLabel} $CTL_RIGHT_PX 145u 100% $HEIGHT_PX " "
   Pop $LabelFreeSpace
   SetCtlColors $LabelFreeSpace ${OPTIONS_TEXT_COLOR_NORMAL} ${OPTIONS_BKGRD_COLOR}
   SendMessage $LabelFreeSpace ${WM_SETFONT} $FontNormal 0
 
   Call UpdateFreeSpaceLabel
 
+  ${NSD_CreateCheckbox} ${OPTIONS_ITEM_EDGE_DU} 168u ${OPTIONS_SUBITEM_WIDTH_DU} \
+                        12u "$(SEND_PING)"
+  Pop $CheckboxSendPing
+  ; The uxtheme must be disabled on checkboxes in order to override the system
+  ; font color.
+  System::Call 'uxtheme::SetWindowTheme(i $CheckboxSendPing, w " ", w " ")'
+  SetCtlColors $CheckboxSendPing ${OPTIONS_TEXT_COLOR_NORMAL} ${OPTIONS_BKGRD_COLOR}
+  SendMessage $CheckboxSendPing ${WM_SETFONT} $FontNormal 0
+  ${NSD_Check} $CheckboxSendPing
+
 !ifdef MOZ_MAINTENANCE_SERVICE
   ; Only show the maintenance service checkbox if we have write access to HKLM
   Call IsUserAdmin
   Pop $0
   ClearErrors
   WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" \
                    "Write Test"
   ${If} ${Errors}
@@ -640,17 +653,17 @@ Function createOptions
     StrCpy $CheckboxInstallMaintSvc "0"
   ${Else}
     DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
     ; Read the registry instead of using ServicesHelper::IsInstalled so the
     ; plugin isn't included in the stub installer to lessen its size.
     ClearErrors
     ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\services\MozillaMaintenance" "ImagePath"
     ${If} ${Errors}
-      ${NSD_CreateCheckbox} ${OPTIONS_ITEM_EDGE_DU} 175u ${OPTIONS_ITEM_WIDTH_DU} \
+      ${NSD_CreateCheckbox} ${OPTIONS_ITEM_EDGE_DU} 184u ${OPTIONS_ITEM_WIDTH_DU} \
                             12u "$(INSTALL_MAINT_SERVICE)"
       Pop $CheckboxInstallMaintSvc
       System::Call 'uxtheme::SetWindowTheme(i $CheckboxInstallMaintSvc, w " ", w " ")'
       SetCtlColors $CheckboxInstallMaintSvc ${OPTIONS_TEXT_COLOR_NORMAL} ${OPTIONS_BKGRD_COLOR}
       SendMessage $CheckboxInstallMaintSvc ${WM_SETFONT} $FontNormal 0
       ${NSD_Check} $CheckboxInstallMaintSvc
     ${EndIf}
   ${EndIf}
@@ -701,16 +714,17 @@ Function leaveOptions
     LockWindow off
     MessageBox MB_OK|MB_ICONEXCLAMATION "$(WARN_DISK_SPACE)"
     Abort ; Stay on the page
   ${EndIf}
 
   ${NSD_GetState} $CheckboxShortcutOnBar $CheckboxShortcutOnBar
   ${NSD_GetState} $CheckboxShortcutInStartMenu $CheckboxShortcutInStartMenu
   ${NSD_GetState} $CheckboxShortcutOnDesktop $CheckboxShortcutOnDesktop
+  ${NSD_GetState} $CheckboxSendPing $CheckboxSendPing
 !ifdef MOZ_MAINTENANCE_SERVICE
   ${NSD_GetState} $CheckboxInstallMaintSvc $CheckboxInstallMaintSvc
 !endif
 
 FunctionEnd
 
 Function createInstall
   nsDialogs::Create /NOUNLOAD 1018
--- a/browser/locales/en-US/installer/nsisstrings.properties
+++ b/browser/locales/en-US/installer/nsisstrings.properties
@@ -44,16 +44,17 @@ CREATE_SHORTCUTS=Create Shortcuts for $B
 ADD_SC_TASKBAR=On my &Task bar
 ADD_SC_QUICKLAUNCHBAR=On my &Quick Launch bar
 ADD_CheckboxShortcutInStartMenu=In my &Start Menu Programs Folder
 ADD_CheckboxShortcutOnDesktop=On my &Desktop
 SPACE_REQUIRED=Space Required:
 SPACE_AVAILABLE=Space Available:
 ONE_MOMENT=One moment, $BrandShortName will launch as soon as the install is complete…
 INSTALL_MAINT_SERVICE=&Install the $BrandShortName background update service
+SEND_PING=S&end information about this installation to Mozilla
 BROWSE_BUTTON=B&rowse…
 DEST_FOLDER=Destination Folder
 
 DOWNLOADING_IN_PROGRESS=Downloading…
 DOWNLOADING_DONE=Downloaded
 INSTALLING_TO_BE_DONE=Installing
 INSTALLING_IN_PROGRESS=Installing…