From 3afe94176e306816625ace3eecb828fa2ed307c7 Mon Sep 17 00:00:00 2001 From: "rob_strong%exchangecode.com" Date: Sat, 29 Sep 2007 09:48:38 +0000 Subject: [PATCH] Bug 370571 - Ability to install as a standard user on Vista is not available. r=sspitzer a=beltzner (blocking-firefox3) git-svn-id: svn://10.0.0.236/trunk@236912 18797224-902f-48f8-a5cc-f745e15eee43 --- .../shell/src/nsWindowsShellService.cpp | 460 ++---------- .../installer/windows/nsis/installer.nsi | 81 ++- .../browser/installer/windows/nsis/shared.nsh | 381 ++++++---- .../installer/windows/nsis/uninstaller.nsi | 80 ++- .../other-licenses/7zstub/firefox/7zSD.sfx | Bin 121344 -> 122368 bytes .../windows/nsis/SetVistaDefaultApp.dll | Bin 0 -> 2560 bytes .../mozapps/installer/windows/nsis/UAC.dll | Bin 0 -> 13824 bytes .../mozapps/installer/windows/nsis/common.nsh | 661 +++++++++++++++++- .../installer/windows/nsis/makensis.mk | 2 + mozilla/toolkit/xre/nsAppRunner.cpp | 16 - mozilla/toolkit/xre/nsIWinAppHelper.idl | 3 +- 11 files changed, 1074 insertions(+), 610 deletions(-) create mode 100755 mozilla/toolkit/mozapps/installer/windows/nsis/SetVistaDefaultApp.dll create mode 100755 mozilla/toolkit/mozapps/installer/windows/nsis/UAC.dll diff --git a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp index c4b6c95f57b..c7cd9fda747 100644 --- a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp +++ b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp @@ -23,7 +23,7 @@ * Joe Hewitt (Set Background) * Blake Ross (Desktop Color, DDE support) * Jungshik Shin (I18N) - * Robert Strong (Long paths, DDE) + * Robert Strong * Asaf Romano * Ryan Jones * @@ -60,6 +60,7 @@ #include "nsBrowserCompsCID.h" #include "nsDirectoryServiceUtils.h" #include "nsAppDirectoryServiceDefs.h" +#include "nsDirectoryServiceDefs.h" #include "nsIWindowsRegKey.h" #include "nsUnicharUtils.h" @@ -82,63 +83,18 @@ NS_IMPL_ISUPPORTS2(nsWindowsShellService, nsIWindowsShellService, nsIShellService) static nsresult -OpenUserKeyForReading(HKEY aStartKey, const nsAString& aKeyName, HKEY* aKey) +OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey) { const nsString &flatName = PromiseFlatString(aKeyName); - DWORD res = ::RegOpenKeyExW(aStartKey, flatName.get(), 0, KEY_READ, aKey); + DWORD res = ::RegOpenKeyExW(aKeyRoot, flatName.get(), 0, KEY_READ, aKey); switch (res) { case ERROR_SUCCESS: break; case ERROR_ACCESS_DENIED: return NS_ERROR_FILE_ACCESS_DENIED; case ERROR_FILE_NOT_FOUND: - if (aStartKey == HKEY_LOCAL_MACHINE) { - // prevent infinite recursion on the second pass through here if - // ::RegOpenKeyEx fails in the all-users case. - return NS_ERROR_NOT_AVAILABLE; - } - return OpenUserKeyForReading(HKEY_LOCAL_MACHINE, aKeyName, aKey); - } - - return NS_OK; -} - -// Sets the default browser registry keys for Windows versions prior to Vista. -// Try to open / create the key in HKLM and if that fails try to do the same -// in HKCU. Though this is not strictly the behavior I would expect it is the -// same behavior that IE has when setting the default browser previous to Vista. -static nsresult -OpenKeyForWriting(HKEY aStartKey, const nsAString& aKeyName, HKEY* aKey, - PRBool aHKLMOnly) -{ - const nsString &flatName = PromiseFlatString(aKeyName); - - DWORD dwDisp = 0; - DWORD res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL, - 0, KEY_READ | KEY_WRITE, NULL, aKey, - &dwDisp); - switch (res) { - case ERROR_SUCCESS: - break; - case ERROR_ACCESS_DENIED: - if (aHKLMOnly || aStartKey == HKEY_CURRENT_USER) - return NS_ERROR_FILE_ACCESS_DENIED; - // fallback to HKCU immediately on access denied since we won't be able - // to create the key. - return OpenKeyForWriting(HKEY_CURRENT_USER, aKeyName, aKey, aHKLMOnly); - case ERROR_FILE_NOT_FOUND: - res = ::RegCreateKeyExW(aStartKey, flatName.get(), 0, NULL, - 0, KEY_READ | KEY_WRITE, NULL, aKey, - NULL); - if (res != ERROR_SUCCESS) { - if (aHKLMOnly || aStartKey == HKEY_CURRENT_USER) { - // prevent infinite recursion on the second pass through here if - // ::RegCreateKey fails in the current user case. - return NS_ERROR_FILE_ACCESS_DENIED; - } - return OpenKeyForWriting(HKEY_CURRENT_USER, aKeyName, aKey, aHKLMOnly); - } + return NS_ERROR_NOT_AVAILABLE; } return NS_OK; @@ -147,6 +103,9 @@ OpenKeyForWriting(HKEY aStartKey, const nsAString& aKeyName, HKEY* aKey, /////////////////////////////////////////////////////////////////////////////// // Default Browser Registry Settings // +// The setting of these values are made by an external binary since writing +// these values may require elevation. +// // - File Extension Mappings // ----------------------- // The following file extensions: @@ -214,9 +173,6 @@ typedef enum { NO_SUBSTITUTION = 0x00, APP_PATH_SUBSTITUTION = 0x01, EXE_NAME_SUBSTITUTION = 0x02, - UNINST_PATH_SUBSTITUTION = 0x04, - HKLM_ONLY = 0x08, - NON_ESSENTIAL = 0x10 } SettingFlags; typedef struct { @@ -228,17 +184,8 @@ typedef struct { } SETTING; #define APP_REG_NAME L"Firefox" -#define SMI "SOFTWARE\\Clients\\StartMenuInternet\\" -#define CLS "SOFTWARE\\Classes\\" #define DI "\\DefaultIcon" -#define II "\\InstallInfo" #define SOP "\\shell\\open\\command" -#define DDE "\\shell\\open\\ddeexec\\" -#define DDE_NAME "Firefox" // This must be kept in sync with ID_DDE_APPLICATION_NAME as defined in splash.rc -#define DDE_COMMAND "\"%1\",,0,0,,,," -// For the InstallInfo HideIconsCommand, ShowIconsCommand, and ReinstallCommand -// registry keys. This must be kept in sync with the uninstaller. -#define UNINSTALL_EXE "\\uninstall\\helper.exe" #define CLS_HTML "FirefoxHTML" #define CLS_URL "FirefoxURL" @@ -248,93 +195,24 @@ typedef struct { #define MAKE_KEY_NAME1(PREFIX, MID) \ PREFIX MID -#define MAKE_KEY_NAME2(PREFIX, MID, SUFFIX) \ - PREFIX MID SUFFIX - -#define MAKE_KEY_NAME3(PREFIX, MID, MID2, SUFFIX) \ - PREFIX MID MID2 SUFFIX - -// The DefaultIcon registry key value should never be used (e.g. NON_ESSENTIAL) -// when checking if Firefox is the default browser since other applications -// (e.g. MS Office) may modify the DefaultIcon registry key value to add Icon -// Handlers. +// The DefaultIcon registry key value should never be used when checking if +// Firefox is the default browser since other applications (e.g. MS Office) may +// modify the DefaultIcon registry key value to add Icon Handlers. // see http://msdn2.microsoft.com/en-us/library/aa969357.aspx for more info. static SETTING gSettings[] = { - // File Extension Aliases - { MAKE_KEY_NAME1(CLS, ".htm"), "", CLS_HTML, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME1(CLS, ".html"), "", CLS_HTML, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME1(CLS, ".shtml"), "", CLS_HTML, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME1(CLS, ".xht"), "", CLS_HTML, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME1(CLS, ".xhtml"), "", CLS_HTML, NO_SUBSTITUTION | NON_ESSENTIAL }, - // File Extension Class - as of 1.8.1.2 the value for VAL_OPEN is also checked // for CLS_HTML since Firefox should also own opeing local files when set as // the default browser. - { MAKE_KEY_NAME2(CLS, CLS_HTML, DI), "", VAL_FILE_ICON, APP_PATH_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(CLS, CLS_HTML, SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION }, + { MAKE_KEY_NAME1(CLS_HTML, SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION }, // Protocol Handler Class - for Vista and above - { MAKE_KEY_NAME2(CLS, CLS_URL, DI), "", VAL_FILE_ICON, APP_PATH_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(CLS, CLS_URL, SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION }, + { MAKE_KEY_NAME1(CLS_URL, SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION }, // Protocol Handlers - { MAKE_KEY_NAME2(CLS, "HTTP", DI), "", VAL_FILE_ICON, APP_PATH_SUBSTITUTION }, - { MAKE_KEY_NAME2(CLS, "HTTP", SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION }, - { MAKE_KEY_NAME2(CLS, "HTTPS", DI), "", VAL_FILE_ICON, APP_PATH_SUBSTITUTION }, - { MAKE_KEY_NAME2(CLS, "HTTPS", SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION }, - { MAKE_KEY_NAME2(CLS, "FTP", DI), "", VAL_FILE_ICON, APP_PATH_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(CLS, "FTP", SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION | NON_ESSENTIAL }, - - // DDE settings - { MAKE_KEY_NAME2(CLS, CLS_HTML, DDE), "", DDE_COMMAND, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, CLS_HTML, DDE, "Application"), "", DDE_NAME, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, CLS_HTML, DDE, "Topic"), "", "WWW_OpenURL", NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(CLS, CLS_URL, DDE), "", DDE_COMMAND, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, CLS_URL, DDE, "Application"), "", DDE_NAME, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, CLS_URL, DDE, "Topic"), "", "WWW_OpenURL", NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(CLS, "HTTP", DDE), "", DDE_COMMAND, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, "HTTP", DDE, "Application"), "", DDE_NAME, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, "HTTP", DDE, "Topic"), "", "WWW_OpenURL", NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(CLS, "HTTPS", DDE), "", DDE_COMMAND, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, "HTTPS", DDE, "Application"), "", DDE_NAME, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, "HTTPS", DDE, "Topic"), "", "WWW_OpenURL", NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(CLS, "FTP", DDE), "", DDE_COMMAND, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, "FTP", DDE, "Application"), "", DDE_NAME, NO_SUBSTITUTION | NON_ESSENTIAL }, - { MAKE_KEY_NAME3(CLS, "FTP", DDE, "Topic"), "", "WWW_OpenURL", NO_SUBSTITUTION | NON_ESSENTIAL }, - - // Windows XP Start Menu - { MAKE_KEY_NAME2(SMI, "%APPEXE%", DI), - "", - "%APPPATH%,0", - APP_PATH_SUBSTITUTION | EXE_NAME_SUBSTITUTION | HKLM_ONLY | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(SMI, "%APPEXE%", II), - "HideIconsCommand", - "\"%UNINSTPATH%\" /HideShortcuts", - UNINST_PATH_SUBSTITUTION | EXE_NAME_SUBSTITUTION | HKLM_ONLY | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(SMI, "%APPEXE%", II), - "ReinstallCommand", - "\"%UNINSTPATH%\" /SetAsDefaultAppGlobal", - UNINST_PATH_SUBSTITUTION | EXE_NAME_SUBSTITUTION | HKLM_ONLY | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(SMI, "%APPEXE%", II), - "ShowIconsCommand", - "\"%UNINSTPATH%\" /ShowShortcuts", - UNINST_PATH_SUBSTITUTION | EXE_NAME_SUBSTITUTION | HKLM_ONLY | NON_ESSENTIAL }, - { MAKE_KEY_NAME2(SMI, "%APPEXE%", SOP), - "", - "%APPPATH%", - APP_PATH_SUBSTITUTION | EXE_NAME_SUBSTITUTION | HKLM_ONLY | NON_ESSENTIAL }, - { MAKE_KEY_NAME1(SMI, "%APPEXE%\\shell\\properties\\command"), - "", - "\"%APPPATH%\" -preferences", - APP_PATH_SUBSTITUTION | EXE_NAME_SUBSTITUTION | HKLM_ONLY | NON_ESSENTIAL }, - { MAKE_KEY_NAME1(SMI, "%APPEXE%\\shell\\safemode\\command"), - "", - "\"%APPPATH%\" -safe-mode", - APP_PATH_SUBSTITUTION | EXE_NAME_SUBSTITUTION | HKLM_ONLY | NON_ESSENTIAL } - - // These values must be set by hand, since they contain localized strings. - // firefox.exe\shell\properties (default) REG_SZ Firefox &Options - // firefox.exe\shell\safemode (default) REG_SZ Firefox &Safe Mode + { MAKE_KEY_NAME1("HTTP", DI), "", VAL_FILE_ICON, APP_PATH_SUBSTITUTION }, + { MAKE_KEY_NAME1("HTTP", SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION }, + { MAKE_KEY_NAME1("HTTPS", DI), "", VAL_FILE_ICON, APP_PATH_SUBSTITUTION }, + { MAKE_KEY_NAME1("HTTPS", SOP), "", VAL_OPEN, APP_PATH_SUBSTITUTION } }; @@ -411,39 +289,15 @@ nsWindowsShellService::IsDefaultBrowserVista(PRBool aStartupCheck, PRBool* aIsDe return PR_FALSE; } -PRBool -nsWindowsShellService::SetDefaultBrowserVista() -{ - IApplicationAssociationRegistration* pAAR; - - HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationReg, - NULL, - CLSCTX_INPROC, - IID_IApplicationAssociationReg, - (void**)&pAAR); - - if (SUCCEEDED(hr)) { - hr = pAAR->SetAppAsDefaultAll(APP_REG_NAME); - - pAAR->Release(); - return PR_TRUE; - } - - return PR_FALSE; -} - NS_IMETHODIMP nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck, PRBool* aIsDefaultBrowser) { - // To support side by side installs on Vista we also need to check if the - // FirefoxHTML and FirefoxURL registry keys in HKLM / HKCU point to our - // install location. If the HKLM keys point to this install location we have - // to verify that the keys don't exist in HKCU and remove them if the app is - // then set as default. If the HKLM keys don't point to this install location - // then we have to add these keys in HKCU to over-ride the HKLM keys. - if (IsDefaultBrowserVista(aStartupCheck, aIsDefaultBrowser)) - return NS_OK; + // If this is the first browser window, maintain internal state that we've + // checked this session (so that subsequent window opens don't show the + // default browser dialog). + if (aStartupCheck) + mCheckedThisSession = PR_TRUE; SETTING* settings; SETTING* end = gSettings + sizeof(gSettings)/sizeof(SETTING); @@ -478,9 +332,6 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck, PRUnichar currValue[MAX_BUF]; for (settings = gSettings; settings < end; ++settings) { - if (settings->flags & NON_ESSENTIAL) - continue; // This is not a registry key that determines whether - // or not we consider Firefox the "Default Browser." NS_ConvertUTF8toUTF16 dataLongPath(settings->valueData); NS_ConvertUTF8toUTF16 dataShortPath(settings->valueData); NS_ConvertUTF8toUTF16 key(settings->keyName); @@ -502,7 +353,7 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck, ::ZeroMemory(currValue, sizeof(currValue)); HKEY theKey; - rv = OpenUserKeyForReading(HKEY_CURRENT_USER, key, &theKey); + rv = OpenKeyForReading(HKEY_CLASSES_ROOT, key, &theKey); if (NS_SUCCEEDED(rv)) { DWORD len = sizeof currValue; DWORD res = ::RegQueryValueExW(theKey, PromiseFlatString(value).get(), @@ -514,252 +365,62 @@ nsWindowsShellService::IsDefaultBrowser(PRBool aStartupCheck, !dataShortPath.Equals(currValue, CaseInsensitiveCompare)) { // Key wasn't set, or was set to something else (something else became the default browser) *aIsDefaultBrowser = PR_FALSE; - break; + return NS_OK; } } } - // If this is the first browser window, maintain internal state that we've - // checked this session (so that subsequent window opens don't show the - // default browser dialog). - if (aStartupCheck) - mCheckedThisSession = PR_TRUE; + // Only check if Firefox is the default browser on Vista if the previous + // checks show that Firefox is the default browser. + if (aIsDefaultBrowser) + IsDefaultBrowserVista(aStartupCheck, aIsDefaultBrowser); return NS_OK; } -DWORD -nsWindowsShellService::DeleteRegKeyDefaultValue(HKEY baseKey, - const nsString& keyName) -{ - HKEY key; - DWORD res = ::RegOpenKeyExW(baseKey, keyName.get(), - 0, KEY_WRITE, &key); - if (res == ERROR_SUCCESS) { - res = ::RegDeleteValueW(key, EmptyString().get()); - ::RegCloseKey(key); - } - - return res; -} - NS_IMETHODIMP nsWindowsShellService::SetDefaultBrowser(PRBool aClaimAllTypes, PRBool aForAllUsers) { - // Delete the protocol and file handlers under HKCU if they exist. This way - // the HKCU registry is cleaned up when HKLM is writeable or if it isn't - // the values will then be added under HKCU. - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\http\\shell\\open")); - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\http\\DefaultIcon")); - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\https\\shell\\open")); - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\https\\DefaultIcon")); - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\ftp\\shell\\open")); - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\ftp\\DefaultIcon")); - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\FirefoxURL")); - (void)DeleteRegKey(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\FirefoxHTML")); + nsresult rv; + nsCOMPtr directoryService = + do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); - (void)DeleteRegKeyDefaultValue(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\.htm")); - (void)DeleteRegKeyDefaultValue(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\.html")); - (void)DeleteRegKeyDefaultValue(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\.shtml")); - (void)DeleteRegKeyDefaultValue(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\.xht")); - (void)DeleteRegKeyDefaultValue(HKEY_CURRENT_USER, - NS_LITERAL_STRING("Software\\Classes\\.xhtml")); + nsCOMPtr appHelper; + rv = directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(appHelper)); + NS_ENSURE_SUCCESS(rv, rv); - if (!aForAllUsers && SetDefaultBrowserVista()) - return NS_OK; + rv = appHelper->AppendNative(NS_LITERAL_CSTRING("uninstall")); + NS_ENSURE_SUCCESS(rv, rv); - SETTING* settings; - SETTING* end = gSettings + sizeof(gSettings)/sizeof(SETTING); + rv = appHelper->AppendNative(NS_LITERAL_CSTRING("helper.exe")); + NS_ENSURE_SUCCESS(rv, rv); - PRUnichar exePath[MAX_BUF]; - if (!::GetModuleFileNameW(0, exePath, MAX_BUF)) - return NS_ERROR_FAILURE; + nsCAutoString appHelperPath; + rv = appHelper->GetNativePath(appHelperPath); + NS_ENSURE_SUCCESS(rv, rv); - nsAutoString appLongPath(exePath); - - nsCOMPtr lf; - nsresult rv = NS_NewLocalFile(nsDependentString(exePath), PR_TRUE, - getter_AddRefs(lf)); - if (NS_FAILED(rv)) - return rv; - - nsAutoString exeName; - rv = lf->GetLeafName(exeName); - if (NS_FAILED(rv)) - return rv; - ToUpperCase(exeName); - - nsCOMPtr appDir; - rv = lf->GetParent(getter_AddRefs(appDir)); - if (NS_FAILED(rv)) - return rv; - - nsAutoString uninstLongPath; - appDir->GetPath(uninstLongPath); - uninstLongPath.AppendLiteral(UNINSTALL_EXE); - - for (settings = gSettings; settings < end; ++settings) { - NS_ConvertUTF8toUTF16 dataLongPath(settings->valueData); - NS_ConvertUTF8toUTF16 key(settings->keyName); - NS_ConvertUTF8toUTF16 value(settings->valueName); - if (settings->flags & APP_PATH_SUBSTITUTION) { - PRInt32 offset = dataLongPath.Find("%APPPATH%"); - dataLongPath.Replace(offset, 9, appLongPath); - } - if (settings->flags & UNINST_PATH_SUBSTITUTION) { - PRInt32 offset = dataLongPath.Find("%UNINSTPATH%"); - dataLongPath.Replace(offset, 12, uninstLongPath); - } - if (settings->flags & EXE_NAME_SUBSTITUTION) { - PRInt32 offset = key.Find("%APPEXE%"); - key.Replace(offset, 8, exeName); - } - - SetRegKey(key, value, dataLongPath, - (settings->flags & HKLM_ONLY)); + if (aForAllUsers) { + appHelperPath.AppendLiteral(" /SetAsDefaultAppGlobal"); + } else { + appHelperPath.AppendLiteral(" /SetAsDefaultAppUser"); } - // Select the Default Browser for the Windows XP Start Menu - SetRegKey(NS_LITERAL_STRING(SMI), EmptyString(), exeName, PR_TRUE); + STARTUPINFO si = {sizeof(si), 0}; + PROCESS_INFORMATION pi = {0}; - nsCOMPtr - bundleService(do_GetService("@mozilla.org/intl/stringbundle;1")); - if (!bundleService) + BOOL ok = CreateProcess(NULL, (LPSTR)appHelperPath.get(), NULL, NULL, + FALSE, 0, NULL, NULL, &si, &pi); + + if (!ok) return NS_ERROR_FAILURE; - nsCOMPtr bundle, brandBundle; - rv = bundleService->CreateBundle(SHELLSERVICE_PROPERTIES, getter_AddRefs(bundle)); - NS_ENSURE_SUCCESS(rv, rv); - rv = bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle)); - NS_ENSURE_SUCCESS(rv, rv); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); - // Create the Start Menu item if it doesn't exist - nsString brandFullName; - brandBundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(), - getter_Copies(brandFullName)); - - nsAutoString key1(NS_LITERAL_STRING(SMI)); - key1.Append(exeName); - key1.AppendLiteral("\\"); - SetRegKey(key1, EmptyString(), brandFullName, PR_TRUE); - - // Set the Options and Safe Mode start menu context menu item labels - nsAutoString optionsKey(NS_LITERAL_STRING(SMI)); - optionsKey.Append(exeName); - optionsKey.AppendLiteral("\\shell\\properties"); - - nsAutoString safeModeKey(NS_LITERAL_STRING(SMI)); - safeModeKey.Append(exeName); - safeModeKey.AppendLiteral("\\shell\\safemode"); - - nsString brandShortName; - brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(), - getter_Copies(brandShortName)); - - const PRUnichar* brandNameStrings[] = { brandShortName.get() }; - - // Set the Options menu item - nsString optionsTitle; - bundle->FormatStringFromName(NS_LITERAL_STRING("optionsLabel").get(), - brandNameStrings, 1, - getter_Copies(optionsTitle)); - // Set the Safe Mode menu item - nsString safeModeTitle; - bundle->FormatStringFromName(NS_LITERAL_STRING("safeModeLabel").get(), - brandNameStrings, 1, - getter_Copies(safeModeTitle)); - - // Set the registry keys - SetRegKey(optionsKey, EmptyString(), optionsTitle, PR_TRUE); - SetRegKey(safeModeKey, EmptyString(), safeModeTitle, PR_TRUE); - - // Refresh the Shell - SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0); return NS_OK; } -// Utility function to delete a registry subkey. -DWORD -nsWindowsShellService::DeleteRegKey(HKEY baseKey, const nsString& keyName) -{ - // Make sure input subkey isn't null. - if (keyName.IsEmpty()) - return ERROR_BADKEY; - - const nsString &flatName = PromiseFlatString(keyName); - - // Open subkey. - HKEY key; - DWORD res = ::RegOpenKeyExW(baseKey, flatName.get(), 0, - KEY_ENUMERATE_SUB_KEYS | DELETE, &key); - // Continue till we get an error or are done. - while (res == ERROR_SUCCESS) { - PRUnichar subkeyName[MAX_PATH]; - DWORD len = sizeof subkeyName; - // Get first subkey name. Note that we always get the - // first one, then delete it. So we need to get - // the first one next time, also. - res = ::RegEnumKeyExW(key, 0, subkeyName, &len, NULL, NULL, - NULL, NULL); - if (res == ERROR_NO_MORE_ITEMS) { - // No more subkeys. Delete the main one. - res = ::RegDeleteKeyW(baseKey, flatName.get()); - break; - } - // If we find another subkey, delete it, recursively. - if (res == ERROR_SUCCESS) - res = DeleteRegKey(key, nsDependentString(subkeyName)); - } - - // Close the key we opened. - ::RegCloseKey(key); - return res; -} - -void -nsWindowsShellService::SetRegKey(const nsString& aKeyName, - const nsString& aValueName, - const nsString& aValue, PRBool aHKLMOnly) -{ - PRUnichar buf[MAX_BUF]; - DWORD len = sizeof buf; - - HKEY theKey; - nsresult rv = OpenKeyForWriting(HKEY_LOCAL_MACHINE, aKeyName, &theKey, - aHKLMOnly); - if (NS_FAILED(rv)) - return; - - // Get the old value - DWORD res = ::RegQueryValueExW(theKey, PromiseFlatString(aValueName).get(), - NULL, NULL, (LPBYTE)buf, &len); - - // Set the new value - nsAutoString current(buf); - if (REG_FAILED(res) || !current.Equals(aValue)) { - const nsString &flatValue = PromiseFlatString(aValue); - - ::RegSetValueExW(theKey, PromiseFlatString(aValueName).get(), - 0, REG_SZ, (const BYTE *)flatValue.get(), - (flatValue.Length() + 1) * sizeof(PRUnichar)); - } - - // Close the key we opened. - ::RegCloseKey(theKey); -} - NS_IMETHODIMP nsWindowsShellService::GetShouldCheckDefaultBrowser(PRBool* aResult) { @@ -1007,13 +668,10 @@ nsWindowsShellService::OpenApplication(PRInt32 aApplication) // \Client Subkey Name\shell\open\command\ // \Client Subkey Name\shell\open\command\(default) = path to exe // - nsAutoString clientKey; - clientKey.AssignLiteral("SOFTWARE\\Clients\\"); - clientKey.Append(application); // Find the default application for this class. HKEY theKey; - nsresult rv = OpenUserKeyForReading(HKEY_CURRENT_USER, clientKey, &theKey); + nsresult rv = OpenKeyForReading(HKEY_CLASSES_ROOT, application, &theKey); if (NS_FAILED(rv)) return rv; @@ -1029,11 +687,11 @@ nsWindowsShellService::OpenApplication(PRInt32 aApplication) ::RegCloseKey(theKey); // Find the "open" command - clientKey.AppendLiteral("\\"); - clientKey.Append(buf); - clientKey.AppendLiteral("\\shell\\open\\command"); + application.AppendLiteral("\\"); + application.Append(buf); + application.AppendLiteral("\\shell\\open\\command"); - rv = OpenUserKeyForReading(HKEY_CURRENT_USER, clientKey, &theKey); + rv = OpenKeyForReading(HKEY_CLASSES_ROOT, application, &theKey); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/browser/installer/windows/nsis/installer.nsi b/mozilla/browser/installer/windows/nsis/installer.nsi index c175bfd5a30..00bcf0995a0 100755 --- a/mozilla/browser/installer/windows/nsis/installer.nsi +++ b/mozilla/browser/installer/windows/nsis/installer.nsi @@ -35,7 +35,9 @@ # ***** END LICENSE BLOCK ***** # Required Plugins: -# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in +# SetVistaDefaultApp http://nsis.sourceforge.net/SetVistaDefaultApp_plug-in +# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in +# UAC http://nsis.sourceforge.net/UAC_plug-in ; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs !verbose 3 @@ -54,6 +56,9 @@ CRCCheck on !system 'echo ; > shortcuts.ini' !system 'echo ; > summary.ini' +; USE_UAC_PLUGIN is temporary until Thunderbird has been updated to use the UAC plugin +!define USE_UAC_PLUGIN + Var TmpVal Var StartMenuDir Var InstallType @@ -75,16 +80,17 @@ Var AddDesktopSC ; available. !include /NONFATAL WinVer.nsh !ifdef ___WINVER__NSH___ - RequestExecutionLevel admin + RequestExecutionLevel user !else !warning "Installer will be created without Vista compatibility.$\n \ Upgrade your NSIS installation to at least version 2.22 to resolve." !endif -!insertmacro StrFilter -!insertmacro WordFind -!insertmacro WordReplace +!insertmacro GetOptions +!insertmacro GetParameters !insertmacro GetSize +!insertmacro StrFilter +!insertmacro WordReplace ; NSIS provided macros that we have overridden !include overrides.nsh @@ -103,10 +109,13 @@ VIAddVersionKey "FileDescription" "${BrandShortName} Installer" ; Must be inserted before other macros that use logging !insertmacro _LoggingCommon -!insertmacro AddHandlerValues +!insertmacro AddDDEHandlerValues !insertmacro CloseApp !insertmacro CreateRegKey +!insertmacro GetPathFromString +!insertmacro IsHandlerForInstallDir !insertmacro ManualCloseAppPrompt +!insertmacro RegCleanAppHandler !insertmacro RegCleanMain !insertmacro RegCleanUninstall !insertmacro WriteRegStr2 @@ -365,29 +374,25 @@ Section "-Application" APP_IDX StrCpy $AddDesktopSC "1" ${EndIf} - ; Remove registry entries for non-existent apps and for apps that point to our - ; install location in the Software\Mozilla key and uninstall registry entries - ; that point to our install location for both HKCU and HKLM. + ${LogHeader} "Adding Registry Entries" SetShellVarContext current ; Set SHCTX to HKCU ${RegCleanMain} "Software\Mozilla" ${RegCleanUninstall} - SetShellVarContext all ; Set SHCTX to HKLM - ${RegCleanMain} "Software\Mozilla" - ${RegCleanUninstall} - - ${LogHeader} "Adding Registry Entries" ClearErrors WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test" ${If} ${Errors} - SetShellVarContext current ; Set SHCTX to HKCU StrCpy $TmpVal "HKCU" ; used primarily for logging ${Else} SetShellVarContext all ; Set SHCTX to HKLM DeleteRegKey HKLM "Software\Mozilla\InstallerTest" StrCpy $TmpVal "HKLM" ; used primarily for logging + ${RegCleanMain} "Software\Mozilla" + ${RegCleanUninstall} ${EndIf} + ${RemoveDeprecatedKeys} + ; The previous installer adds several regsitry values to both HKLM and HKCU. ; We now try to add to HKLM and if that fails to HKCU @@ -404,6 +409,18 @@ Section "-Application" APP_IDX ${WriteRegDWORD2} $TmpVal "$0" "Create Start Menu Shortcut" $AddStartMenuSC 0 ${FixClassKeys} + ${UpdateProtocolHandlers} + + ; On install always add the FirefoxHTML and FirefoxURL keys. + ; An empty string is used for the 5th param because FirefoxHTML is not a + ; protocol handler. + ${AddDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" "${AppRegName} Document" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + + ${AddDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" "true" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + + ${FixShellIconHandler} ; The following keys should only be set if we can write to HKLM ${If} $TmpVal == "HKLM" @@ -415,10 +432,10 @@ Section "-Application" APP_IDX ; If we are writing to HKLM and create the quick launch and the desktop ; shortcuts set IconsVisible to 1 otherwise to 0. + ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 + StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo" ${If} $AddQuickLaunchSC == 1 ${OrIf} $AddDesktopSC == 1 - ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 - StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo" WriteRegDWORD HKLM "$0" "IconsVisible" 1 ${Else} WriteRegDWORD HKLM "$0" "IconsVisible" 0 @@ -595,10 +612,32 @@ Function CopyFile FunctionEnd Function LaunchApp + ${GetParameters} $0 + ${If} $0 != "" + ClearErrors + ${GetOptions} "$0" "/UAC:" $1 + ${Unless} ${Errors} + GetFunctionAddress $0 LaunchAppFromElevatedProcess + UAC::ExecCodeSegment $0 + Quit + ${EndUnless} + ${EndIf} + ${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)" Exec "$INSTDIR\${FileMainEXE}" FunctionEnd +Function LaunchAppFromElevatedProcess + ${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)" + + ; Find the installation directory when launching using GetFunctionAddress + ; from an elevated installer since $INSTDIR will not be set in this installer + ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 + ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" "" + ${GetPathFromString} "$0" $0 + Exec "$0" +FunctionEnd + ################################################################################ # Language @@ -746,3 +785,11 @@ Function .onInit SectionSetText ${DOMI_IDX} "" ${EndIf} FunctionEnd + +Function .OnInstFailed + UAC::Unload +FunctionEnd + +Function .OnInstSuccess + UAC::Unload +FunctionEnd diff --git a/mozilla/browser/installer/windows/nsis/shared.nsh b/mozilla/browser/installer/windows/nsis/shared.nsh index ef3f6892208..41d81d8243e 100755 --- a/mozilla/browser/installer/windows/nsis/shared.nsh +++ b/mozilla/browser/installer/windows/nsis/shared.nsh @@ -35,26 +35,34 @@ # ***** END LICENSE BLOCK ***** !macro PostUpdate - SetShellVarContext all - ${SetStartMenuInternet} - ; Remove registry entries for non-existent apps and for apps that point to our ; install location in the Software\Mozilla key and uninstall registry entries ; that point to our install location for both HKCU and HKLM. - SetShellVarContext current ; Set SHCTX to HKCU + SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) ${RegCleanMain} "Software\Mozilla" ${RegCleanUninstall} - SetShellVarContext all ; Set SHCTX to HKLM - ${RegCleanMain} "Software\Mozilla" - ${RegCleanUninstall} + ClearErrors + WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test" + ${If} ${Errors} + StrCpy $TmpVal "HKCU" ; used primarily for logging + ${Else} + SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) + DeleteRegKey HKLM "Software\Mozilla\InstallerTest" + StrCpy $TmpVal "HKLM" ; used primarily for logging + ${RegCleanMain} "Software\Mozilla" + ${RegCleanUninstall} + ${SetStartMenuInternet} + ${FixShellIconHandler} + ${SetUninstallKeys} + ${EndIf} + + ${RemoveDeprecatedKeys} ; Add Software\Mozilla\ registry entries ${SetAppKeys} - - ${SetUninstallKeys} - ${FixClassKeys} + ${UpdateProtocolHandlers} ; Remove files that may be left behind by the application in the ; VirtualStore directory. @@ -68,24 +76,74 @@ !define PostUpdate "!insertmacro PostUpdate" !macro SetAsDefaultAppUser - SetShellVarContext current + ; It is only possible to set this installation of the application as the + ; StartMenuInternet handler if it was added to the HKLM StartMenuInternet + ; registry keys. + ; http://support.microsoft.com/kb/297878 + + ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 + ClearErrors + ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" "" + IfErrors updateclientkeys +1 + ${GetPathFromString} "$0" $0 + ${GetParent} "$0" $0 + IfFileExists "$0" +1 updateclientkeys + ${GetLongPath} "$0" $0 + StrCmp "$0" "$INSTDIR" setdefaultuser +1 + + updateclientkeys: + ; Calls after ElevateUAC won't be made if the user can elevate. They + ; will be made in the new elevated process if the user allows elevation. + ${ElevateUAC} + + ${SetStartMenuInternet} + + setdefaultuser: + SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) + ${FixShellIconHandler} + WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9" + +!ifdef ___WINVER__NSH___ + ${If} ${AtLeastWinVista} + ClearErrors + ReadRegStr $0 HKLM "Software\RegisteredApplications" "${AppRegName}" + ; Only register as the handler on Vista if the app registry name exists + ; under the RegisteredApplications registry key. + ${Unless} ${Errors} + SetVistaDefaultApp::SetAsDefault "${AppRegName}" + ${EndUnless} + ${EndIf} +!endif + + ${RemoveDeprecatedKeys} + + SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) ${SetHandlers} !macroend !define SetAsDefaultAppUser "!insertmacro SetAsDefaultAppUser" !macro SetAsDefaultAppGlobal - SetShellVarContext all + ${RemoveDeprecatedKeys} + + SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) ${SetHandlers} ${SetStartMenuInternet} - WriteRegStr HKLM "Software\Clients\StartMenuInternet" "" "$R9" + ${FixShellIconHandler} ${ShowShortcuts} + ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 + WriteRegStr HKLM "Software\Clients\StartMenuInternet" "" "$R9" !macroend !define SetAsDefaultAppGlobal "!insertmacro SetAsDefaultAppGlobal" +!macro FixReg + ${SetAsDefaultAppUser} +!macroend +!define FixReg "!insertmacro FixReg" + !macro HideShortcuts ${StrFilter} "${FileMainEXE}" "+" "" "" $0 StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo" - WriteRegDWORD HKLM $R1 "IconsVisible" 0 + WriteRegDWORD HKLM "$R1" "IconsVisible" 0 SetShellVarContext all ; Set $DESKTOP to All Users ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" SetShellVarContext current ; Set $DESKTOP to the current user's desktop @@ -122,7 +180,7 @@ !macro ShowShortcuts ${StrFilter} "${FileMainEXE}" "+" "" "" $0 StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo" - WriteRegDWORD HKLM $R1 "IconsVisible" 1 + WriteRegDWORD HKLM "$R1" "IconsVisible" 1 SetShellVarContext all ; Set $DESKTOP to All Users ${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk" CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}" "" "$INSTDIR\${FileMainEXE}" 0 @@ -143,38 +201,70 @@ !define ShowShortcuts "!insertmacro ShowShortcuts" !macro SetHandlers - GetFullPathName $8 "$INSTDIR\${FileMainEXE}" + ${GetLongPath} "$INSTDIR\${FileMainEXE}" $8 StrCpy $0 "SOFTWARE\Classes" StrCpy $2 "$\"$8$\" -requestPending -osint -url $\"%1$\"" ; Associate the file handlers with FirefoxHTML - WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML" - WriteRegStr SHCTX "$0\.html" "" "FirefoxHTML" - WriteRegStr SHCTX "$0\.shtml" "" "FirefoxHTML" - WriteRegStr SHCTX "$0\.xht" "" "FirefoxHTML" - WriteRegStr SHCTX "$0\.xhtml" "" "FirefoxHTML" + ReadRegStr $6 HKCR ".htm" "" + ${If} "$6" != "FirefoxHTML" + WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML" + ${EndIf} + + ReadRegStr $6 HKCR ".html" "" + ${If} "$6" != "FirefoxHTML" + WriteRegStr SHCTX "$0\.html" "" "FirefoxHTML" + ${EndIf} + + ReadRegStr $6 HKCR ".shtml" "" + ${If} "$6" != "FirefoxHTML" + WriteRegStr SHCTX "$0\.shtml" "" "FirefoxHTML" + ${EndIf} + + ReadRegStr $6 HKCR ".hht" "" + ${If} "$6" != "FirefoxHTML" + WriteRegStr SHCTX "$0\.xht" "" "FirefoxHTML" + ${EndIf} + + ReadRegStr $6 HKCR ".xhtml" "" + ${If} "$6" != "FirefoxHTML" + WriteRegStr SHCTX "$0\.xhtml" "" "FirefoxHTML" + ${EndIf} + + StrCpy $3 "$\"%1$\",,0,0,,,," ; An empty string is used for the 5th param because FirefoxHTML is not a ; protocol handler - ${AddHandlerValues} "$0\FirefoxHTML" "$2" "$8,1" "${AppRegName} Document" "" "true" + ${AddDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" "${AppRegName} Document" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" - ${AddHandlerValues} "$0\FirefoxURL" "$2" "$8,1" "${AppRegName} URL" "true" "true" + ${AddDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" "true" \ + "${DDEApplication}" "$3" "WWW_OpenURL" ; An empty string is used for the 4th & 5th params because the following - ; protocol handlers already have a display name and additional keys required - ; for a protocol handler. - ${AddHandlerValues} "$0\ftp" "$2" "$8,1" "" "" "true" - ${AddHandlerValues} "$0\http" "$2" "$8,1" "" "" "true" - ${AddHandlerValues} "$0\https" "$2" "$8,1" "" "" "true" + ; protocol handlers already have a display name and the additional keys + ; required for a protocol handler. + ${AddDDEHandlerValues} "ftp" "$2" "$8,1" "" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + ${AddDDEHandlerValues} "http" "$2" "$8,1" "" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + ${AddDDEHandlerValues} "https" "$2" "$8,1" "" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" !macroend !define SetHandlers "!insertmacro SetHandlers" -; XXXrstrong - there are several values that will be overwritten by and -; overwrite other installs of the same application. +; The values for StartMenuInternet are only valid under HKLM and there can only +; be one installation registerred under StartMenuInternet per application since +; the key name is derived from the main application executable. +; http://support.microsoft.com/kb/297878 +; +; Note: we might be able to get away with using the full path to the +; application executable for the key name in order to support multiple +; installations. !macro SetStartMenuInternet - GetFullPathName $8 "$INSTDIR\${FileMainEXE}" - GetFullPathName $7 "$INSTDIR\uninstall\helper.exe" + ${GetLongPath} "$INSTDIR\${FileMainEXE}" $8 + ${GetLongPath} "$INSTDIR\uninstall\helper.exe" $7 ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 @@ -190,6 +280,18 @@ WriteRegStr HKLM "$0\InstallInfo" "ShowIconsCommand" "$\"$7$\" /ShowShortcuts" WriteRegStr HKLM "$0\InstallInfo" "ReinstallCommand" "$\"$7$\" /SetAsDefaultAppGlobal" + ClearErrors + ReadRegDWORD $1 HKLM "$0\InstallInfo" "IconsVisible" + ; If the IconsVisible name vale pair doesn't exist add it otherwise the + ; application won't be displayed in Set Program Access and Defaults. + ${If} ${Errors} + ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" + WriteRegDWORD HKLM "$0\InstallInfo" "IconsVisible" 1 + ${Else} + WriteRegDWORD HKLM "$0\InstallInfo" "IconsVisible" 0 + ${EndIf} + ${EndIf} + WriteRegStr HKLM "$0\shell\open\command" "" "$8" WriteRegStr HKLM "$0\shell\properties" "" "$(CONTEXT_OPTIONS)" @@ -215,28 +317,19 @@ WriteRegStr HKLM "$0\Capabilities\URLAssociations" "http" "FirefoxURL" WriteRegStr HKLM "$0\Capabilities\URLAssociations" "https" "FirefoxURL" - ; Delete gopher from Capabilities\URLAssociations if it is present. - ClearErrors - ReadRegStr $2 HKLM "$0\Capabilities\URLAssociations" "gopher" - ${Unless} ${Errors} - DeleteRegValue HKLM "$0\Capabilities\URLAssociations" "gopher" - ${EndUnless} - - ; Delete gopher from the user's UrlAssociations if it points to FirefoxURL. - ReadRegStr $2 HKCU "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\gopher\UserChoice" "Progid" - ${If} $2 == "FirefoxURL" - DeleteRegKey HKCU "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\gopher" - ${EndIf} - ; Vista Registered Application WriteRegStr HKLM "Software\RegisteredApplications" "${AppRegName}" "$0\Capabilities" +!macroend +!define SetStartMenuInternet "!insertmacro SetStartMenuInternet" +!macro FixShellIconHandler ; The IconHandler reference for FirefoxHTML can end up in an inconsistent ; state due to changes not being detected by the IconHandler for side by side ; installs. The symptoms can be either an incorrect icon or no icon being ; displayed for files associated with Firefox. By setting it here it will ; always reference the install referenced in the ; HKLM\Software\Classes\FirefoxHTML registry key. + ${GetLongPath} "$INSTDIR\${FileMainEXE}" $8 ClearErrors ReadRegStr $2 HKLM "Software\Classes\FirefoxHTML\ShellEx\IconHandler" "" ${Unless} ${Errors} @@ -247,12 +340,13 @@ ${EndUnless} ${EndUnless} !macroend -!define SetStartMenuInternet "!insertmacro SetStartMenuInternet" +!define FixShellIconHandler "!insertmacro FixShellIconHandler" !macro SetAppKeys + ${GetLongPath} "$INSTDIR" $8 StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Main" - ${WriteRegStr2} $TmpVal "$0" "Install Directory" "$INSTDIR" 0 - ${WriteRegStr2} $TmpVal "$0" "PathToExe" "$INSTDIR\${FileMainEXE}" 0 + ${WriteRegStr2} $TmpVal "$0" "Install Directory" "$8" 0 + ${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0 ${WriteRegStr2} $TmpVal "$0" "Program Folder Path" "$SMPROGRAMS\$StartMenuDir" 0 SetShellVarContext all ; Set $DESKTOP to All Users @@ -266,8 +360,8 @@ ${If} $1 == "" ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk" Pop $1 - ; Needs to handle short paths - ${If} $1 == "$INSTDIR\${FileMainEXE}" + ${GetLongPath} "$1" $1 + ${If} "$1" == "$8\${FileMainEXE}" ${WriteRegDWORD2} $TmpVal "$0" "Create Desktop Shortcut" 1 0 ${Else} ${WriteRegDWORD2} $TmpVal "$0" "Create Desktop Shortcut" 0 0 @@ -278,9 +372,9 @@ ; XXXrstrong - need a cleaner way to prevent unsetting SHCTX from HKLM when ; trying to find the desktop shortcut. ${If} $TmpVal == "HKCU" - SetShellVarContext current + SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU) ${Else} - SetShellVarContext all + SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM) ${EndIf} ${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk" @@ -289,8 +383,8 @@ ${If} $1 == "" ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk" Pop $1 - ; Needs to handle short paths - ${If} $1 == "$INSTDIR\${FileMainEXE}" + ${GetLongPath} "$1" $1 + ${If} $1 == "$8\${FileMainEXE}" ${WriteRegDWORD2} $TmpVal "$0" "Create Quick Launch Shortcut" 1 0 ${Else} ${WriteRegDWORD2} $TmpVal "$0" "Create Quick Launch Shortcut" 0 0 @@ -301,18 +395,18 @@ ; set in the installer and should also be set here for software update. StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Uninstall" - ${WriteRegStr2} $TmpVal "$0" "Uninstall Log Folder" "$INSTDIR\uninstall" 0 + ${WriteRegStr2} $TmpVal "$0" "Uninstall Log Folder" "$8\uninstall" 0 ${WriteRegStr2} $TmpVal "$0" "Description" "${BrandFullNameInternal} (${AppVersion})" 0 StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})" ${WriteRegStr2} $TmpVal "$0" "" "${AppVersion} (${AB_CD})" 0 StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\bin" - ${WriteRegStr2} $TmpVal "$0" "PathToExe" "$INSTDIR\${FileMainEXE}" 0 + ${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0 StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\extensions" - ${WriteRegStr2} $TmpVal "$0" "Components" "$INSTDIR\components" 0 - ${WriteRegStr2} $TmpVal "$0" "Plugins" "$INSTDIR\plugins" 0 + ${WriteRegStr2} $TmpVal "$0" "Components" "$8\components" 0 + ${WriteRegStr2} $TmpVal "$0" "Plugins" "$8\plugins" 0 StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}" ${WriteRegStr2} $TmpVal "$0" "GeckoVer" "${GREVersion}" 0 @@ -324,18 +418,17 @@ !define SetAppKeys "!insertmacro SetAppKeys" !macro SetUninstallKeys - ; Write the uninstall registry keys StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${AppVersion})" - GetFullPathName $8 "$INSTDIR\${FileMainEXE}" - GetFullPathName $7 "$INSTDIR\uninstall\helper.exe" + ${GetLongPath} "$INSTDIR" $8 + ; Write the uninstall registry keys ${WriteRegStr2} $TmpVal "$0" "Comments" "${BrandFullNameInternal}" 0 - ${WriteRegStr2} $TmpVal "$0" "DisplayIcon" "$8,0" 0 + ${WriteRegStr2} $TmpVal "$0" "DisplayIcon" "$8\${FileMainEXE},0" 0 ${WriteRegStr2} $TmpVal "$0" "DisplayName" "${BrandFullNameInternal} (${AppVersion})" 0 ${WriteRegStr2} $TmpVal "$0" "DisplayVersion" "${AppVersion} (${AB_CD})" 0 - ${WriteRegStr2} $TmpVal "$0" "InstallLocation" "$INSTDIR" 0 + ${WriteRegStr2} $TmpVal "$0" "InstallLocation" "$8" 0 ${WriteRegStr2} $TmpVal "$0" "Publisher" "Mozilla" 0 - ${WriteRegStr2} $TmpVal "$0" "UninstallString" "$7" 0 + ${WriteRegStr2} $TmpVal "$0" "UninstallString" "$8\uninstall\helper.exe" 0 ${WriteRegStr2} $TmpVal "$0" "URLInfoAbout" "${URLInfoAbout}" 0 ${WriteRegStr2} $TmpVal "$0" "URLUpdateInfo" "${URLUpdateInfo}" 0 ${WriteRegDWORD2} $TmpVal "$0" "NoModify" 1 0 @@ -344,96 +437,110 @@ !define SetUninstallKeys "!insertmacro SetUninstallKeys" !macro FixClassKeys - StrCpy $0 "SOFTWARE\Classes" + StrCpy $1 "SOFTWARE\Classes" ; File handler keys and name value pairs that may need to be created during ; install or upgrade. - ReadRegStr $2 SHCTX "$0\.shtml" "Content Type" - ${If} $2 == "" - StrCpy $2 "$0\.shtml" - ${WriteRegStr2} $TmpVal "$0\.shtml" "" "shtmlfile" 0 - ${WriteRegStr2} $TmpVal "$0\.shtml" "Content Type" "text/html" 0 - ${WriteRegStr2} $TmpVal "$0\.shtml" "PerceivedType" "text" 0 + ReadRegStr $0 HKCR ".shtml" "Content Type" + ${If} "$0" == "" + StrCpy $0 "$1\.shtml" + ${WriteRegStr2} $TmpVal "$1\.shtml" "" "shtmlfile" 0 + ${WriteRegStr2} $TmpVal "$1\.shtml" "Content Type" "text/html" 0 + ${WriteRegStr2} $TmpVal "$1\.shtml" "PerceivedType" "text" 0 ${EndIf} - ReadRegStr $2 SHCTX "$0\.xht" "Content Type" - ${If} $2 == "" - ${WriteRegStr2} $TmpVal "$0\.xht" "" "xhtfile" 0 - ${WriteRegStr2} $TmpVal "$0\.xht" "Content Type" "application/xhtml+xml" 0 + ReadRegStr $0 HKCR ".xht" "Content Type" + ${If} "$0" == "" + ${WriteRegStr2} $TmpVal "$1\.xht" "" "xhtfile" 0 + ${WriteRegStr2} $TmpVal "$1\.xht" "Content Type" "application/xhtml+xml" 0 ${EndIf} - ReadRegStr $2 SHCTX "$0\.xhtml" "Content Type" - ${If} $2 == "" - ${WriteRegStr2} $TmpVal "$0\.xhtml" "" "xhtmlfile" 0 - ${WriteRegStr2} $TmpVal "$0\.xhtml" "Content Type" "application/xhtml+xml" 0 + ReadRegStr $0 HKCR ".xhtml" "Content Type" + ${If} "$0" == "" + ${WriteRegStr2} $TmpVal "$1\.xhtml" "" "xhtmlfile" 0 + ${WriteRegStr2} $TmpVal "$1\.xhtml" "Content Type" "application/xhtml+xml" 0 + ${EndIf} +!macroend +!define FixClassKeys "!insertmacro FixClassKeys" + +; Updates protocol handlers if their registry open command value is for this +; install location +!macro UpdateProtocolHandlers + ; Store the command to open the app with an url in a register for easy access. + ${GetLongPath} "$INSTDIR\${FileMainEXE}" $8 + StrCpy $2 "$\"$8$\" -requestPending -osint -url $\"%1$\"" + StrCpy $3 "$\"%1$\",,0,0,,,," + + ; Only set the file and protocol handlers if the existing one under HKCR is + ; for this install location. + + ${IsHandlerForInstallDir} "FirefoxHTML" $R9 + ${If} "$R9" == "true" + ; An empty string is used for the 5th param because FirefoxHTML is not a + ; protocol handler. + ${AddDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" "${AppRegName} Document" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" ${EndIf} - ; Protocol handler keys and name value pairs that may need to be updated during - ; install or upgrade. + ${IsHandlerForInstallDir} "FirefoxURL" $R9 + ${If} "$R9" == "true" + ${AddDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" "true" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + ${EndIf} - ; Bug 301073 Comment #9 makes it so Firefox no longer supports launching - ; chrome urls from the shell so remove it during install or update if the - ; DefaultIcon is from firefox.exe. - ReadRegStr $2 SHCTX "$0\chrome\DefaultIcon" "" + ${IsHandlerForInstallDir} "ftp" $R9 + ${If} "$R9" == "true" + ${AddDDEHandlerValues} "ftp" "$2" "$8,1" "" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + ${EndIf} - ClearErrors - ${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1 + ${IsHandlerForInstallDir} "http" $R9 + ${If} "$R9" == "true" + ${AddDDEHandlerValues} "http" "$2" "$8,1" "" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + ${EndIf} - ${Unless} ${Errors} - DeleteRegKey SHCTX "$0\chrome" - ${EndUnless} + ${IsHandlerForInstallDir} "https" $R9 + ${If} "$R9" == "true" + ${AddDDEHandlerValues} "https" "$2" "$8,1" "" "" \ + "${DDEApplication}" "$3" "WWW_OpenURL" + ${EndIf} +!macroend +!define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers" +!macro RemoveDeprecatedKeys + StrCpy $0 "SOFTWARE\Classes" ; Remove support for launching gopher urls from the shell during install or ; update if the DefaultIcon is from firefox.exe. - ReadRegStr $2 SHCTX "$0\gopher\DefaultIcon" "" - ClearErrors - ${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1 - ${Unless} ${Errors} - DeleteRegKey SHCTX "$0\gopher" - ${EndUnless} + ${RegCleanAppHandler} "gopher" - ; Store the command to open the app with an url in a register for easy access. - GetFullPathName $8 "$INSTDIR\${FileMainEXE}" - StrCpy $1 "$\"$8$\" -requestPending -osint -url $\"%1$\"" - - ; Always set the file and protocol handlers since they may specify a - ; different path and the path is used by Vista when setting associations. - ${AddHandlerValues} "$0\FirefoxURL" "$1" "$8,1" "${AppRegName} URL" "true" "true" - - ; An empty string is used for the 5th param because FirefoxHTML is not a - ; protocol handler - ${AddHandlerValues} "$0\FirefoxHTML" "$1" "$8,1" "${AppRegName} Document" "" "true" - - ReadRegStr $2 SHCTX "$0\http\shell\open\command" "" - ClearErrors - ${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1 - ${Unless} ${Errors} - ${AddHandlerValues} "$0\http" "$1" "$8,1" "" "" "true" - ${EndUnless} - - ReadRegStr $2 SHCTX "$0\https\shell\open\command" "" - ClearErrors - ${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1 - ${Unless} ${Errors} - ${AddHandlerValues} "$0\https" "$1" "$8,1" "" "" "true" - ${EndUnless} - - ReadRegStr $2 SHCTX "$0\ftp\shell\open\command" "" - ClearErrors - ${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1 - ${Unless} ${Errors} - ${AddHandlerValues} "$0\ftp" "$1" "$8,1" "" "" "true" - ${EndUnless} - - ; Remove the gopher key if the DefaultIcon is from firefox.exe. - ReadRegStr $2 SHCTX "$0\gopher\DefaultIcon" "" - ClearErrors - ${WordFind} "$2" "${FileMainEXE}" "E+1{" $R1 - ${Unless} ${Errors} - DeleteRegKey SHCTX "$0\gopher" - ${EndUnless} + ; Remove support for launching chrome urls from the shell during install or + ; update if the DefaultIcon is from firefox.exe (Bug 301073). + ${RegCleanAppHandler} "chrome" ; Remove protocol handler registry keys added by the MS shim DeleteRegKey HKLM "Software\Classes\Firefox.URL" + DeleteRegKey HKCU "Software\Classes\Firefox.URL" + + ; Remove the app compatibility registry key + StrCpy $0 "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" + DeleteRegValue HKLM "$0" "$INSTDIR\${FileMainEXE}" + DeleteRegValue HKCU "$0" "$INSTDIR\${FileMainEXE}" + + ; Delete gopher from Capabilities\URLAssociations if it is present. + ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 + StrCpy $0 "Software\Clients\StartMenuInternet\$R9" + ClearErrors + ReadRegStr $2 HKLM "$0\Capabilities\URLAssociations" "gopher" + ${Unless} ${Errors} + DeleteRegValue HKLM "$0\Capabilities\URLAssociations" "gopher" + ${EndUnless} + + ; Delete gopher from the user's UrlAssociations if it points to FirefoxURL. + StrCpy $0 "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\gopher" + ReadRegStr $2 HKCU "$0\UserChoice" "Progid" + ${If} $2 == "FirefoxURL" + DeleteRegKey HKCU "$0" + ${EndIf} !macroend -!define FixClassKeys "!insertmacro FixClassKeys" +!define RemoveDeprecatedKeys "!insertmacro RemoveDeprecatedKeys" diff --git a/mozilla/browser/installer/windows/nsis/uninstaller.nsi b/mozilla/browser/installer/windows/nsis/uninstaller.nsi index e790fdaaae9..4f819ac56a4 100755 --- a/mozilla/browser/installer/windows/nsis/uninstaller.nsi +++ b/mozilla/browser/installer/windows/nsis/uninstaller.nsi @@ -35,7 +35,9 @@ # ***** END LICENSE BLOCK ***** # Required Plugins: -# ShellLink plugin http://nsis.sourceforge.net/ShellLink_plug-in +# SetVistaDefaultApp http://nsis.sourceforge.net/SetVistaDefaultApp_plug-in +# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in +# UAC http://nsis.sourceforge.net/UAC_plug-in ; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs !verbose 3 @@ -48,6 +50,9 @@ CRCCheck on !addplugindir ./ +; USE_UAC_PLUGIN is temporary until Thunderbird has been updated to use the UAC plugin +!define USE_UAC_PLUGIN + ; prevents compiling of the reg write logging. !define NO_LOG @@ -67,14 +72,13 @@ Var TmpVal ; available. !include /NONFATAL WinVer.nsh !ifdef ___WINVER__NSH___ - RequestExecutionLevel admin + RequestExecutionLevel user !else !warning "Uninstaller will be created without Vista compatibility.$\n \ Upgrade your NSIS installation to at least version 2.22 to resolve." !endif !insertmacro StrFilter -!insertmacro WordFind !insertmacro WordReplace !insertmacro un.GetParent @@ -92,9 +96,12 @@ Var TmpVal ; post update cleanup. VIAddVersionKey "FileDescription" "${BrandShortName} Helper" -!insertmacro AddHandlerValues +!insertmacro AddDDEHandlerValues !insertmacro CleanVirtualStore !insertmacro GetLongPath +!insertmacro GetPathFromString +!insertmacro IsHandlerForInstallDir +!insertmacro RegCleanAppHandler !insertmacro RegCleanMain !insertmacro RegCleanUninstall !insertmacro WriteRegDWORD2 @@ -105,8 +112,11 @@ VIAddVersionKey "FileDescription" "${BrandShortName} Helper" !insertmacro un.GetSecondInstallPath !insertmacro un.ManualCloseAppPrompt !insertmacro un.ParseUninstallLog +!insertmacro un.RegCleanAppHandler +!insertmacro un.RegCleanFileHandler !insertmacro un.RegCleanMain !insertmacro un.RegCleanUninstall +!insertmacro un.RegCleanProtocolHandler !insertmacro un.RemoveQuotesFromPath !include shared.nsh @@ -152,13 +162,13 @@ ShowUnInstDetails nevershow !insertmacro MUI_UNPAGE_INSTFILES ; Finish Page + +; Don't setup the survey controls, functions, etc. when the application has +; defined NO_UNINSTALL_SURVEY +!ifndef NO_UNINSTALL_SURVEY !define MUI_PAGE_CUSTOMFUNCTION_PRE un.preFinish !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED !define MUI_FINISHPAGE_SHOWREADME "" - -; Setup the survey controls, functions, etc. except when the application has -; defined NO_UNINSTALL_SURVEY -!ifndef NO_UNINSTALL_SURVEY !define MUI_FINISHPAGE_SHOWREADME_TEXT $(SURVEY_TEXT) !define MUI_FINISHPAGE_SHOWREADME_FUNCTION un.Survey !endif @@ -191,16 +201,39 @@ Section "Uninstall" ClearErrors ${EndIf} - ; Remove registry entries for non-existent apps and for apps that point to our - ; install location in the Software\Mozilla key and uninstall registry entries - ; that point to our install location for both HKCU and HKLM. - SetShellVarContext current ; Sets SHCTX to HKCU + SetShellVarContext current ; Set SHCTX to HKCU ${un.RegCleanMain} "Software\Mozilla" ${un.RegCleanUninstall} - SetShellVarContext all ; Sets SHCTX to HKLM - ${un.RegCleanMain} "Software\Mozilla" - ${un.RegCleanUninstall} + ClearErrors + WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test" + ${If} ${Errors} + StrCpy $TmpVal "HKCU" ; used primarily for logging + ${Else} + SetShellVarContext all ; Set SHCTX to HKLM + DeleteRegKey HKLM "Software\Mozilla\InstallerTest" + StrCpy $TmpVal "HKLM" ; used primarily for logging + ${un.RegCleanMain} "Software\Mozilla" + ${un.RegCleanUninstall} + ${EndIf} + + ${un.RegCleanAppHandler} "FirefoxURL" + ${un.RegCleanAppHandler} "FirefoxHTML" + ${un.RegCleanProtocolHandler} "ftp" + ${un.RegCleanProtocolHandler} "http" + ${un.RegCleanProtocolHandler} "https" + + ClearErrors + ReadRegStr $R9 HKCR "FirefoxHTML" "" + ; Don't clean up the file handlers if the FirefoxHTML key still exists since + ; there should be a second installation that may be the default file handler + ${If} ${Errors} + ${un.RegCleanFileHandler} ".htm" "FirefoxHTML" + ${un.RegCleanFileHandler} ".html" "FirefoxHTML" + ${un.RegCleanFileHandler} ".shtml" "FirefoxHTML" + ${un.RegCleanFileHandler} ".xht" "FirefoxHTML" + ${un.RegCleanFileHandler} ".xhtml" "FirefoxHTML" + ${EndIf} SetShellVarContext all ; Set SHCTX to HKLM ${un.GetSecondInstallPath} "Software\Mozilla" $R9 @@ -222,9 +255,6 @@ Section "Uninstall" ; default browser. Now the key is always updated on install but it is only ; removed if it refers to this install location. ${If} "$INSTDIR" == "$R1" - ; XXXrstrong - if there is another installation of the same app ideally we - ; would just modify these values. The GetSecondInstallPath macro could be - ; made to provide enough information to do this. DeleteRegKey HKLM "Software\Clients\StartMenuInternet\${FileMainEXE}" DeleteRegValue HKLM "Software\RegisteredApplications" "${AppRegName}" ${EndIf} @@ -236,8 +266,9 @@ Section "Uninstall" StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\${FileMainEXE}" DeleteRegKey HKLM "$0" DeleteRegKey HKCU "$0" - StrCpy $0 "MIME\Database\Content Type\application/x-xpinstall;app=firefox" - DeleteRegKey HKCR "$0" + StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=firefox" + DeleteRegKey HKLM "$0" + DeleteRegKey HKCU "$0" ${Else} ReadRegStr $R1 HKLM "$0" "" ${un.RemoveQuotesFromPath} "$R1" $R1 @@ -300,7 +331,7 @@ SectionEnd ################################################################################ # Helper Functions -; Setup the survey controls, functions, etc. except when the application has +; Don't setup the survey controls, functions, etc. when the application has ; defined NO_UNINSTALL_SURVEY !ifndef NO_UNINSTALL_SURVEY Function un.Survey @@ -340,12 +371,10 @@ Function un.leaveConfirm ${EndIf} FunctionEnd +!ifndef NO_UNINSTALL_SURVEY Function un.preFinish ; Do not modify the finish page if there is a reboot pending ${Unless} ${RebootFlag} -!ifdef NO_UNINSTALL_SURVEY - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "NumFields" "3" -!else ; Setup the survey controls, functions, etc. StrCpy $TmpVal "SOFTWARE\Microsoft\IE Setup\Setup" ClearErrors @@ -369,12 +398,13 @@ Function un.preFinish !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "cancelenabled" "0" ${EndIf} ${EndIf} -!endif ${EndUnless} FunctionEnd +!endif ################################################################################ # Initialization Functions + Function .onInit ${UninstallOnInitCommon} FunctionEnd diff --git a/mozilla/other-licenses/7zstub/firefox/7zSD.sfx b/mozilla/other-licenses/7zstub/firefox/7zSD.sfx index 8dff92b14c445ec1812d283d52621dcbc5812203..65a7ede612a637e4eac69ef14dff78e340d270ef 100644 GIT binary patch delta 2031 zcmcIjOKTHR6uvjrK3qtbT@C|65%Ox&G_6f&XhlPP1S%TDMJJOx$>7YLaqdi-xS5Fl zfIdyj8_4j!5(zb>WTEhs@=lQ^1K7e<0_X0==4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M3pQ+>n+T*oXg&sdiinWpiIdSh1M pA$~E9{!1F8?i%&MH`A6;uXiBM4YBsabdvlM!`3m^>-hh)e*uhKO0)m~ diff --git a/mozilla/toolkit/mozapps/installer/windows/nsis/SetVistaDefaultApp.dll b/mozilla/toolkit/mozapps/installer/windows/nsis/SetVistaDefaultApp.dll new file mode 100755 index 0000000000000000000000000000000000000000..5735e0ad0b05c820b4eb38c16fa7c767d89f1e8b GIT binary patch literal 2560 zcmeHIQAkr^6h7Ato4O4P*Gp1&>4SlcKlcAKM0K}a+s5_Yad$1HAbJ>R zw}C`GSL`W`APEs6xL9C42=-J@5fKq2K?c!_+|GY@ud7fWL&3w&|DE%l^Z)mp|K9z7 z&$&sk0e~G<*8%1bsRWF1>p{b?`_Q}_p4BXQ=a|Tnw?Cc9vpHG1EOWzbk`qNqVG}$n zkBDqWWV=qs*kLKf`&_QtW^?J_tJu3ekB+MqZC9(%=VyHe#%?*)YV?0i95b*llT6cG ztFmYaAi~&T=E+*v;y!@eTgOxbR3U>vi-wBpd|#w40cCm3jg z7a)#oJBv!gn@Iq`>UFb}4S5!zal=5F^eOzPg64PX(zrGJ7X!Vj$PH_r{wK8Sm z&pk1ca0uYfS57OpNUX@;hdMU(dIG2+ z=RnC$pk56%lpF@umz;3!FkaA>s^b%k?y)1`*S^|t;)R8O z{vq4-t^B{brdWVk)R(AtQK`IV4S>a(eS_Do%yizL@A?+@tS;8p#d`OCz8Wb#o;k@cq(2CdCKSoD2?|kXK}Z7drsP znUjK);DoTu^LPXqkz{TRBd0=ry`hM|&6g4c02c(Mpv-d$-!0}9PE2C9B=A<)tjxMQ z+Ppx&&UI};zZI3B(u1*^BE)zlp25Ys_#qC_mi9KCkIIr eiIMXpL2i&cWRAQcZ^_3^?t-1t-fo>+@4#;eYwo`Q literal 0 HcmV?d00001 diff --git a/mozilla/toolkit/mozapps/installer/windows/nsis/UAC.dll b/mozilla/toolkit/mozapps/installer/windows/nsis/UAC.dll new file mode 100755 index 0000000000000000000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D*f1K z5BNMC9#`*1$4-PG1a`K{(dd8!YqZxgc0VfRi`Sd(Usb!d77Bztlga%*`f1?J@vSY+ zzBe+UVPt4H8hj3(t%d!gZ;PF=uTt>&gWsu}PK5}her|t_eIwPcW6jI~YjxnCOD^Wa zpNZAsiS2>Nq5(C=`q>lsggh5*oUYjtwwhtX@Soa$EY+XJ`)gS{aQv);(<8KWY%h9e z;V%z=@24xuR|&v>X}oU{`cAXESaMchc4}N6Tfu$_&Smt4QlqZ-)$qQtS$+68p3}@@ zEy#fk>?2Nd30uc{!BY?`^n=H4)XO=w5Zlf1t009}u+DMd?@rBgomLlU<*|trEjuXm z;_opQ0L9J}CB_cS(CXy0KDdF_4AIY542;nyeDhbdu8>yz<%+*q@!wY*U-6R_r&ruu zbX!qfk+Z0+=<%Xh(ccywDM}QbEBcS3Z1X~MnR%7D!`x%uVeU7_%=^uMYkuAQiFtl; zQL(eQw|KDlQt|GRS4;l6%(N`AEVI;F+ANP+c3Zw~Ic|B+a>b%6`*PWu^44-+`Hu1@%fDZKsC=mW zbonpKe^>r#xyGuqF0|fft+TGTc3K~`e$)CL>-VfbvYxP>v;M|<)tX*0zoMYRS|L<8 zDju$IR|G2hD*7w_y5c((Kd5-Q;?;_giqVSP$`30)uAHh|XuH=|Y^%0CXmiwMbmd>H z{PxNhR=&LQ=PNI)Tm*SlSk_uPEgs7gmXPI;-oUOR4vZ-=I z<;#^vE00y4th`p4X*1gHwB2JXv^`|oU~}8H+jiN$YJ1N1CM5bR+k3W;Y)h-Usv=cS jSADzc*{b7Jr>a;rqpJrv7;T}hFsG2JfBya7k-&cfN8H@) literal 0 HcmV?d00001 diff --git a/mozilla/toolkit/mozapps/installer/windows/nsis/common.nsh b/mozilla/toolkit/mozapps/installer/windows/nsis/common.nsh index 64b004aad35..8e4a7be53b8 100755 --- a/mozilla/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/mozilla/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -1260,6 +1260,7 @@ /** * Writes common registry values for a handler using SHCTX. + * * @param _KEY * The subkey in relation to the key root. * @param _VALOPEN @@ -1397,6 +1398,162 @@ !endif !macroend +/** + * Writes common registry values for a handler that uses DDE using SHCTX. + * + * @param _KEY + * The key name in relation to the HKCR root. SOFTWARE\Classes is + * prefixed to this value when using SHCTX. + * @param _VALOPEN + * The path and args to launch the application. + * @param _VALICON + * The path to an exe that contains an icon and the icon resource id. + * @param _DISPNAME + * The display name for the handler. If emtpy no value will be set. + * @param _ISPROTOCOL + * Sets protocol handler specific registry values when "true". + * @param _DDE_APPNAME + * Sets DDE specific registry values when not an empty string. + * + * $R0 = storage for SOFTWARE\Classes + * $R1 = string value of the current registry key path. + * $R2 = _KEY + * $R3 = _VALOPEN + * $R4 = _VALICON + * $R5 = _DISPNAME + * $R6 = _ISPROTOCOL + * $R7 = _DDE_APPNAME + * $R8 = _DDE_DEFAULT + * $R9 = _DDE_TOPIC + */ +!macro AddDDEHandlerValues + + !ifndef ${_MOZFUNC_UN}AddDDEHandlerValues + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !define ${_MOZFUNC_UN}AddDDEHandlerValues "!insertmacro ${_MOZFUNC_UN}AddDDEHandlerValuesCall" + + Function ${_MOZFUNC_UN}AddDDEHandlerValues + Exch $R9 + Exch 1 + Exch $R8 + Exch 2 + Exch $R7 + Exch 3 + Exch $R6 + Exch 4 + Exch $R5 + Exch 5 + Exch $R4 + Exch 6 + Exch $R3 + Exch 7 + Exch $R2 + Push $R1 + Push $R0 + + StrCpy $R0 "SOFTWARE\Classes" + StrCmp "$R5" "" +6 +1 + ReadRegStr $R1 SHCTX "$R2" "FriendlyTypeName" + + StrCmp "$R1" "" +1 +3 + WriteRegStr SHCTX "$R0\$R2" "" "$R5" + WriteRegStr SHCTX "$R0\$R2" "FriendlyTypeName" "$R5" + + StrCmp "$R6" "true" +1 +8 + WriteRegStr SHCTX "$R0\$R2" "URL Protocol" "" + StrCpy $R1 "" + ClearErrors + ReadRegDWord $R1 SHCTX "$R0\$R2" "EditFlags" + StrCmp $R1 "" +1 +3 ; Only add EditFlags if a value doesn't exist + DeleteRegValue SHCTX "$R0\$R2" "EditFlags" + WriteRegDWord SHCTX "$R0\$R2" "EditFlags" 0x00000002 + + StrCmp "$R4" "" +2 +1 + WriteRegStr SHCTX "$R0\$R2\DefaultIcon" "" "$R4" + + WriteRegStr SHCTX "$R0\$R2\shell\open\command" "" "$R3" + + WriteRegStr SHCTX "$R0\$R2\shell\open\ddeexec" "" "$R8" + WriteRegStr SHCTX "$R0\$R2\shell\open\ddeexec" "NoActivateHandler" "" + WriteRegStr SHCTX "$R0\$R2\shell\open\ddeexec\Application" "" "$R7" + WriteRegStr SHCTX "$R0\$R2\shell\open\ddeexec\Topic" "" "$R9" + + ; The ifexec key may have been added by another application so try to + ; delete it to prevent it from breaking this app's shell integration. + ; Also, IE 6 and below doesn't remove this key when it sets itself as the + ; default handler and if this key exists IE's shell integration breaks. + DeleteRegKey HKLM "$R0\$R2\shell\open\ddeexec\ifexec" + DeleteRegKey HKCU "$R0\$R2\shell\open\ddeexec\ifexec" + ClearErrors + + Pop $R0 + Pop $R1 + Exch $R2 + Exch 7 + Exch $R3 + Exch 6 + Exch $R4 + Exch 5 + Exch $R5 + Exch 4 + Exch $R6 + Exch 3 + Exch $R7 + Exch 2 + Exch $R8 + Exch 1 + Exch $R9 + FunctionEnd + + !verbose pop + !endif +!macroend + +!macro AddDDEHandlerValuesCall _KEY _VALOPEN _VALICON _DISPNAME _ISPROTOCOL _DDE_APPNAME _DDE_DEFAULT _DDE_TOPIC + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_KEY}" + Push "${_VALOPEN}" + Push "${_VALICON}" + Push "${_DISPNAME}" + Push "${_ISPROTOCOL}" + Push "${_DDE_APPNAME}" + Push "${_DDE_DEFAULT}" + Push "${_DDE_TOPIC}" + Call AddDDEHandlerValues + !verbose pop +!macroend + +!macro un.AddDDEHandlerValuesCall _KEY _VALOPEN _VALICON _DISPNAME _ISPROTOCOL _DDE_APPNAME _DDE_DEFAULT _DDE_TOPIC + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_KEY}" + Push "${_VALOPEN}" + Push "${_VALICON}" + Push "${_DISPNAME}" + Push "${_ISPROTOCOL}" + Push "${_DDE_APPNAME}" + Push "${_DDE_DEFAULT}" + Push "${_DDE_TOPIC}" + Call un.AddDDEHandlerValues + !verbose pop +!macroend + +!macro un.AddDDEHandlerValues + !ifndef un.AddDDEHandlerValues + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !undef _MOZFUNC_UN + !define _MOZFUNC_UN "un." + + !insertmacro AddDDEHandlerValues + + !undef _MOZFUNC_UN + !define _MOZFUNC_UN + !verbose pop + !endif +!macroend ################################################################################ # Macros for retrieving existing install paths @@ -2446,6 +2603,356 @@ !endif !macroend +/** + * Removes an application specific handler registry key under Software\Classes + * for both HKCU and HKLM when its open command refers to this install + * location or the install location doesn't exist. + * + * @param _HANDLER_NAME + * The registry name for the handler. + * + * $R7 = stores the long path to the $INSTDIR + * $R8 = stores the path to the open command's parent directory + * $R9 = _HANDLER_NAME + */ +!macro RegCleanAppHandler + + !ifndef ${_MOZFUNC_UN}RegCleanAppHandler + !define _MOZFUNC_UN_TMP ${_MOZFUNC_UN} + !insertmacro ${_MOZFUNC_UN_TMP}GetLongPath + !insertmacro ${_MOZFUNC_UN_TMP}GetParent + !insertmacro ${_MOZFUNC_UN_TMP}GetPathFromString + !undef _MOZFUNC_UN + !define _MOZFUNC_UN ${_MOZFUNC_UN_TMP} + !undef _MOZFUNC_UN_TMP + + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !define ${_MOZFUNC_UN}RegCleanAppHandler "!insertmacro ${_MOZFUNC_UN}RegCleanAppHandlerCall" + + Function ${_MOZFUNC_UN}RegCleanAppHandler + Exch $R9 + Push $R8 + Push $R7 + + ClearErrors + ReadRegStr $R8 HKCU "Software\Classes\$R9\shell\open\command" "" + IfErrors next +1 + ${${_MOZFUNC_UN}GetPathFromString} "$R8" $R8 + ${${_MOZFUNC_UN}GetParent} "$R8" $R8 + IfFileExists "$R8" +3 +1 + DeleteRegKey HKCU "Software\Classes\$R9" + GoTo next + + ${${_MOZFUNC_UN}GetLongPath} "$R8" $R8 + ${${_MOZFUNC_UN}GetLongPath} "$INSTDIR" $R7 + StrCmp "$R7" "$R8" +1 next + DeleteRegKey HKCU "Software\Classes\$R9" + + next: + ReadRegStr $R8 HKLM "Software\Classes\$R9\shell\open\command" "" + IfErrors end + ${${_MOZFUNC_UN}GetPathFromString} "$R8" $R8 + ${${_MOZFUNC_UN}GetParent} "$R8" $R8 + IfFileExists "$R8" +3 +1 + DeleteRegKey HKLM "Software\Classes\$R9" + GoTo end + + ${${_MOZFUNC_UN}GetLongPath} "$R8" $R8 + ${${_MOZFUNC_UN}GetLongPath} "$INSTDIR" $R7 + StrCmp "$R7" "$R8" +1 end + DeleteRegKey HKLM "Software\Classes\$R9" + + end: + + Pop $R7 + Pop $R8 + Exch $R9 + FunctionEnd + + !verbose pop + !endif +!macroend + +!macro RegCleanAppHandlerCall _HANDLER_NAME + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_HANDLER_NAME}" + Call RegCleanAppHandler + !verbose pop +!macroend + +!macro un.RegCleanAppHandlerCall _HANDLER_NAME + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_HANDLER_NAME}" + Call un.RegCleanAppHandler + !verbose pop +!macroend + +!macro un.RegCleanAppHandler + !ifndef un.RegCleanAppHandler + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !undef _MOZFUNC_UN + !define _MOZFUNC_UN "un." + + !insertmacro RegCleanAppHandler + + !undef _MOZFUNC_UN + !define _MOZFUNC_UN + !verbose pop + !endif +!macroend + +/** + * Cleans up the registry for a protocol handler when its open command + * refers to this install location. For HKCU the registry key is deleted + * and for HKLM the values set by the application are deleted. + * + * @param _HANDLER_NAME + * The registry name for the handler. + * + * $R7 = stores the long path to $INSTDIR + * $R8 = stores the the long path to the open command's parent directory + * $R9 = _HANDLER_NAME + */ +!macro un.RegCleanProtocolHandler + + !ifndef un.RegCleanProtocolHandler + !insertmacro un.GetLongPath + !insertmacro un.GetParent + !insertmacro un.GetPathFromString + + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !define un.RegCleanProtocolHandler "!insertmacro un.RegCleanProtocolHandlerCall" + + Function un.RegCleanProtocolHandler + Exch $R9 + Push $R8 + Push $R7 + + ReadRegStr $R8 HKCU "Software\Classes\$R9\shell\open\command" "" + ${un.GetLongPath} "$INSTDIR" $R7 + + StrCmp "$R8" "" next +1 + ${un.GetPathFromString} "$R8" $R8 + ${un.GetParent} "$R8" $R8 + ${un.GetLongPath} "$R8" $R8 + StrCmp "$R7" "$R8" +1 next + DeleteRegKey HKCU "Software\Classes\$R9" + + next: + ReadRegStr $R8 HKLM "Software\Classes\$R9\shell\open\command" "" + StrCmp "$R8" "" end +1 + ${un.GetLongPath} "$INSTDIR" $R7 + ${un.GetPathFromString} "$R8" $R8 + ${un.GetParent} "$R8" $R8 + ${un.GetLongPath} "$R8" $R8 + StrCmp "$R7" "$R8" +1 end + DeleteRegValue HKLM "Software\Classes\$R9\DefaultIcon" "" + DeleteRegValue HKLM "Software\Classes\$R9\shell\open" "" + DeleteRegValue HKLM "Software\Classes\$R9\shell\ddeexec" "" + DeleteRegValue HKLM "Software\Classes\$R9\shell\ddeexec\Application" "" + DeleteRegValue HKLM "Software\Classes\$R9\shell\ddeexec\Topic" "" + + end: + + Pop $R7 + Pop $R8 + Exch $R9 + FunctionEnd + + !verbose pop + !endif +!macroend + +!macro un.RegCleanProtocolHandlerCall _HANDLER_NAME + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_HANDLER_NAME}" + Call un.RegCleanProtocolHandler + !verbose pop +!macroend + +/** + * Cleans up the registry for a file handler when the passed in value equals + * the default value for the file handler. For HKCU the registry key is deleted + * and for HKLM the default value is deleted. + * + * @param _HANDLER_NAME + * The registry name for the handler. + * @param _DEFAULT_VALUE + * The value to check for against the handler's default value. + * + * $R6 = stores the long path to $INSTDIR + * $R7 = _DEFAULT_VALUE + * $R9 = _HANDLER_NAME + */ +!macro RegCleanFileHandler + + !ifndef ${_MOZFUNC_UN}RegCleanFileHandler + !define _MOZFUNC_UN_TMP ${_MOZFUNC_UN} + !insertmacro ${_MOZFUNC_UN_TMP}GetLongPath + !insertmacro ${_MOZFUNC_UN_TMP}GetParent + !insertmacro ${_MOZFUNC_UN_TMP}GetPathFromString + !undef _MOZFUNC_UN + !define _MOZFUNC_UN ${_MOZFUNC_UN_TMP} + !undef _MOZFUNC_UN_TMP + + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !define ${_MOZFUNC_UN}RegCleanFileHandler "!insertmacro ${_MOZFUNC_UN}RegCleanFileHandlerCall" + + Function ${_MOZFUNC_UN}RegCleanFileHandler + Exch $R9 + Exch 1 + Exch $R8 + Push $R7 + + ReadRegStr $R7 HKCU "Software\Classes\$R9" "" + StrCmp "$R7" "$R8" +1 +2 + DeleteRegKey HKCU "Software\Classes\$R9" + + ReadRegStr $R7 HKLM "Software\Classes\$R9" "" + StrCmp "$R7" "$R8" +1 +2 + DeleteRegValue HKLM "Software\Classes\$R9" "" + + ClearErrors + + Pop $R7 + Exch $R8 + Exch 1 + Exch $R9 + FunctionEnd + + !verbose pop + !endif +!macroend + +!macro RegCleanFileHandlerCall _HANDLER_NAME _DEFAULT_VALUE + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_DEFAULT_VALUE}" + Push "${_HANDLER_NAME}" + Call RegCleanFileHandler + !verbose pop +!macroend + +!macro un.RegCleanFileHandlerCall _HANDLER_NAME _DEFAULT_VALUE + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_DEFAULT_VALUE}" + Push "${_HANDLER_NAME}" + Call un.RegCleanFileHandler + !verbose pop +!macroend + +!macro un.RegCleanFileHandler + !ifndef un.RegCleanFileHandler + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !undef _MOZFUNC_UN + !define _MOZFUNC_UN "un." + + !insertmacro RegCleanFileHandler + + !undef _MOZFUNC_UN + !define _MOZFUNC_UN + !verbose pop + !endif +!macroend + +/** + * Checks if a handler's open command points to this installation directory. + * + * @param _HANDLER_NAME + * The registry name for the handler. + * @param _RESULT + * true if it is the handler's open command points to this + * installation directory and false if it does not. + * + * $R7 = stores the value of the open command and the path macros return values + * $R8 = stores the handler's registry key name + * $R9 = _DEFAULT_VALUE and _RESULT + */ +!macro IsHandlerForInstallDir + + !ifndef ${_MOZFUNC_UN}IsHandlerForInstallDir + !define _MOZFUNC_UN_TMP ${_MOZFUNC_UN} + !insertmacro ${_MOZFUNC_UN_TMP}GetLongPath + !insertmacro ${_MOZFUNC_UN_TMP}GetParent + !insertmacro ${_MOZFUNC_UN_TMP}GetPathFromString + !undef _MOZFUNC_UN + !define _MOZFUNC_UN ${_MOZFUNC_UN_TMP} + !undef _MOZFUNC_UN_TMP + + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !define ${_MOZFUNC_UN}IsHandlerForInstallDir "!insertmacro ${_MOZFUNC_UN}IsHandlerForInstallDirCall" + + Function ${_MOZFUNC_UN}IsHandlerForInstallDir + Exch $R9 + Push $R8 + Push $R7 + + StrCpy $R8 "$R9" + StrCpy $R9 "false" + ReadRegStr $R7 HKCR "$R8\shell\open\command" "" + StrCmp "$R7" "" end + + ${GetPathFromString} "$R7" $R7 + ${GetParent} "$R7" $R7 + ${GetLongPath} "$R7" $R7 + StrCmp "$R7" "$INSTDIR" +1 end + StrCpy $R9 "true" + + end: + ClearErrors + + Pop $R7 + Pop $R8 + Exch $R9 + FunctionEnd + + !verbose pop + !endif +!macroend + +!macro IsHandlerForInstallDirCall _HANDLER_NAME _RESULT + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_HANDLER_NAME}" + Call IsHandlerForInstallDir + Pop "${_RESULT}" + !verbose pop +!macroend + +!macro un.IsHandlerForInstallDirCall _HANDLER_NAME _RESULT + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Push "${_HANDLER_NAME}" + Call un.IsHandlerForInstallDir + Pop "${_RESULT}" + !verbose pop +!macroend + +!macro un.IsHandlerForInstallDir + !ifndef un.IsHandlerForInstallDir + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !undef _MOZFUNC_UN + !define _MOZFUNC_UN "un." + + !insertmacro IsHandlerForInstallDir + + !undef _MOZFUNC_UN + !define _MOZFUNC_UN + !verbose pop + !endif +!macroend + /** * If present removes the VirtualStore directory for this installation. Uses the * program files directory path and the current install location to determine @@ -2858,6 +3365,7 @@ Push $R2 Push $R1 Push $R0 + Push $TmpVal IfFileExists "$INSTDIR\uninstall\uninstall.log" +1 end @@ -2879,6 +3387,7 @@ end: + Pop $TmpVal Pop $R0 Pop $R1 Pop $R2 @@ -3063,6 +3572,7 @@ !insertmacro GetOptions !insertmacro GetParameters !insertmacro GetSize + !insertmacro ElevateUAC !verbose push !verbose ${_MOZFUNC_VERBOSE} @@ -3083,6 +3593,10 @@ !endif ${GetParameters} $R8 + + ; Require elevation if the user can elevate + ${ElevateUAC} + ${If} $R8 != "" ClearErrors ${GetOptions} "$R8" "-ms" $R7 @@ -3230,6 +3744,7 @@ !insertmacro GetOptions !insertmacro GetParameters !insertmacro UpdateUninstallLog + !insertmacro ElevateUAC !verbose push !verbose ${_MOZFUNC_VERBOSE} @@ -3246,42 +3761,60 @@ StrCmp "$R0" "" continue +1 - StrCmp "$R0" "/HideShortcuts" +1 showshortcuts + ; Require elevation if the user can elevate + ClearErrors + ${GetOptions} "$R0" "/HideShortcuts" $R2 + IfErrors showshortcuts +1 + ${ElevateUAC} ${HideShortcuts} StrCpy $R1 "true" StrCmp "$R1" "true" continue + ; Require elevation if the user can elevate showshortcuts: - StrCmp "$R0" "/ShowShortcuts" +1 defaultappuser + ClearErrors + ${GetOptions} "$R0" "/ShowShortcuts" $R2 + IfErrors defaultappuser +1 + ${ElevateUAC} ${ShowShortcuts} StrCpy $R1 "true" GoTo continue + ; Require elevation if the the StartMenuInternet registry keys require + ; updating and the user can elevate defaultappuser: - StrCmp "$R0" "/SetAsDefaultAppUser" +1 defaultappglobal + ClearErrors + ${GetOptions} "$R0" "/SetAsDefaultAppUser" $R2 + IfErrors defaultappglobal +1 ${SetAsDefaultAppUser} StrCpy $R1 "true" GoTo continue + ; Require elevation if the user can elevate defaultappglobal: - StrCmp "$R0" "/SetAsDefaultAppGlobal" +1 postupdate + ClearErrors + ${GetOptions} "$R0" "/SetAsDefaultAppGlobal" $R2 + IfErrors postupdate +1 + ${ElevateUAC} ${SetAsDefaultAppGlobal} StrCpy $R1 "true" GoTo continue + ; Do not attempt to elevate. The application launching this executable is + ; responsible for elevation if it is required. postupdate: ${WordReplace} "$R0" "$\"" "" "+" $R0 ClearErrors ${GetOptions} "$R0" "/PostUpdate" $R2 + StrCpy $R1 "true" IfErrors continue +1 + ; If the uninstall.log does not exist don't perform post update + ; operations. This prevents updating the registry for zip builds. + IfFileExists "$EXEDIR\uninstall.log" +1 continue ${PostUpdate} ClearErrors ${GetOptions} "$R0" "/UninstallLog=" $R2 - IfErrors +1 +4 - ${UpdateUninstallLog} - StrCpy $R1 "true" - GoTo continue - + IfErrors updateuninstalllog +1 StrCmp "$R2" "" continue +1 GetFullPathName $R3 "$R2" IfFileExists "$R3" +1 continue @@ -3291,14 +3824,27 @@ ${GetParent} "$R3" $R4 Delete "$R3" RmDir "$R4" + GoTo continue + + ; Do not attempt to elevate. The application launching this executable is + ; responsible for elevation if it is required. + updateuninstalllog: + ${UpdateUninstallLog} StrCpy $R1 "true" - + continue: - StrCmp $R1 "true" +1 +3 System::Call "shell32::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)" Quit + ; If the uninstall.log does not exist don't perform uninstall + ; operations. This prevents running the uninstaller for zip builds. + IfFileExists "$EXEDIR\uninstall.log" +2 +1 + Quit + + ; Require elevation if the user can elevate + ${ElevateUAC} + ; If we made it this far then this installer is being used as an uninstaller. WriteUninstaller "$EXEDIR\uninstaller.exe" @@ -3506,7 +4052,6 @@ ; Remove the files and directories in the removed-files.log ${ParseRemovedFilesLog} - FunctionEnd !verbose pop @@ -3554,6 +4099,98 @@ !macroend +################################################################################ +# UAC Related Macros + +/** + * Provides UAC elevation support for Vista and above (requires the UAC plugin). + * + * $0 = return values from calls to the UAC plugin (always uses $0) + * $R9 = return values from GetParameters and GetOptions macros + */ +!macro ElevateUAC + + !ifndef ${_MOZFUNC_UN}ElevateUAC + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !define ${_MOZFUNC_UN}ElevateUAC "!insertmacro ${_MOZFUNC_UN}ElevateUACCall" + + Function ${_MOZFUNC_UN}ElevateUAC + Push $R9 + Push $0 + +; USE_UAC_PLUGIN is temporary until Thunderbird has been updated to use the UAC plugin +!ifdef USE_UAC_PLUGIN + !ifdef ___WINVER__NSH___ + ${If} ${AtLeastWinVista} + UAC::IsAdmin + ; If the user is not an admin already + ${If} "$0" != "1" + UAC::SupportsUAC + ; If the system supports UAC + ${If} "$0" == "1" + UAC::GetElevationType + ; If the user account has a split token + ${If} "$0" == "3" + UAC::RunElevated + Quit + ${EndIf} + ${EndIf} + ${Else} + ${GetParameters} $R9 + ${If} $R9 != "" + ClearErrors + ${GetOptions} "$R9" "/UAC:" $0 + ; If the command line contains /UAC then we need to initialize + ; the UAC plugin to use UAC::ExecCodeSegment to execute code in + ; the non-elevated context. + ${Unless} ${Errors} + UAC::RunElevated + ${EndUnless} + ${EndIf} + ${EndIf} + ${EndIf} + !endif +!endif + + Pop $0 + Pop $R9 + FunctionEnd + + !verbose pop + !endif +!macroend + +!macro ElevateUACCall + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Call ElevateUAC + !verbose pop +!macroend + +!macro un.ElevateUACCall + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + Call un.ElevateUAC + !verbose pop +!macroend + +!macro un.ElevateUAC + !ifndef un.ElevateUAC + !verbose push + !verbose ${_MOZFUNC_VERBOSE} + !undef _MOZFUNC_UN + !define _MOZFUNC_UN "un." + + !insertmacro ElevateUAC + + !undef _MOZFUNC_UN + !define _MOZFUNC_UN + !verbose pop + !endif +!macroend + + ################################################################################ # Macros for logging # diff --git a/mozilla/toolkit/mozapps/installer/windows/nsis/makensis.mk b/mozilla/toolkit/mozapps/installer/windows/nsis/makensis.mk index 53f783a6eec..a94dd0f2c3b 100755 --- a/mozilla/toolkit/mozapps/installer/windows/nsis/makensis.mk +++ b/mozilla/toolkit/mozapps/installer/windows/nsis/makensis.mk @@ -49,7 +49,9 @@ TOOLKIT_NSIS_FILES = \ locales.nsi \ nsProcess.dll \ overrides.nsh \ + SetVistaDefaultApp.dll \ ShellLink.dll \ + UAC.dll \ version.nsh \ $(NULL) diff --git a/mozilla/toolkit/xre/nsAppRunner.cpp b/mozilla/toolkit/xre/nsAppRunner.cpp index 64aa963533a..622b4a73d84 100644 --- a/mozilla/toolkit/xre/nsAppRunner.cpp +++ b/mozilla/toolkit/xre/nsAppRunner.cpp @@ -700,22 +700,6 @@ nsXULAppInfo::LaunchAppHelperWithArgs(int aArgc, char **aArgv) return NS_OK; } -NS_IMETHODIMP -nsXULAppInfo::FixReg() -{ - int resetRegArgc = 2; - char **resetRegArgv = (char**) malloc(sizeof(char*) * (resetRegArgc + 1)); - if (!resetRegArgv) - return NS_ERROR_OUT_OF_MEMORY; - - resetRegArgv[0] = "argv0ignoredbywinlaunchchild"; - resetRegArgv[1] = "/fixreg"; - resetRegArgv[2] = nsnull; - nsresult rv = LaunchAppHelperWithArgs(resetRegArgc, resetRegArgv); - free(resetRegArgv); - return rv; -} - NS_IMETHODIMP nsXULAppInfo::PostUpdate(nsILocalFile *aLogFile) { diff --git a/mozilla/toolkit/xre/nsIWinAppHelper.idl b/mozilla/toolkit/xre/nsIWinAppHelper.idl index a1d2c381d40..5e9b29f6d27 100644 --- a/mozilla/toolkit/xre/nsIWinAppHelper.idl +++ b/mozilla/toolkit/xre/nsIWinAppHelper.idl @@ -46,10 +46,9 @@ interface nsILocalFile; -[scriptable, uuid(b0fb682a-8287-4b0f-b628-65bb206c073f)] +[scriptable, uuid(2bd9ec66-05eb-4f63-8825-a83ccf00fc7f)] interface nsIWinAppHelper : nsISupports { void postUpdate(in nsILocalFile logFile); - void fixReg(); readonly attribute boolean userCanElevate; };