Bug 859604 - Install button text should be Upgrade when installing on top of an existing version. r=bbondy - Windows stub installer which is only built when building the nightly so DONTBUILD
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 01 May 2013 13:55:42 -0700
changeset 130537 024eef52799d14a434e4e17f6616720859f7dc70
parent 130536 1d82018a97724792f3d5ee772b4485f18f40d3c4
child 130538 47ad2545d5f5c420cbc956e340c3968ed625455f
push id24621
push userphilringnalda@gmail.com
push dateThu, 02 May 2013 03:27:34 +0000
treeherdermozilla-central@0274ab3783b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy
bugs859604
milestone23.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 859604 - Install button text should be Upgrade when installing on top of an existing version. r=bbondy - Windows stub installer which is only built when building the nightly so DONTBUILD
browser/installer/windows/nsis/stub.nsi
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -693,17 +693,21 @@ Function createIntro
   Pop $2
   ${SetStretchedTransparentImage} $2 $PLUGINSDIR\appname.bmp $0
 
   ${NSD_CreateBitmap} 0 0 100% 100% ""
   Pop $2
   ${NSD_SetStretchedImage} $2 $PLUGINSDIR\bgintro.bmp $1
 
   GetDlgItem $0 $HWNDPARENT 1 ; Install button
-  SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
+  ${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
+    SendMessage $0 ${WM_SETTEXT} 0 "STR:$(UPGRADE_BUTTON)"
+  ${Else}
+    SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
+  ${EndIf}
   ${NSD_SetFocus} $0
 
   GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(CANCEL_BUTTON)"
 
   GetDlgItem $0 $HWNDPARENT 3 ; Back button used for Options
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(OPTIONS_BUTTON)"
 
@@ -944,17 +948,21 @@ Function createOptions
       SetCtlColors $CheckboxInstallMaintSvc ${OPTIONS_TEXT_COLOR_NORMAL} ${OPTIONS_BKGRD_COLOR}
       SendMessage $CheckboxInstallMaintSvc ${WM_SETFONT} $FontNormal 0
       ${NSD_Check} $CheckboxInstallMaintSvc
     ${EndIf}
   ${EndIf}
 !endif
 
   GetDlgItem $0 $HWNDPARENT 1 ; Install button
-  SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
+  ${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
+    SendMessage $0 ${WM_SETTEXT} 0 "STR:$(UPGRADE_BUTTON)"
+  ${Else}
+    SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
+  ${EndIf}
   ${NSD_SetFocus} $0
 
   GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
   SendMessage $0 ${WM_SETTEXT} 0 "STR:$(CANCEL_BUTTON)"
 
   GetDlgItem $0 $HWNDPARENT 3 ; Back button used for Options
   EnableWindow $0 0
   ShowWindow $0 ${SW_HIDE}
@@ -964,17 +972,17 @@ Function createOptions
   ${If} "$WasOptionsButtonClicked" != "1"
     ${If} "$CanWriteToInstallDir" == "false"
       MessageBox MB_OK|MB_ICONEXCLAMATION "$(WARN_WRITE_ACCESS)"
     ${ElseIf} "$HasRequiredSpaceAvailable" == "false"
       MessageBox MB_OK|MB_ICONEXCLAMATION "$(WARN_DISK_SPACE)"
     ${EndIf}
   ${EndIf}
 
-  IntOp $OptionsPageShownCount $OptionsPageShownCount + 1
+  StrCpy $OptionsPageShownCount "1"
 
   System::Call "kernel32::GetTickCount()l .s"
   Pop $StartOptionsPhaseTickCount
 
   LockWindow off
   nsDialogs::Show
 FunctionEnd
 
@@ -1676,16 +1684,23 @@ Function UpdateFreeSpaceLabel
 
 FunctionEnd
 
 Function OnChange_DirRequest
   Pop $0
   System::Call 'user32::GetWindowTextW(i $DirRequest, w .r0, i ${NSIS_MAX_STRLEN})'
   StrCpy $INSTDIR "$0"
   Call UpdateFreeSpaceLabel
+
+  GetDlgItem $0 $HWNDPARENT 1 ; Install button
+  ${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
+    SendMessage $0 ${WM_SETTEXT} 0 "STR:$(UPGRADE_BUTTON)"
+  ${Else}
+    SendMessage $0 ${WM_SETTEXT} 0 "STR:$(INSTALL_BUTTON)"
+  ${EndIf}
 FunctionEnd
 
 Function OnClick_ButtonBrowse
   ; The call to GetLongPath returns a long path without a trailing
   ; back-slash. Append a \ to the path to prevent the directory
   ; name from being appended when using the NSIS create new folder.
   ; http://www.nullsoft.com/free/nsis/makensis.htm#InstallDir
   StrCpy $0 "$INSTDIR" "" -1 ; the last character