Backed out changeset 841580134756 (bug 1263176) for bustage at nsOSHelperAppService.cpp on a CLOSED TREE.
authorGurzau Raul <rgurzau@mozilla.com>
Tue, 19 Nov 2019 04:00:00 +0200
changeset 502524 d214c50eaa95b59f120c7f1a499ca2be8a0b3020
parent 502523 dbb0fff9e65ce321b9bf2a7df7edb78cdc4288e2
child 502525 f5173fdbd7c6bb50a84256690d6c0d03d9da9426
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1263176
milestone72.0a1
backs out841580134756b1671f056a4e1e7d847436ea3aa5
Backed out changeset 841580134756 (bug 1263176) for bustage at nsOSHelperAppService.cpp on a CLOSED TREE.
uriloader/exthandler/win/nsOSHelperAppService.cpp
--- a/uriloader/exthandler/win/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp
@@ -295,27 +295,21 @@ nsresult nsOSHelperAppService::GetDefaul
   // XXX FIXME: If this fails, the UI will display the full command
   // string.
   // There are some rare cases this can happen - ["url.dll" -foo]
   // for example won't resolve correctly to the system dir. The
   // subsequent launch of the helper app will work though.
   nsCOMPtr<nsILocalFileWin> lf = new nsLocalFile();
   rv = lf->InitWithCommandLine(handlerCommand);
   NS_ENSURE_SUCCESS(rv, rv);
+
+  // The "FileDescription" field contains the actual name of the application.
+  lf->GetVersionInfoField("FileDescription", aDefaultDescription);
   lf.forget(aDefaultApplication);
 
-  wchar_t friendlyName[1024];
-  DWORD friendlyNameSize = 1024;
-  HRESULT hr = AssocQueryString(ASSOCF_NONE, ASSOCSTR_FRIENDLYAPPNAME,
-                                PromiseFlatString(aAppInfo).get(), NULL,
-                                friendlyName, &friendlyNameSize);
-  if (SUCCEEDED(hr)) {
-    aDefaultDescription.Assign(friendlyName);
-  }
-
   return NS_OK;
 }
 
 already_AddRefed<nsMIMEInfoWin> nsOSHelperAppService::GetByExtension(
     const nsString& aFileExt, const char* aTypeHint) {
   if (aFileExt.IsEmpty()) return nullptr;
 
   // Determine the mime type.