From bfe4a2f97f8f26a213217f78179e9fdf9031cf2c Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Thu, 19 Mar 2009 11:56:47 -0700 Subject: [PATCH] Bug 483688 - Modify Firefox Installer to Incorporate Feedback Form. r=jmathies, ur-r=beltzner --- browser/installer/windows/nsis/installer.nsi | 92 ++++++++++++++++++- .../mozapps/installer/windows/nsis/common.nsh | 13 ++- 2 files changed, 98 insertions(+), 7 deletions(-) diff --git a/browser/installer/windows/nsis/installer.nsi b/browser/installer/windows/nsis/installer.nsi index 7b100cfc877..7991d88148d 100755 --- a/browser/installer/windows/nsis/installer.nsi +++ b/browser/installer/windows/nsis/installer.nsi @@ -58,6 +58,9 @@ Var InstallType Var AddStartMenuSC Var AddQuickLaunchSC Var AddDesktopSC +Var PageName + +!define AbortSurveyURL "http://www.kampyle.com/feedback_form/ff-feedback-form.php?site_code=8166124&form_id=12116&url=" ; Other included files may depend upon these includes! ; The following includes are provided by NSIS. @@ -72,6 +75,7 @@ Var AddDesktopSC !insertmacro GetParameters !insertmacro GetSize !insertmacro StrFilter +!insertmacro WordFind !insertmacro WordReplace ; The following includes are custom. @@ -129,7 +133,8 @@ ShowInstDetails nevershow ################################################################################ # Modern User Interface - MUI -!define MUI_ABORTWARNING +!define MOZ_MUI_CUSTOM_ABORT +!define MUI_CUSTOMFUNCTION_ABORT "CustomAbort" !define MUI_ICON setup.ico !define MUI_UNICON setup.ico !define MUI_WELCOMEPAGE_TITLE_3LINES @@ -477,6 +482,79 @@ Section "-InstallEndCleanup" ${EndIf} SectionEnd +################################################################################ +# Install Abort Survey Functions + +Function CustomAbort + ${If} "${AB_CD}" == "en-US" + ${AndIf} "$PageName" != "" + ${AndIf} ${FileExists} "$EXEDIR\nonlocalized\distribution\distribution.ini" + ReadINIStr $0 "$EXEDIR\nonlocalized\distribution\distribution.ini" "Global" "about" + ClearErrors + ${WordFind} "$0" "Funnelcake" "E#" $1 + ${Unless} ${Errors} + ; Yes = fill out the survey and exit, No = don't fill out survey and exit, + ; Cancel = don't exit. + MessageBox MB_YESNO|MB_ICONEXCLAMATION \ + "Would you like to tell us why you are canceling this installation?" \ + IDYes +1 IDNO CustomAbort_finish + ${If} "$PageName" == "Welcome" + GetFunctionAddress $0 AbortSurveyWelcome + ${ElseIf} "$PageName" == "Options" + GetFunctionAddress $0 AbortSurveyOptions + ${ElseIf} "$PageName" == "Directory" + GetFunctionAddress $0 AbortSurveyDirectory + ${ElseIf} "$PageName" == "Shortcuts" + GetFunctionAddress $0 AbortSurveyShortcuts + ${ElseIf} "$PageName" == "StartMenu" + GetFunctionAddress $0 AbortSurveyStartMenu + ${ElseIf} "$PageName" == "Summary" + GetFunctionAddress $0 AbortSurveySummary + ${EndIf} + ClearErrors + ${GetParameters} $1 + ${GetOptions} "$1" "/UAC:" $2 + ${If} ${Errors} + Call $0 + ${Else} + UAC::ExecCodeSegment $0 + ${EndIf} + + CustomAbort_finish: + Return + ${EndUnless} + ${EndIf} + + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(MOZ_MUI_TEXT_ABORTWARNING)" \ + IDYES +1 IDNO +2 + Return + Abort +FunctionEnd + +Function AbortSurveyWelcome + ExecShell "open" "${AbortSurveyURL}step1" +FunctionEnd + +Function AbortSurveyOptions + ExecShell "open" "${AbortSurveyURL}step2" +FunctionEnd + +Function AbortSurveyDirectory + ExecShell "open" "${AbortSurveyURL}step3" +FunctionEnd + +Function AbortSurveyShortcuts + ExecShell "open" "${AbortSurveyURL}step4" +FunctionEnd + +Function AbortSurveyStartMenu + ExecShell "open" "${AbortSurveyURL}step5" +FunctionEnd + +Function AbortSurveySummary + ExecShell "open" "${AbortSurveyURL}step6" +FunctionEnd + ################################################################################ # Helper Functions @@ -484,14 +562,14 @@ Function CheckExistingInstall ; If there is a pending file copy from a previous uninstall don't allow ; installing until after the system has rebooted. IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +4 - MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2 Reboot Quit ; If there is a pending file deletion from a previous uninstall don't allow ; installing until after the system has rebooted. IfFileExists "$INSTDIR\${FileMainEXE}.moz-delete" +1 +4 - MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +2 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +2 Reboot Quit @@ -564,6 +642,7 @@ BrandingText " " # Page pre, show, and leave functions Function preWelcome + StrCpy $PageName "Welcome" ${If} ${FileExists} "$EXEDIR\localized\distribution\modern-wizard.bmp" Delete "$PLUGINSDIR\modern-wizard.bmp" CopyFiles /SILENT "$EXEDIR\localized\distribution\modern-wizard.bmp" "$PLUGINSDIR\modern-wizard.bmp" @@ -571,6 +650,7 @@ Function preWelcome FunctionEnd Function preOptions + StrCpy $PageName "Options" ${If} ${FileExists} "$EXEDIR\localized\distribution\modern-header.bmp" ${AndIf} $hHeaderBitmap == "" Delete "$PLUGINSDIR\modern-header.bmp" @@ -613,6 +693,7 @@ Function leaveOptions FunctionEnd Function preDirectory + StrCpy $PageName "Directory" ${PreDirectoryCommon} FunctionEnd @@ -621,6 +702,7 @@ Function leaveDirectory FunctionEnd Function preShortcuts + StrCpy $PageName "Shortcuts" ${CheckCustomCommon} !insertmacro MUI_HEADER_TEXT "$(SHORTCUTS_PAGE_TITLE)" "$(SHORTCUTS_PAGE_SUBTITLE)" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "shortcuts.ini" @@ -637,6 +719,7 @@ Function leaveShortcuts FunctionEnd Function preStartMenu + StrCpy $PageName "StartMenu" ; With the Unicode installer the path to the application's Start Menu ; directory relative to the Start Menu's Programs directory is written to the ; shortcuts log ini file and is used to set the default Start Menu directory. @@ -676,6 +759,7 @@ Function leaveStartMenu FunctionEnd Function preSummary + StrCpy $PageName "Summary" ; Setup the summary.ini file for the Custom Summary Page WriteINIStr "$PLUGINSDIR\summary.ini" "Settings" NumFields "3" @@ -764,6 +848,7 @@ FunctionEnd ; When we add an optional action to the finish page the cancel button is ; enabled. This disables it and leaves the finish button as the only choice. Function preFinish + StrCpy $PageName "" ${EndInstallLog} "${BrandFullName}" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "cancelenabled" "0" FunctionEnd @@ -772,6 +857,7 @@ FunctionEnd # Initialization Functions Function .onInit + StrCpy $PageName "" StrCpy $LANGUAGE 0 ${SetBrandNameVars} "$EXEDIR\localized\distribution\setup.ini" diff --git a/toolkit/mozapps/installer/windows/nsis/common.nsh b/toolkit/mozapps/installer/windows/nsis/common.nsh index 521f8b30427..032961902cb 100755 --- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -339,6 +339,11 @@ # !insertmacro MOZ_MUI_LANGUAGEFILE_MULTILANGSTRING_PAGE FINISH "MUI_TEXT_FINISH_RUN" # !insertmacro MOZ_MUI_LANGUAGEFILE_MULTILANGSTRING_PAGE FINISH "MUI_TEXT_FINISH_SHOWREADME" +; Support for using the existing MUI_TEXT_ABORTWARNING string +!ifdef MOZ_MUI_CUSTOM_ABORT + LangString MOZ_MUI_TEXT_ABORTWARNING 0 "${MUI_TEXT_ABORTWARNING}" +!endif + !insertmacro MOZ_MUI_LANGUAGEFILE_LANGSTRING_DEFINE MUI_ABORTWARNING "MUI_TEXT_ABORTWARNING" @@ -4639,7 +4644,7 @@ ; Prevent launching the application when a reboot is required and this ; executable is the main application executable IfFileExists "$EXEDIR\${FileMainEXE}.moz-upgrade" +1 +4 - MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2 Reboot Quit ; Nothing initialized so no need to call OnEndCommon @@ -4656,7 +4661,7 @@ ; Prevent all operations (e.g. set as default, postupdate, etc.) when a ; reboot is required and the executable launched is helper.exe IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +4 - MessageBox MB_YESNO "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2 Reboot Quit ; Nothing initialized so no need to call OnEndCommon @@ -4877,12 +4882,12 @@ ${CanWriteToInstallDir} $R7 StrCmp $R7 "false" +1 +3 - MessageBox MB_OK "$R9" + MessageBox MB_OK|MB_ICONEXCLAMATION "$R9" Abort ${CheckDiskSpace} $R7 StrCmp $R7 "false" +1 +3 - MessageBox MB_OK "$R8" + MessageBox MB_OK|MB_ICONEXCLAMATION "$R8" Abort Pop $R7