Closed Bug 404609 Opened 14 years ago Closed 13 years ago

Update Thunderbird installer with changes made to the Firefox installer

Categories

(Thunderbird :: Installer, defect, P2)

x86
Windows Vista
defect

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3

People

(Reporter: robert.strong.bugs, Assigned: robert.strong.bugs)

References

Details

Attachments

(4 files, 4 obsolete files)

Port bug 398036 to Thunderbird
Duplicate of this bug: 404589
I have two computers one laptop and one desktop. Bug 404609 refers to my laptop. The same situation is happening to my desktop.... the message I am receiving when 2.0.0.9 tries to activate the new upgrade the following message is received...
ONE OR MORE FILES COULD NOT BE UPDATED. PLEASE MAKE SURE ALL OTHER APPLICATIONS ARE CLOSED AND THAT YOU HAVE PERMISSION TO MODIFY FILES AND THEN RESTART THUNDERBIRD TO TRY AGAIN.

When you click ok the extract software window appears and the same process is followed.  This continues until I CTL/ALT/DEL and even then it takes three to four tries to stop the process.

This is getting extremely frustrating, however, this is the first time that I have had problems downloading upgrades.
Things are getting worse

I uninstalled Version 2.0.0.6 and then tried to download Version 2.0.0.9 on my desktop. Disaster!  2.0.0.9 would not load itself into the computer and it came up with the same error window as the laptop.

As a result my business has lost everything, address book etc which has caused a serious problem with my business.

Is there anyway that I can recover this, I tried a system restore but this did not work...... HELP......

Thank you.
Bob: Thunderbird support forums are here:
http://forums.mozillazine.org/viewforum.php?f=39

Anyway- reinstall into another (empty) folder usually sorts things out.
Thank you Magnus, well done - it did sort it out on my laptop I will try it on my desktop later on.........  Thank you so much, such a simple thing makes it right..... ahhhhh computers!!!!!!
Assignee: nobody → robert.bugzilla
Duplicate of this bug: 418140
Duplicate of this bug: 419758
Duplicate of this bug: 420009
Duplicate of this bug: 420203
Duplicate of this bug: 420286
Duplicate of this bug: 423053
(In reply to comment #0)
> Port bug 398036 to Thunderbird

The corresponding bug 398036 above was marked as blocking-firefox3. Nominating for blocking-thunderbird3 as well.
Flags: blocking-thunderbird3?
Duplicate of this bug: 436618
Duplicate of this bug: 436618
Duplicate of this bug: 436618
robert, are you still up for doing this bug? It seems popular!
Flags: wanted-thunderbird3.0a2+
Flags: blocking-thunderbird3?
Flags: blocking-thunderbird3+
David, I have most of it already completed though I'm not sure when I will have it finished due to other bugs, etc. So, anyone that wants to take this bug please do and if no one does I'll continue to try to finish it up
Robert: if you could attach a work in progress, that'd be useful to see if someone else can carry it over the endzone (using a football metaphor, ugh!).
Priority: -- → P2
David: I'm going to try to knock this out this weekend.
I've got most of this completed and will hopefully have it finished and tested tomorrow - 4/8/2008. I've ported over just about all of the installer and shell service changes that have landed for Firefox.
Quick update, I had to rework the patch to take into account bug 404541 and I have to rework the default Vista app check in the shell service. Should be done by Tuesday at the latest.
I've also included a fix for bug 444940.
Summary: Add file in use install support → Update Thunderbird installer with changes made to the Firefox installer
Blocks: 444940
Filed bug 445823 for feed protocol issues I have found while fixing this bug
Mark, could you review this? I'll add comments in this bug to explain the reasons for a couple of the changes that aren't necessarily obvious. I will attach an installer patch soon which is required for the functionality introduced by this patch.
Attachment #330087 - Flags: review?(bugzilla)
Comment on attachment 330087 [details] [diff] [review]
Shell Service and Command Line Handler

>Index: mail/components/nsMailDefaultHandler.js
>===================================================================
>RCS file: /cvsroot/mozilla/mail/components/nsMailDefaultHandler.js,v
>retrieving revision 1.11
>diff -u -8 -r1.11 nsMailDefaultHandler.js
>--- mail/components/nsMailDefaultHandler.js	16 Jan 2008 05:27:42 -0000	1.11
>+++ mail/components/nsMailDefaultHandler.js	17 Jul 2008 19:31:27 -0000
>@@ -340,21 +340,26 @@
> 
>       wwatch.openWindow(null, "chrome://messenger/content/", "_blank",
>                         "chrome,dialog=no,all", argstring);
>     }
>   },
> 
>   /* nsICommandLineValidator */
>   validate : function mdh_validate(cmdLine) {
>+    var osintFlagIdx = cmdLine.findFlag("osint", false);
>+    if (osintFlagIdx == -1)
>+      return;
>+
>     // Other handlers may use osint so only handle the osint flag if the mail
>     // or compose flag is also present and the command line is valid.
>-    var osintFlagIdx = cmdLine.findFlag("osint", false);
>     var mailFlagIdx = cmdLine.findFlag("mail", false);
>     var composeFlagIdx = cmdLine.findFlag("compose", false);
>+    if (mailFlagIdx == -1 && composeFlagIdx == -1)
>+      return;
The previous implementation made it impossible for additional command line handlers from registering with the OS and using the osint flag.

>Index: mail/components/shell/Makefile.in
>===================================================================
>RCS file: /cvsroot/mozilla/mail/components/shell/Makefile.in,v
>retrieving revision 1.6
>diff -u -8 -r1.6 Makefile.in
>--- mail/components/shell/Makefile.in	31 Mar 2008 07:50:44 -0000	1.6
>+++ mail/components/shell/Makefile.in	17 Jul 2008 19:31:27 -0000
>...
>+    ::ZeroMemory(currValue, sizeof(currValue));
>+    HKEY theKey;
>+    nsresult rv = OpenKeyForReading(HKEY_CLASSES_ROOT, key, &theKey);
>+    if (NS_FAILED(rv))
>     {
>-      offset = key.Find("%APPNAME%");
>-      key.Replace(offset, 9, aAppName);
>+      // Key doesn't exist
>+      isDefault = PR_FALSE;
>+      break;
>     }
See bug 445823 Comment #0
Attachment #330087 - Attachment is obsolete: true
Attachment #330090 - Flags: review?(bugzilla)
Attachment #330087 - Flags: review?(bugzilla)
file: mozilla/other-licenses/7zstub/thunderbird/7zSD.sfx

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="7zS.sfx.exe" type="win32"></assemblyIdentity><description>7-Zip Self-extracting Archive v4.42</description><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity></dependentAssembly></dependency><trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"><security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel></requestedPrivileges></security></trustInfo></assembly>
Attachment #330300 - Flags: review?(bugzilla)
Attached patch Installer patch (obsolete) — Splinter Review
Attachment #330301 - Flags: review?(bugzilla)
David, you might want to take a look at these changes. Thanks
Comment on attachment 330301 [details] [diff] [review]
Installer patch

Note: I have a couple of minor changes to make to the installer patch
Duplicate of this bug: 447916
Attachment #330301 - Attachment is obsolete: true
Attachment #330301 - Flags: review?(bugzilla)
Attached patch Installer patch rev 2 (obsolete) — Splinter Review
Attachment #331272 - Flags: review?(bugzilla)
This latest installer patch will benefit but doesn't need the patch from Bug 447928.
Comment on attachment 330300 [details]
Updated 7-zip stub with requestedExecutionLevel asInvoker

I assume you can reverse engineer these to the source, which is why we don't have the source in the tree?
Attachment #330300 - Flags: review?(bugzilla) → review+
(In reply to comment #34)
> (From update of attachment 330300 [details])
> I assume you can reverse engineer these to the source, which is why we don't
> have the source in the tree?
We actually have the source in the tree (bug 348781) but we compile it with VC 6 so we can use the earlier crt. We have historically modified VERSIONINFO and the manifest for the 7-Zip stub after it is compiled using reshacker which is what I have done here.
Comment on attachment 331272 [details] [diff] [review]
Installer patch rev 2

A couple of notes:

>Index: mail/installer/windows/nsis/installer.nsi
>===================================================================
>RCS file: /cvsroot/mozilla/mail/installer/windows/nsis/installer.nsi,v
>retrieving revision 1.19
>diff -u -8 -r1.19 installer.nsi
>--- mail/installer/windows/nsis/installer.nsi	30 Nov 2007 19:02:10 -0000	1.19
>+++ mail/installer/windows/nsis/installer.nsi	18 Jul 2008 21:31:42 -0000
>...
>+  ; Remove the updates directory for Vista and above
>+  ${CleanUpdatesDir} "Mozilla\Firefox"
This should be (I've changed it in my tree)
${CleanUpdatesDir} "Thunderbird"

>Index: mail/installer/windows/nsis/uninstaller.nsi
>===================================================================
>RCS file: /cvsroot/mozilla/mail/installer/windows/nsis/uninstaller.nsi,v
>retrieving revision 1.9
>diff -u -8 -r1.9 uninstaller.nsi
>--- mail/installer/windows/nsis/uninstaller.nsi	28 Sep 2007 00:48:32 -0000	1.9
>+++ mail/installer/windows/nsis/uninstaller.nsi	18 Jul 2008 21:31:42 -0000
>...
>   ; If firefox.exe was successfully deleted yet we still need to restart to
>   ; remove other files create a dummy firefox.exe.moz-delete to prevent the
Also changed both references to firefox.exe to thunderbird.exe
Comment on attachment 331272 [details] [diff] [review]
Installer patch rev 2


>Index: mail/installer/windows/nsis/installer.nsi
>@@ -150,19 +158,21 @@
> !else
> !define MUI_HEADERIMAGE_BITMAP wizHeader.bmp
> !endif
> 
> /**
>  * Installation Pages
>  */
> ; Welcome Page
>+!define MUI_PAGE_CUSTOMFUNCTION_PRE preWelcome
> !insertmacro MUI_PAGE_WELCOME
> 
> ; License Page
>+!define MUI_PAGE_CUSTOMFUNCTION_SHOW showLicense
> !define MUI_LICENSEPAGE_CHECKBOX
> !insertmacro MUI_PAGE_LICENSE license.rtf
> 
> ; Custom Options Page
> Page custom preOptions leaveOptions
> 
> ; Custom Components Page
> Page custom preComponents leaveComponents
>@@ -173,145 +183,92 @@
> !define MUI_DIRECTORYPAGE_VERIFYONLEAVE
> !insertmacro MUI_PAGE_DIRECTORY
> 
> ; Custom Shortcuts Page
> Page custom preShortcuts leaveShortcuts
> 
> ; Start Menu Folder Page Configuration
> !define MUI_PAGE_CUSTOMFUNCTION_PRE preStartMenu
>+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE leaveStartMenu
> !define MUI_STARTMENUPAGE_NODISABLE
> !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
> !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Main"
> !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
> !insertmacro MUI_PAGE_STARTMENU Application $StartMenuDir
> 
> ; Custom Summary Page
> Page custom preSummary leaveSummary
> 
> ; Install Files Page
> !insertmacro MUI_PAGE_INSTFILES
> 
> ; Finish Page
>-!define MUI_FINISHPAGE_NOREBOOTSUPPORT
> !define MUI_FINISHPAGE_TITLE_3LINES
> !define MUI_FINISHPAGE_RUN
> !define MUI_FINISHPAGE_RUN_FUNCTION LaunchApp
> !define MUI_FINISHPAGE_RUN_TEXT $(LAUNCH_TEXT)
> !define MUI_PAGE_CUSTOMFUNCTION_PRE preFinish
> !insertmacro MUI_PAGE_FINISH
> 
>+  ; Delete the app exe to prevent launching the app while we are installing.
>   ClearErrors

>+  ${DeleteFile} "$INSTDIR\${FileMainEXE}"
>+  ${If} ${Errors}
>+    ; If the user closed the application it can take several seconds for it to
>+    ; shut down completely. If the application is being used by another user we
>+    ; can rename the file and then delete is when the system is restarted.
>+    Sleep 5000
>+    ${DeleteFile} "$INSTDIR\${FileMainEXE}"
>+    ClearErrors
>   ${EndIf}

What happens if it fails on the second delete? This looks like it will just continue on.

>+Function preWelcome
>+  ${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"
>+  ${EndIf}
>+FunctionEnd

Are modern-wizard.bmp and modern-header.bmp part of the nsis distribution?

The rest seems ok to me, would you be able to email me (direct) a copy of the installer that I could try out? I think once I've given it a quick run, then the best place to test this will be out in the wild.
Comment on attachment 330090 [details] [diff] [review]
Shell Service and Command Line Handler - also change SetDefaultClient to use W api's

> nsresult nsWindowsShellService::Init()
> {
>   nsresult rv;
> 
>+  PRUnichar appPath[MAX_BUF];
>+  if (!::GetModuleFileNameW(0, appPath, MAX_BUF))
>     return NS_ERROR_FAILURE;
> 
>   mAppLongPath = appPath;
> 
>   nsCOMPtr<nsILocalFile> lf;
>+  rv = NS_NewLocalFile(mAppLongPath, PR_TRUE, getter_AddRefs(lf));
>   NS_ENSURE_SUCCESS(rv, rv);
> 
>   nsCOMPtr<nsIFile> appDir;
>   rv = lf->GetParent(getter_AddRefs(appDir));
>   NS_ENSURE_SUCCESS(rv, rv);
> 
>   // Support short path to the exe so if it is already set the user is not
>   // prompted to set the default mail client again.
>+  if (!::GetShortPathNameW(appPath, appPath, sizeof(appPath)))
>     return NS_ERROR_FAILURE;
> 
>+  mAppShortPath = appPath;
> 
>-  rv = NS_NewNativeLocalFile(mAppLongPath, PR_TRUE, getter_AddRefs(lf));
>-  NS_ENSURE_SUCCESS(rv, rv);
>-
>-  rv = lf->SetNativeLeafName(nsDependentCString("mozMapi32.dll"));
>-  NS_ENSURE_SUCCESS(rv, rv);
>-
>-  return lf->GetNativePath(mMapiDLLPath);
>+  return NS_OK;
> }

I think you can drop lf and appDir from here. As they will no longer be used (note, I've removed some of the - lines from here).
(In reply to comment #37)
> (From update of attachment 331272 [details] [diff] [review])
> ...
> > 
> >+  ; Delete the app exe to prevent launching the app while we are installing.
> >   ClearErrors
> 
> >+  ${DeleteFile} "$INSTDIR\${FileMainEXE}"
> >+  ${If} ${Errors}
> >+    ; If the user closed the application it can take several seconds for it to
> >+    ; shut down completely. If the application is being used by another user we
> >+    ; can rename the file and then delete is when the system is restarted.
> >+    Sleep 5000
> >+    ${DeleteFile} "$INSTDIR\${FileMainEXE}"
> >+    ClearErrors
> >   ${EndIf}
> 
> What happens if it fails on the second delete? This looks like it will just
> continue on.
We continue on as you noted and install the files on restart (e.g. files in use support from bug 398036)

> >+Function preWelcome
> >+  ${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"
> >+  ${EndIf}
> >+FunctionEnd
> 
> Are modern-wizard.bmp and modern-header.bmp part of the nsis distribution?
They are but we supplu our own which are renamed to these filenames. This is suppport for bug 399381

> The rest seems ok to me, would you be able to email me (direct) a copy of the
> installer that I could try out? I think once I've given it a quick run, then
> the best place to test this will be out in the wild.
Will do
(In reply to comment #38)
>...
> I think you can drop lf and appDir from here. As they will no longer be used
> (note, I've removed some of the - lines from here).
You are correct and thanks for catching that,
(In reply to comment #39)
> (In reply to comment #37)
>...
> > The rest seems ok to me, would you be able to email me (direct) a copy of the
> > installer that I could try out? I think once I've given it a quick run, then
> > the best place to test this will be out in the wild.
> Will do
Email sent
Attachment #330090 - Attachment is obsolete: true
Attachment #331336 - Flags: review?(bugzilla)
Attachment #330090 - Flags: review?(bugzilla)
Attachment #331272 - Attachment is obsolete: true
Attachment #331337 - Flags: review?(bugzilla)
Attachment #331272 - Flags: review?(bugzilla)
Duplicate of this bug: 448181
Comment on attachment 331336 [details] [diff] [review]
Shell Service and Command Line Handler - updated to comments

The installer seemed to work fine on xp, lets get this out into the wild for some more testing.
Attachment #331336 - Flags: review?(bugzilla) → review+
Attachment #331337 - Flags: review?(bugzilla) → review+
Mark, do you want me to check this in to comm-central first, comm-central and CVS at the same time, or some other order to check this in?
(In reply to comment #46)
> Mark, do you want me to check this in to comm-central first, comm-central and
> CVS at the same time, or some other order to check this in?
> 
Robert, just comm-central will do. We're only using comm-central for TB 3 development now (cvs is obsolete apart from the 1.8/TB 2 branch).
One last thing... the Thunderbird 7zSD.sfx will be checked in to mozilla-central since comm-central doesn't contain it and mozilla-central does. Correct?
(In reply to comment #48)
> One last thing... the Thunderbird 7zSD.sfx will be checked in to
> mozilla-central since comm-central doesn't contain it and mozilla-central does.
> Correct?
> 
Yes (they will probably be moved across at some stage, but for now mozilla-central will do).
Thanks Mark, I'm going to land this sometime Tuesday pacific time so I'll be awake to watch the tree
For the time being I've removed the case insensitivity of the path comparison in the shell service due to bustage on "Win2k3 comm-central check"... changed

+    if (REG_FAILED(result) ||
+        !dataLongPath.Equals(currValue, nsCaseInsensitiveStringComparator()) &&
+        !dataShortPath.Equals(currValue, nsCaseInsensitiveStringComparator()))

to

+    if (REG_FAILED(result) ||
+        !dataLongPath.Equals(currValue) &&
+        !dataShortPath.Equals(currValue))
reopening until attachment #332442 [details] [diff] [review] lands
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 332442 [details] [diff] [review]
followup patch to restore case insensitive compare and fix bustage on Win2k3 comm-central check

Hey David, in case Mark isn't able to get to this soon so I can check this in tonight I'm also asking you for review.
Attachment #332442 - Flags: review?(bienvenu)
Comment on attachment 332442 [details] [diff] [review]
followup patch to restore case insensitive compare and fix bustage on Win2k3 comm-central check

thx for the fix, Rob. One nit,
generally, we do this:

#ifdef MOZILLA_INTERNAL_API
...nsCaseInsensitiveStringComparator()
#else
...CaseInsensitiveCompare
#endif
Attachment #332442 - Flags: review?(bienvenu) → review+
(In reply to comment #56)
> (From update of attachment 332442 [details] [diff] [review])
> thx for the fix, Rob. One nit,
> generally, we do this:
> 
> #ifdef MOZILLA_INTERNAL_API
> ...nsCaseInsensitiveStringComparator()
> #else
> ...CaseInsensitiveCompare
> #endif
I considered that but the makefile forces MOZILLA_INTERNAL_API = 1 on Windows. The header has #include "nsString.h" instead of #include "nsStringGlue.h" and I am unsure if there are other parts of the file that will need to be #ifdef'd so I checked it in as is.

Checked in to comm-central
changeset:61:ea479bed5229
http://hg.mozilla.org/comm-central/index.cgi/rev/ea479bed5229
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Attachment #332442 - Flags: review?(bugzilla)
right, MOZILLA_INTERNAL_API is on everywhere now; we're just trying to pave the way to turning it off...
(In reply to comment #58)
> right, MOZILLA_INTERNAL_API is on everywhere now; we're just trying to pave the
> way to turning it off...
> 
True, though for the record I'm not too fussed about this for now in the installer especially as we've not migrated any of mail/ for windows yet.
Target Milestone: --- → Thunderbird 3
Duplicate of this bug: 438636
Duplicate of this bug: 375922
Duplicate of this bug: 384669
Duplicate of this bug: 382697
Duplicate of this bug: 385847
Duplicate of this bug: 392590
Duplicate of this bug: 417950
Duplicate of this bug: 449637
Duplicate of this bug: 450514
Comment on attachment 331337 [details] [diff] [review]
Installer patch rev3 - updated to comment #36

>--- mail/installer/windows/nsis/shared.nsh	18 Sep 2007 02:47:34 -0000	1.9
>+++ mail/installer/windows/nsis/shared.nsh	25 Jul 2008 19:10:35 -0000
>@@ -31,102 +31,216 @@
> !macro PostUpdate
[...]
>+    ; Only update the Clients\Mail registry key values if they don't exist or
>+    ; this installation is the same as the one set in those keys.
>+    ReadRegStr $0 HKLM "Software\Clients\Mail\${ClientsRegName}\DefaultIcon" ""
>+    ${GetPathFromString} "$0" $0
>+    ${GetParent} "$0" $0
>+    ${If} ${FileExists} "$0"
>+      ${GetLongPath} "$0" $0
>+    ${EndIf}
>+    ${If} "$0" == "$INSTDIR"
>+      ${SetClientsMail}
>+    ${EndIf}

Rob: Is that code/comment correct? I do not see where it updates the registry key values using SetClientsMail when those keys do not exist. Or is this a general comment which points out all possibilities that exist within Thunderbird (installer) for updating those reg keys?
You are correct though I'm not positive what the additional check should be... I'll look into this during the week
No longer blocks: 449423
Depends on: 470913
Duplicate of this bug: 467789
Depends on: 482966
Robert, could c#69 and 70 help explain bug 482966 ?
Possibly. I'll comment in bug 482966
No longer depends on: 482966
You need to log in before you can comment on or make changes to this bug.