Merge mozilla-central into mozilla-inbound

This commit is contained in:
Ehsan Akhgari 2012-09-21 13:34:50 -04:00
Родитель e852b08eb1 5876222537
Коммит dc32cead74
21 изменённых файлов: 498 добавлений и 399 удалений

Просмотреть файл

@ -443,7 +443,9 @@ BrowserGlue.prototype = {
(ss.sessionType == Ci.nsISessionStartup.RECOVER_SESSION);
}
catch (ex) { /* never mind; suppose SessionStore is broken */ }
if (shouldCheck && !shell.isDefaultBrowser(true) && !willRecoverSession) {
if (shouldCheck &&
!shell.isDefaultBrowser(true, false) &&
!willRecoverSession) {
Services.tm.mainThread.dispatch(function() {
var win = this.getMostRecentBrowserWindow();
var brandBundle = win.document.getElementById("bundle_brand");
@ -460,8 +462,22 @@ BrowserGlue.prototype = {
var rv = ps.confirmEx(win, promptTitle, promptMessage,
ps.STD_YES_NO_BUTTONS,
null, null, null, checkboxLabel, checkEveryTime);
if (rv == 0)
shell.setDefaultBrowser(true, false);
if (rv == 0) {
var claimAllTypes = true;
#ifdef XP_WIN
try {
// In Windows 8, the UI for selecting default protocol is much
// nicer than the UI for setting file type associations. So we
// only show the protocol association screen on Windows 8.
// Windows 8 is version 6.2.
let version = Cc["@mozilla.org/system-info;1"]
.getService(Ci.nsIPropertyBag2)
.getProperty("version");
claimAllTypes = (parseFloat(version) < 6.2);
} catch (ex) { }
#endif
shell.setDefaultBrowser(claimAllTypes, false);
}
shell.shouldCheckDefaultBrowser = checkEveryTime.value;
}.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
}

Просмотреть файл

@ -30,7 +30,28 @@ var gAdvancedPane = {
#ifdef HAVE_SHELL_SERVICE
this.updateSetDefaultBrowser();
#ifdef XP_WIN
let shellSvc = getShellService();
// In Windows 8 we launch the control panel since it's the only
// way to get all file type association prefs. So we don't know
// when the user will select the default. We refresh here periodically
// in case the default changes.
if (!shellSvc.isDefaultBrowser(false, true)) {
var isWin8OrHigher = false;
try {
let version = Components.classes["@mozilla.org/system-info;1"].
getService(Components.interfaces.nsIPropertyBag2).
getProperty("version");
isWin8OrHigher = parseFloat(version) >= 6.2;
} catch (ex) { }
if (isWin8OrHigher) {
window.setInterval(this.updateSetDefaultBrowser, 1000);
}
}
#endif
#endif
#ifdef MOZ_UPDATER
this.updateReadPrefs();
#endif
@ -697,7 +718,8 @@ var gAdvancedPane = {
document.getElementById("alwaysCheckDefault").disabled = true;
return;
}
let selectedIndex = shellSvc.isDefaultBrowser(false) ? 1 : 0;
let selectedIndex =
shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
setDefaultPane.selectedIndex = selectedIndex;
},
@ -710,7 +732,9 @@ var gAdvancedPane = {
if (!shellSvc)
return;
shellSvc.setDefaultBrowser(true, false);
document.getElementById("setDefaultPane").selectedIndex = 1;
let selectedIndex =
shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
}
#endif
};

Просмотреть файл

@ -22,6 +22,26 @@ var gAdvancedPane = {
#ifdef HAVE_SHELL_SERVICE
this.updateSetDefaultBrowser();
#ifdef XP_WIN
let shellSvc = getShellService();
// In Windows 8 we launch the control panel since it's the only
// way to get all file type association prefs. So we don't know
// when the user will select the default. We refresh here periodically
// in case the default changes.
if (!shellSvc.isDefaultBrowser(false, true)) {
var isWin8OrHigher = false;
try {
let version = Components.classes["@mozilla.org/system-info;1"].
getService(Components.interfaces.nsIPropertyBag2).
getProperty("version");
isWin8OrHigher = parseFloat(version) >= 6.2;
} catch (ex) { }
if (isWin8OrHigher) {
window.setInterval(this.updateSetDefaultBrowser, 1000);
}
}
#endif
#endif
#ifdef MOZ_UPDATER
this.updateReadPrefs();
@ -672,7 +692,8 @@ var gAdvancedPane = {
document.getElementById("alwaysCheckDefault").disabled = true;
return;
}
let selectedIndex = shellSvc.isDefaultBrowser(false) ? 1 : 0;
let selectedIndex =
shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
setDefaultPane.selectedIndex = selectedIndex;
},
@ -685,7 +706,9 @@ var gAdvancedPane = {
if (!shellSvc)
return;
shellSvc.setDefaultBrowser(true, false);
document.getElementById("setDefaultPane").selectedIndex = 1;
let selectedIndex =
shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
}
#endif
};

Просмотреть файл

@ -8,19 +8,23 @@
interface nsIDOMElement;
interface nsIFile;
[scriptable, uuid(bb477da4-dddf-4106-a562-f06c85c7f9a8)]
[scriptable, uuid(99d2e9f1-3c86-40f7-81fd-3060c18489f0)]
interface nsIShellService : nsISupports
{
/**
* Determines whether or not Firefox is the "Default Browser."
* This is simply whether or not Firefox is registered to handle
* http links.
*
* This is simply whether or not Firefox is registered to handle
* http links.
*
* @param aStartupCheck true if this is the check being performed
* by the first browser window at startup,
* false otherwise.
* by the first browser window at startup,
* false otherwise.
* @param aForAllTypes true if the check should be made for HTTP and HTML.
* false if the check should be made for HTTP only.
* This parameter may be ignored on some platforms.
*/
boolean isDefaultBrowser(in boolean aStartupCheck);
boolean isDefaultBrowser(in boolean aStartupCheck,
[optional] in boolean aForAllTypes);
/**
* Registers Firefox as the "Default Browser."

Просмотреть файл

@ -197,6 +197,7 @@ nsGNOMEShellService::CheckHandlerMatchesAppName(const nsACString &handler) const
NS_IMETHODIMP
nsGNOMEShellService::IsDefaultBrowser(bool aStartupCheck,
bool aForAllTypes,
bool* aIsDefaultBrowser)
{
*aIsDefaultBrowser = false;

Просмотреть файл

@ -32,7 +32,9 @@
NS_IMPL_ISUPPORTS3(nsMacShellService, nsIMacShellService, nsIShellService, nsIWebProgressListener)
NS_IMETHODIMP
nsMacShellService::IsDefaultBrowser(bool aStartupCheck, bool* aIsDefaultBrowser)
nsMacShellService::IsDefaultBrowser(bool aStartupCheck,
bool aForAllTypes,
bool* aIsDefaultBrowser)
{
*aIsDefaultBrowser = false;

Просмотреть файл

@ -320,7 +320,8 @@ IsWin8OrLater()
}
bool
nsWindowsShellService::IsDefaultBrowserVista(bool* aIsDefaultBrowser)
nsWindowsShellService::IsDefaultBrowserVista(bool aCheckAllTypes,
bool* aIsDefaultBrowser)
{
IApplicationAssociationRegistration* pAAR;
HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
@ -348,6 +349,22 @@ nsWindowsShellService::IsDefaultBrowserVista(bool* aIsDefaultBrowser)
} else {
*aIsDefaultBrowser = false;
}
// If this is a startup check, then we don't check file type
// associations. This is because the win8 UI for file type
// association has to be done through the control panel. If this
// is not a startup check, then we're checking through the control
// panel and we should also check for file type association.
if (aCheckAllTypes && *aIsDefaultBrowser) {
hr = pAAR->QueryCurrentDefault(L".html", AT_FILEEXTENSION, AL_EFFECTIVE,
&registeredApp);
if (SUCCEEDED(hr)) {
LPCWSTR firefoxHTMLProgID = L"FirefoxHTML";
*aIsDefaultBrowser = !wcsicmp(registeredApp, firefoxHTMLProgID);
CoTaskMemFree(registeredApp);
} else {
*aIsDefaultBrowser = false;
}
}
}
pAAR->Release();
@ -358,19 +375,17 @@ nsWindowsShellService::IsDefaultBrowserVista(bool* aIsDefaultBrowser)
NS_IMETHODIMP
nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
bool aForAllTypes,
bool* aIsDefaultBrowser)
{
// 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
// checked this session (so that subsequent window opens don't show the
// default browser dialog).
if (aStartupCheck)
mCheckedThisSession = true;
return IsDefaultBrowser(aIsDefaultBrowser);
}
nsresult
nsWindowsShellService::IsDefaultBrowser(bool* aIsDefaultBrowser)
{
// Assume we're the default unless one of the several checks below tell us
// otherwise.
*aIsDefaultBrowser = true;
PRUnichar exePath[MAX_BUF];
@ -448,7 +463,7 @@ nsWindowsShellService::IsDefaultBrowser(bool* aIsDefaultBrowser)
// Only check if Firefox is the default browser on Vista and above if the
// previous checks show that Firefox is the default browser.
if (*aIsDefaultBrowser) {
IsDefaultBrowserVista(aIsDefaultBrowser);
IsDefaultBrowserVista(aForAllTypes, aIsDefaultBrowser);
}
// To handle the case where DDE isn't disabled due for a user because there
@ -588,6 +603,49 @@ DynSHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
NS_ERROR_FAILURE;
}
nsresult
nsWindowsShellService::LaunchControlPanelDefaultPrograms()
{
// Build the path control.exe path safely
WCHAR controlEXEPath[MAX_PATH + 1] = { '\0' };
if (!GetSystemDirectoryW(controlEXEPath, MAX_PATH)) {
return NS_ERROR_FAILURE;
}
LPCWSTR controlEXE = L"control.exe";
if (wcslen(controlEXEPath) + wcslen(controlEXE) >= MAX_PATH) {
return NS_ERROR_FAILURE;
}
if (!PathAppendW(controlEXEPath, controlEXE)) {
return NS_ERROR_FAILURE;
}
WCHAR params[] = L"control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram";
STARTUPINFOW si = {sizeof(si), 0};
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWDEFAULT;
PROCESS_INFORMATION pi = {0};
if (!CreateProcessW(controlEXEPath, params, NULL, NULL, FALSE, 0, NULL,
NULL, &si, &pi)) {
return NS_ERROR_FAILURE;
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return NS_OK;
}
nsresult
nsWindowsShellService::LaunchHTTPHandlerPane()
{
OPENASINFO info;
info.pcszFile = L"http";
info.pcszClass = NULL;
info.oaifInFlags = OAIF_FORCE_REGISTRATION |
OAIF_URL_PROTOCOL |
OAIF_REGISTER_EXT;
return DynSHOpenWithDialog(NULL, &info);
}
NS_IMETHODIMP
nsWindowsShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
{
@ -603,18 +661,23 @@ nsWindowsShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
nsresult rv = LaunchHelper(appHelperPath);
if (NS_SUCCEEDED(rv) && IsWin8OrLater()) {
OPENASINFO info;
info.pcszFile = L"http";
info.pcszClass = NULL;
info.oaifInFlags = OAIF_FORCE_REGISTRATION |
OAIF_URL_PROTOCOL |
OAIF_REGISTER_EXT;
nsresult rv = DynSHOpenWithDialog(NULL, &info);
NS_ENSURE_SUCCESS(rv, rv);
bool isDefaultBrowser = false;
rv = NS_SUCCEEDED(IsDefaultBrowser(&isDefaultBrowser)) &&
isDefaultBrowser ? NS_OK : NS_ERROR_FAILURE;
if (aClaimAllTypes) {
rv = LaunchControlPanelDefaultPrograms();
// The above call should never really fail, but just in case
// fall back to showing the HTTP association screen only.
if (NS_FAILED(rv)) {
rv = LaunchHTTPHandlerPane();
}
} else {
rv = LaunchHTTPHandlerPane();
// The above calls hould never really fail, but just in case
// fallb ack to showing control panel for all defaults
if (NS_FAILED(rv)) {
rv = LaunchControlPanelDefaultPrograms();
}
}
}
return rv;
}

Просмотреть файл

@ -25,8 +25,9 @@ public:
NS_DECL_NSIWINDOWSSHELLSERVICE
protected:
static nsresult IsDefaultBrowser(bool* aIsDefaultBrowser);
static bool IsDefaultBrowserVista(bool* aIsDefaultBrowser);
bool IsDefaultBrowserVista(bool aCheckAllTypes, bool* aIsDefaultBrowser);
nsresult LaunchControlPanelDefaultPrograms();
nsresult LaunchHTTPHandlerPane();
private:
bool mCheckedThisSession;

Просмотреть файл

@ -10,5 +10,6 @@ function test() {
getService(Ci.nsIShellService);
shell.setDefaultBrowser(true, false);
ok(shell.isDefaultBrowser(true), "we got here and are the default browser");
ok(shell.isDefaultBrowser(true, false), "we got here and are the default browser");
ok(shell.isDefaultBrowser(true, true), "we got here and are the default browser");
}

Просмотреть файл

@ -53,6 +53,10 @@
!define MOZ_MAINTENANCE_SERVICE
#endif
#ifdef MOZ_METRO
!define MOZ_METRO
#endif
# File details shared by both the installer and uninstaller
VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "${BrandShortName}"

Просмотреть файл

@ -76,6 +76,7 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
!insertmacro CleanUpdatesDir
!insertmacro CopyFilesFromDir
!insertmacro CreateRegKey
!insertmacro GetLongPath
!insertmacro GetPathFromString
!insertmacro GetParent
!insertmacro InitHashAppModelId
@ -90,6 +91,9 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
!insertmacro RegCleanAppHandler
!insertmacro RegCleanMain
!insertmacro RegCleanUninstall
!ifdef MOZ_METRO
!insertmacro RemoveDEHRegistrationIfMatching
!endif
!insertmacro SetAppLSPCategories
!insertmacro SetBrandNameVars
!insertmacro UpdateShortcutAppModelIDs
@ -324,16 +328,43 @@ Section "-Application" APP_IDX
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
StrCpy $2 "$\"$8$\" -osint -url $\"%1$\""
; In Win8, the delegate execute handler picks up the value in FirefoxURL and
; FirefoxHTML to launch the desktop browser when it needs to.
${AddDisabledDDEHandlerValues} "FirefoxHTML" "$2" "$8,1" \
"${AppRegName} Document" ""
${AddDisabledDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" \
"true"
${If} ${AtLeastWin8}
!ifdef MOZ_METRO
${CleanupMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID}
${AddMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID} \
"$INSTDIR\CommandExecuteHandler.exe" \
$AppUserModelID \
"FirefoxURL" \
"FirefoxHTML"
!endif
; Set the Start Menu Internet and Vista Registered App HKCU registry keys.
${SetStartMenuInternet} "HKCU"
${FixShellIconHandler} "HKCU"
; The following keys should only be set if we can write to HKLM
; If we create either the desktop or start menu shortcuts, then
; set IconsVisible to 1 otherwise to 0.
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo"
${If} $AddDesktopSC == 1
${OrIf} $AddStartMenuSC == 1
WriteRegDWORD HKCU "$0" "IconsVisible" 1
${Else}
WriteRegDWORD HKCU "$0" "IconsVisible" 0
${EndIf}
${EndIf}
; The following keys should only be set if we can write to HKLM for pre win8
; For post win8 we set the keys above in HKCU in addition to below in HKLM.
${If} $TmpVal == "HKLM"
; Set the Start Menu Internet and Vista Registered App HKLM registry keys.
${SetStartMenuInternet}
${FixShellIconHandler}
${SetStartMenuInternet} "HKLM"
${FixShellIconHandler} "HKLM"
; If we are writing to HKLM and create either the desktop or start menu
; shortcuts set IconsVisible to 1 otherwise to 0.
@ -444,7 +475,7 @@ Section "-Application" APP_IDX
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID"
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${LogMsg} "Added Shortcut: $SMPROGRAMS\${BrandFullName}.lnk"
${Else}
@ -459,7 +490,7 @@ Section "-Application" APP_IDX
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID"
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${LogMsg} "Added Shortcut: $DESKTOP\${BrandFullName}.lnk"
${Else}

Просмотреть файл

@ -2,6 +2,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
; The registration ID of the COM server which is used for choosing wether
; to launch the Win8 metro browser or desktop browser.
!define DELEGATE_EXECUTE_HANDLER_ID {5100FEC1-212B-4BF5-9BF8-3E650FD794A3}
!macro PostUpdate
${CreateShortcutsLog}
@ -30,14 +34,15 @@
${RegCleanMain} "Software\Mozilla"
${RegCleanUninstall}
${UpdateProtocolHandlers}
${FixShellIconHandler}
${FixShellIconHandler} "HKLM"
${SetAppLSPCategories} ${LSP_CATEGORIES}
; Win7 taskbar and start menu link maintenance
Call FixShortcutAppModelIDs
; Only update the Clients\StartMenuInternet registry key values if they
; don't exist or this installation is the same as the one set in those keys.
; Only update the Clients\StartMenuInternet registry key values in HKLM if
; they don't exist or this installation is the same as the one set in those
; keys.
${StrFilter} "${FileMainEXE}" "+" "" "" $1
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$1\DefaultIcon" ""
${GetPathFromString} "$0" $0
@ -46,7 +51,22 @@
${GetLongPath} "$0" $0
${EndIf}
${If} "$0" == "$INSTDIR"
${SetStartMenuInternet} ; Does not use SHCTX
${SetStartMenuInternet} "HKLM"
${EndIf}
; Only update the Clients\StartMenuInternet registry key values in HKCU if
; they don't exist or this installation is the same as the one set in those
; keys. This is only done in Windows 8 to avoid a UAC prompt.
${If} ${AtLeastWin8}
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$1\DefaultIcon" ""
${GetPathFromString} "$0" $0
${GetParent} "$0" $0
${If} ${FileExists} "$0"
${GetLongPath} "$0" $0
${EndIf}
${If} "$0" == "$INSTDIR"
${SetStartMenuInternet} "HKCU"
${EndIf}
${EndIf}
ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion"
@ -127,8 +147,8 @@
SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM)
${SetHandlers} ; Uses SHCTX
${SetStartMenuInternet} ; Does not use SHCTX
${FixShellIconHandler} ; Does not use SHCTX
${SetStartMenuInternet} "HKLM"
${FixShellIconHandler} "HKLM"
${ShowShortcuts}
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
WriteRegStr HKLM "Software\Clients\StartMenuInternet" "" "$R9"
@ -142,6 +162,9 @@
${StrFilter} "${FileMainEXE}" "+" "" "" $0
StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo"
WriteRegDWORD HKLM "$R1" "IconsVisible" 0
${If} ${AtLeastWin8}
WriteRegDWORD HKCU "$R1" "IconsVisible" 0
${EndIf}
SetShellVarContext all ; Set $DESKTOP to All Users
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
@ -201,6 +224,9 @@
${StrFilter} "${FileMainEXE}" "+" "" "" $0
StrCpy $R1 "Software\Clients\StartMenuInternet\$0\InstallInfo"
WriteRegDWORD HKLM "$R1" "IconsVisible" 1
${If} ${AtLeastWin8}
WriteRegDWORD HKCU "$R1" "IconsVisible" 1
${EndIf}
SetShellVarContext all ; Set $DESKTOP to All Users
${Unless} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
@ -209,7 +235,7 @@
ShellLink::SetShortCutWorkingDirectory "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID"
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${Else}
SetShellVarContext current ; Set $DESKTOP to the current user's desktop
@ -220,7 +246,7 @@
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID"
ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${EndIf}
${EndUnless}
@ -235,7 +261,7 @@
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID"
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${Else}
SetShellVarContext current ; Set $SMPROGRAMS to the current user's Start
@ -247,7 +273,7 @@
"$INSTDIR"
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID"
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" "$AppUserModelID" "true"
${EndIf}
${EndIf}
${EndUnless}
@ -314,6 +340,16 @@
${AddDisabledDDEHandlerValues} "FirefoxURL" "$2" "$8,1" "${AppRegName} URL" \
"true"
!ifdef MOZ_METRO
${If} ${AtLeastWin8}
${CleanupMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID}
${AddMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID} \
"$INSTDIR\CommandExecuteHandler.exe" \
$AppUserModelID \
"FirefoxURL" \
"FirefoxHTML"
${EndIf}
!endif
; An empty string is used for the 4th & 5th params because the following
; protocol handlers already have a display name and the additional keys
@ -332,10 +368,15 @@
; the key name is derived from the main application executable.
; http://support.microsoft.com/kb/297878
;
; In Windows 8 this changes slightly, you can store StartMenuInternet entries in
; HKCU. The icon in start menu for StartMenuInternet is deprecated as of Win7,
; but the subkeys are what's important. Control panel default programs looks
; for them only in HKLM pre win8.
;
; 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
!macro SetStartMenuInternet RegKey
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
${GetLongPath} "$INSTDIR\uninstall\helper.exe" $7
@ -343,55 +384,55 @@
StrCpy $0 "Software\Clients\StartMenuInternet\$R9"
WriteRegStr HKLM "$0" "" "${BrandFullName}"
WriteRegStr ${RegKey} "$0" "" "${BrandFullName}"
WriteRegStr HKLM "$0\DefaultIcon" "" "$8,0"
WriteRegStr ${RegKey} "$0\DefaultIcon" "" "$8,0"
; The Reinstall Command is defined at
; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/registeringapps.asp
WriteRegStr HKLM "$0\InstallInfo" "HideIconsCommand" "$\"$7$\" /HideShortcuts"
WriteRegStr HKLM "$0\InstallInfo" "ShowIconsCommand" "$\"$7$\" /ShowShortcuts"
WriteRegStr HKLM "$0\InstallInfo" "ReinstallCommand" "$\"$7$\" /SetAsDefaultAppGlobal"
WriteRegStr ${RegKey} "$0\InstallInfo" "HideIconsCommand" "$\"$7$\" /HideShortcuts"
WriteRegStr ${RegKey} "$0\InstallInfo" "ShowIconsCommand" "$\"$7$\" /ShowShortcuts"
WriteRegStr ${RegKey} "$0\InstallInfo" "ReinstallCommand" "$\"$7$\" /SetAsDefaultAppGlobal"
ClearErrors
ReadRegDWORD $1 HKLM "$0\InstallInfo" "IconsVisible"
ReadRegDWORD $1 ${RegKey} "$0\InstallInfo" "IconsVisible"
; If the IconsVisible name value 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
WriteRegDWORD ${RegKey} "$0\InstallInfo" "IconsVisible" 1
${Else}
WriteRegDWORD HKLM "$0\InstallInfo" "IconsVisible" 0
WriteRegDWORD ${RegKey} "$0\InstallInfo" "IconsVisible" 0
${EndIf}
${EndIf}
WriteRegStr HKLM "$0\shell\open\command" "" "$8"
WriteRegStr ${RegKey} "$0\shell\open\command" "" "$8"
WriteRegStr HKLM "$0\shell\properties" "" "$(CONTEXT_OPTIONS)"
WriteRegStr HKLM "$0\shell\properties\command" "" "$\"$8$\" -preferences"
WriteRegStr ${RegKey} "$0\shell\properties" "" "$(CONTEXT_OPTIONS)"
WriteRegStr ${RegKey} "$0\shell\properties\command" "" "$\"$8$\" -preferences"
WriteRegStr HKLM "$0\shell\safemode" "" "$(CONTEXT_SAFE_MODE)"
WriteRegStr HKLM "$0\shell\safemode\command" "" "$\"$8$\" -safe-mode"
WriteRegStr ${RegKey} "$0\shell\safemode" "" "$(CONTEXT_SAFE_MODE)"
WriteRegStr ${RegKey} "$0\shell\safemode\command" "" "$\"$8$\" -safe-mode"
; Vista Capabilities registry keys
WriteRegStr HKLM "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)"
WriteRegStr HKLM "$0\Capabilities" "ApplicationIcon" "$8,0"
WriteRegStr HKLM "$0\Capabilities" "ApplicationName" "${BrandShortName}"
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationDescription" "$(REG_APP_DESC)"
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationIcon" "$8,0"
WriteRegStr ${RegKey} "$0\Capabilities" "ApplicationName" "${BrandShortName}"
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".htm" "FirefoxHTML"
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".html" "FirefoxHTML"
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".shtml" "FirefoxHTML"
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".xht" "FirefoxHTML"
WriteRegStr HKLM "$0\Capabilities\FileAssociations" ".xhtml" "FirefoxHTML"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".htm" "FirefoxHTML"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".html" "FirefoxHTML"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".shtml" "FirefoxHTML"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xht" "FirefoxHTML"
WriteRegStr ${RegKey} "$0\Capabilities\FileAssociations" ".xhtml" "FirefoxHTML"
WriteRegStr HKLM "$0\Capabilities\StartMenu" "StartMenuInternet" "$R9"
WriteRegStr ${RegKey} "$0\Capabilities\StartMenu" "StartMenuInternet" "$R9"
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "ftp" "FirefoxURL"
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "http" "FirefoxURL"
WriteRegStr HKLM "$0\Capabilities\URLAssociations" "https" "FirefoxURL"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "ftp" "FirefoxURL"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "http" "FirefoxURL"
WriteRegStr ${RegKey} "$0\Capabilities\URLAssociations" "https" "FirefoxURL"
; Vista Registered Application
WriteRegStr HKLM "Software\RegisteredApplications" "${AppRegName}" "$0\Capabilities"
WriteRegStr ${RegKey} "Software\RegisteredApplications" "${AppRegName}" "$0\Capabilities"
!macroend
!define SetStartMenuInternet "!insertmacro SetStartMenuInternet"
@ -399,14 +440,14 @@
; due to changes not being detected by the IconHandler for side by side
; installs (see bug 268512). The symptoms can be either an incorrect icon or no
; icon being displayed for files associated with Firefox (does not use SHCTX).
!macro FixShellIconHandler
!macro FixShellIconHandler RegKey
ClearErrors
ReadRegStr $1 HKLM "Software\Classes\FirefoxHTML\ShellEx\IconHandler" ""
ReadRegStr $1 ${RegKey} "Software\Classes\FirefoxHTML\ShellEx\IconHandler" ""
${Unless} ${Errors}
ReadRegStr $1 HKLM "Software\Classes\FirefoxHTML\DefaultIcon" ""
ReadRegStr $1 ${RegKey} "Software\Classes\FirefoxHTML\DefaultIcon" ""
${GetLongPath} "$INSTDIR\${FileMainEXE}" $2
${If} "$1" != "$2,1"
WriteRegStr HKLM "Software\Classes\FirefoxHTML\DefaultIcon" "" "$2,1"
WriteRegStr ${RegKey} "Software\Classes\FirefoxHTML\DefaultIcon" "" "$2,1"
${EndIf}
${EndUnless}
!macroend
@ -846,7 +887,7 @@
ShellLink::SetShortCutWorkingDirectory "$SMPROGRAMS\$1" \
"$INSTDIR"
${If} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\$1" "$AppUserModelID"
ApplicationID::Set "$SMPROGRAMS\$1" "$AppUserModelID" "true"
${EndIf}
${EndIf}
${EndUnless}
@ -931,7 +972,7 @@
${If} ${AtLeastWin7}
${AndIf} "$AppUserModelID" != ""
ApplicationID::Set "$SMPROGRAMS\${BrandFullName}.lnk" \
"$AppUserModelID"
"$AppUserModelID" "true"
${EndIf}
${EndIf}
${EndIf}
@ -1047,7 +1088,12 @@ Function SetAsDefaultAppUserHKCU
; registry keys are for this install.
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${If} ${Errors}
${OrIf} ${AtMostWin2008R2}
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${EndIf}
${Unless} ${Errors}
${GetPathFromString} "$0" $0
${GetParent} "$0" $0
@ -1070,6 +1116,8 @@ Function SetAsDefaultAppUserHKCU
ClearErrors
ReadRegStr $0 HKLM "Software\RegisteredApplications" "${AppRegName}"
${Unless} ${Errors}
; This is all protected by a user choice hash in Windows 8 so it won't
; help, but it also won't hurt.
AppAssocReg::SetAppAsDefaultAll "${AppRegName}"
${EndUnless}
${EndIf}
@ -1098,7 +1146,13 @@ Function SetAsDefaultAppUser
; Check if this install location registered as the StartMenuInternet client
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${If} ${Errors}
${OrIf} ${AtMostWin2008R2}
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${EndIf}
${Unless} ${Errors}
${GetPathFromString} "$0" $0
${GetParent} "$0" $0
@ -1120,18 +1174,29 @@ Function SetAsDefaultAppUser
${EndIf}
${EndUnless}
; On Win8, we want to avoid having a UAC prompt since we'll already have
; another action for control panel default browser selection popping up
; to the user. Win8 is the first OS where the start menu keys can be
; added into HKCU.
${If} ${AtLeastWin8}
${SetStartMenuInternet} "HKCU"
${FixShellIconHandler} "HKCU"
${FixClassKeys} ; Does not use SHCTX
Return
${EndIf}
; The code after ElevateUAC won't be executed on Vista and above when the
; user:
; a) is a member of the administrators group (e.g. elevation is required)
; b) is not a member of the administrators group and chooses to elevate
${ElevateUAC}
${SetStartMenuInternet} ; Does not use SHCTX
${SetStartMenuInternet} "HKLM"
SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM)
${FixClassKeys} ; Does not use SHCTX
${FixShellIconHandler} ; Does not use SHCTX
${FixShellIconHandler} "HKLM"
${RemoveDeprecatedKeys} ; Does not use SHCTX
ClearErrors

Просмотреть файл

@ -76,6 +76,9 @@ VIAddVersionKey "OriginalFilename" "helper.exe"
!insertmacro RegCleanAppHandler
!insertmacro RegCleanMain
!insertmacro RegCleanUninstall
!ifdef MOZ_METRO
!insertmacro RemoveDEHRegistrationIfMatching
!endif
!insertmacro SetAppLSPCategories
!insertmacro SetBrandNameVars
!insertmacro UpdateShortcutAppModelIDs
@ -100,6 +103,9 @@ VIAddVersionKey "OriginalFilename" "helper.exe"
!insertmacro un.RegCleanMain
!insertmacro un.RegCleanUninstall
!insertmacro un.RegCleanProtocolHandler
!ifdef MOZ_METRO
!insertmacro un.RemoveDEHRegistrationIfMatching
!endif
!insertmacro un.RemoveQuotesFromPath
!insertmacro un.SetAppLSPCategories
!insertmacro un.SetBrandNameVars
@ -282,6 +288,12 @@ Section "Uninstall"
${un.SetAppLSPCategories}
${EndIf}
!ifdef MOZ_METRO
${If} ${AtLeastWin8}
${un.CleanupMetroBrowserHandlerValues} ${DELEGATE_EXECUTE_HANDLER_ID}
${EndIf}
!endif
${un.RegCleanAppHandler} "FirefoxURL"
${un.RegCleanAppHandler} "FirefoxHTML"
${un.RegCleanProtocolHandler} "ftp"
@ -325,6 +337,22 @@ Section "Uninstall"
DeleteRegValue HKLM "Software\RegisteredApplications" "${AppRegName}"
${EndIf}
ReadRegStr $R1 HKCU "$0" ""
${un.RemoveQuotesFromPath} "$R1" $R1
${un.GetParent} "$R1" $R1
; Only remove the StartMenuInternet key if it refers to this install location.
; The StartMenuInternet registry key is independent of the default browser
; settings. The XPInstall base un-installer always removes this key if it is
; uninstalling the default browser and it will always replace the keys when
; installing even if there is another install of Firefox that is set as the
; 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"
DeleteRegKey HKCU "Software\Clients\StartMenuInternet\${FileMainEXE}"
DeleteRegValue HKCU "Software\RegisteredApplications" "${AppRegName}"
${EndIf}
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
${If} $R9 == "false"
DeleteRegKey HKLM "$0"

Просмотреть файл

@ -1373,6 +1373,7 @@ BufferOffset
Assembler::as_dtr(LoadStore ls, int size, Index mode,
Register rt, DTRAddr addr, Condition c, uint32 *dest)
{
JS_ASSERT (mode == Offset || (rt != addr.getBase() && pc != addr.getBase()));
JS_ASSERT(size == 32 || size == 8);
return writeInst( 0x04000000 | ls | (size == 8 ? 0x00400000 : 0) | mode | c |
RT(rt) | addr.encode(), dest);

Просмотреть файл

@ -748,7 +748,9 @@ class DTRAddr
uint32 encode() {
return data;
}
Register getBase() {
return Register::FromCode((data >> 16) &0xf);
}
private:
friend class Operand;
DTRAddr(uint32 blob)

Просмотреть файл

@ -1031,6 +1031,11 @@ MacroAssemblerARM::ma_pop(Register r)
void
MacroAssemblerARM::ma_push(Register r)
{
// pushing sp is not well defined, use two instructions
if (r == sp) {
ma_mov(sp, ScratchRegister);
r = ScratchRegister;
}
ma_dtr(IsStore, sp,Imm32(-4), r, PreIndex);
}

Просмотреть файл

@ -1899,8 +1899,10 @@ DocumentViewerImpl::SetBounds(const nsIntRect& aBounds)
// relating to things being hidden while something is loaded. It so
// happens that Firefox does this a good bit with its infobar, and it
// looks ugly if we don't do this.
if (mPreviousViewer)
mPreviousViewer->SetBounds(aBounds);
if (mPreviousViewer) {
nsCOMPtr<nsIContentViewer> previousViewer = mPreviousViewer;
previousViewer->SetBounds(aBounds);
}
return NS_OK;
}

Просмотреть файл

@ -133,6 +133,7 @@ GetInstallationDir(int argcTmp, LPWSTR *argvTmp, WCHAR aResultDir[MAX_PATH])
BOOL
StartUpdateProcess(int argc,
LPWSTR *argv,
LPCWSTR installDir,
BOOL &processStarted)
{
LOG(("Starting update process as the service in session 0.\n"));
@ -248,7 +249,6 @@ StartUpdateProcess(int argc,
// Only run the PostUpdate if the update was successful
if (updateWasSuccessful && argc > 2) {
LPCWSTR installationDir = argv[2];
LPCWSTR updateInfoDir = argv[1];
bool backgroundUpdate = IsUpdateBeingStaged(argc, argv);
@ -264,8 +264,10 @@ StartUpdateProcess(int argc,
// performing the replacing in that case.
if (!backgroundUpdate) {
LOG(("Launching post update process as the service in session 0.\n"));
if (!LaunchWinPostProcess(installationDir, updateInfoDir, true, NULL)) {
LOG(("The post update process could not be launched.\n"));
if (!LaunchWinPostProcess(installDir, updateInfoDir, true, NULL)) {
LOG(("The post update process could not be launched."
" installDir: %ls, updateInfoDir: %ls\n",
installDir, updateInfoDir));
}
}
}
@ -419,7 +421,7 @@ ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR *argv)
// Only proceed with the update if we have no signing problems
if (!updaterSignProblem) {
BOOL updateProcessWasStarted = FALSE;
if (StartUpdateProcess(argc, argv,
if (StartUpdateProcess(argc, argv, installDir,
updateProcessWasStarted)) {
LOG(("updater.exe was launched and run successfully!\n"));
LogFlush();

Просмотреть файл

@ -79,20 +79,6 @@
!include /NONFATAL WinVer.nsh
!endif
; Add Windows 7 / 2008 support for versions of WinVer.nsh that don't support
; them. This can be removed after bug 571381 is fixed.
!ifndef WINVER_7
!define WINVER_7 0x601
!macro __MOZ__WinVer_DefineOSTests Test
!insertmacro __WinVer_DefineOSTest ${Test} 7
!macroend
!insertmacro __MOZ__WinVer_DefineOSTests AtLeast
!insertmacro __MOZ__WinVer_DefineOSTests Is
!insertmacro __MOZ__WinVer_DefineOSTests AtMost
!endif
!include x64.nsh
; NSIS provided macros that we have overridden.
@ -5743,8 +5729,12 @@
${LogMsg} "OS Name : Windows 2003"
${ElseIf} ${IsWinVista}
${LogMsg} "OS Name : Windows Vista"
${ElseIf} ${AtLeastWinVista} ; Workaround for NSIS 2.33 WinVer.nsh not knowing Win7
${LogMsg} "OS Name : Windows 7 or above"
${ElseIf} ${IsWin7}
${LogMsg} "OS Name : Windows 7"
${ElseIf} ${IsWin8}
${LogMsg} "OS Name : Windows 8"
${ElseIf} ${AtLeastWin8}
${LogMsg} "OS Name : Above Windows 8"
${Else}
${LogMsg} "OS Name : Unable to detect"
${EndIf}
@ -6968,3 +6958,107 @@
!verbose pop
!endif
!macroend
!ifdef MOZ_METRO
; Removes the CEH registration if it's set to our installation directory.
; If it's set to some other installation directory, then it should be removed
; by that installation.
!macro RemoveDEHRegistrationIfMatchingCall un
Function ${un}RemoveDEHRegistrationIfMatchingCall
; Move the old $R0 on the stack and set it to DEH ID
Exch $R0
; Backup the old values of R8 and R7 on the stack
Push $R8
Push $R7
ReadRegStr $R8 HKCU "Software\Classes\CLSID\$R0\LocalServer32" ""
${${un}GetLongPath} "$INSTDIR" $R7
StrCmp "$R8" "" next +1
IfFileExists "$R8" +1 clearHKCU
${${un}GetParent} "$R8" $R8
${${un}GetLongPath} "$R8" $R8
StrCmp "$R7" "$R8" clearHKCU next
clearHKCU:
DeleteRegKey HKCU "Software\Classes\CLSID\$R0"
DeleteRegValue HKCU \
"Software\Classes\$AppUserModelID\.exe\shell\open\command" \
"DelegateExecute"
next:
ReadRegStr $R8 HKLM "Software\Classes\CLSID\$R0\LocalServer32" ""
${${un}GetLongPath} "$INSTDIR" $R7
StrCmp "$R8" "" done +1
IfFileExists "$R8" +1 clearHKLM
${${un}GetParent} "$R8" $R8
${${un}GetLongPath} "$R8" $R8
StrCmp "$R7" "$R8" clearHKLM done
clearHKLM:
DeleteRegKey HKLM "Software\Classes\CLSID\$R0"
DeleteRegValue HKLM \
"Software\Classes\$AppUserModelID\.exe\shell\open\command" \
"DelegateExecute"
done:
; Restore the stack back to its original state
Pop $R7
Pop $R8
Pop $R0
FunctionEnd
!macroend
!macro RemoveDEHRegistrationIfMatching
!insertmacro RemoveDEHRegistrationIfMatchingCall ""
!macroend
!macro un.RemoveDEHRegistrationIfMatching
!insertmacro RemoveDEHRegistrationIfMatchingCall "un."
!macroend
!macro CleanupMetroBrowserHandlerValues un DELEGATE_EXECUTE_HANDLER_ID
Push ${DELEGATE_EXECUTE_HANDLER_ID}
Call ${un}RemoveDEHRegistrationIfMatchingCall
!macroend
!define CleanupMetroBrowserHandlerValues '!insertmacro CleanupMetroBrowserHandlerValues ""'
!define un.CleanupMetroBrowserHandlerValues '!insertmacro CleanupMetroBrowserHandlerValues "un."'
!macro AddMetroBrowserHandlerValues DELEGATE_EXECUTE_HANDLER_ID \
DELEGATE_EXECUTE_HANDLER_PATH \
APP_USER_MODEL_ID \
PROTOCOL_ACTIVATION_ID \
FILE_ACTIVATION_ID
; Win8 doesn't use conventional progid command data to launch anymore.
; Instead it uses a delegate execute handler which is a light weight COM
; server for choosing the metro or desktop browser to launch depending
; on the current environment (metro/desktop) it was activated in.
WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}" "" ""
WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe" "" ""
WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell" "" "open"
WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open" "CommandId" "open"
WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open\command" "" "$2"
WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open\command" "DelegateExecute" "${DELEGATE_EXECUTE_HANDLER_ID}"
; Augment the url handler registrations with additional data needed for Metro
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}" "AppUserModelID" "${APP_USER_MODEL_ID}"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "AppUserModelID" "${APP_USER_MODEL_ID}"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationName" "$BrandShortName"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationIcon" "$INSTDIR\${FileMainEXE},0"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationCompany" "${CompanyName}"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationDescription" "$(REG_APP_DESC)"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell" "" "open"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open" "CommandId" "open"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute" "${DELEGATE_EXECUTE_HANDLER_ID}"
; Augment the file handler registrations with additional data needed for Metro
WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}" "AppUserModelID" "${APP_USER_MODEL_ID}"
WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}\shell" "" "open"
WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}\shell\open" "CommandId" "open"
WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute" "${DELEGATE_EXECUTE_HANDLER_ID}"
; Win8 Metro delegate execute handler registration
WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" "" "$BrandShortName CommandExecuteHandler"
WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" "AppId" "${DELEGATE_EXECUTE_HANDLER_ID}"
WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}\LocalServer32" "" "${DELEGATE_EXECUTE_HANDLER_PATH}"
!macroend
!define AddMetroBrowserHandlerValues "!insertmacro AddMetroBrowserHandlerValues"
!endif ;end MOZ_METRO

Просмотреть файл

@ -18,301 +18,27 @@
!include FileFunc.nsh
!endif
!ifndef CallArtificialFunction
; The CallArtificialFunction and CallArtificialFunction2 macros are from
; Util.nsh in NSIS v2.46-Unicode and have not been modified. They are needed
; by TextCompareNoDetail when compiling an installer / uninstaller with NSIS
; v2.33-Unicode.
; See <NSIS v2.46-Unicode App Dir >/include/Util.nsh for more information.
# see WinVer.nsh and *Func.nsh for usage examples
!macro CallArtificialFunction NAME
!ifndef __UNINSTALL__
!define CallArtificialFunction_TYPE inst
!else
!define CallArtificialFunction_TYPE uninst
!endif
Call :.${NAME}${CallArtificialFunction_TYPE}
!ifndef ${NAME}${CallArtificialFunction_TYPE}_DEFINED
Goto ${NAME}${CallArtificialFunction_TYPE}_DONE
!define ${NAME}${CallArtificialFunction_TYPE}_DEFINED
.${NAME}${CallArtificialFunction_TYPE}:
!insertmacro ${NAME}
Return
${NAME}${CallArtificialFunction_TYPE}_DONE:
!endif
!undef CallArtificialFunction_TYPE
!macro __MOZ__WinVer_DefineOSTests WinVer
!insertmacro __WinVer_DefineOSTest AtLeast ${WinVer} ""
!insertmacro __WinVer_DefineOSTest AtMost ${WinVer} ""
!insertmacro __WinVer_DefineOSTest Is ${WinVer} ""
!macroend
!define CallArtificialFunction `!insertmacro CallArtificialFunction`
# for usage of artificial functions inside artificial functions
# macro recursion is prohibited
!macro CallArtificialFunction2 NAME
!ifndef __UNINSTALL__
!define CallArtificialFunction2_TYPE inst
!else
!define CallArtificialFunction2_TYPE uninst
!endif
Call :.${NAME}${CallArtificialFunction2_TYPE}
!ifndef ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
Goto ${NAME}${CallArtificialFunction2_TYPE}_DONE
!define ${NAME}${CallArtificialFunction2_TYPE}_DEFINED
.${NAME}${CallArtificialFunction2_TYPE}:
!insertmacro ${NAME}
Return
${NAME}${CallArtificialFunction2_TYPE}_DONE:
!endif
!undef CallArtificialFunction2_TYPE
!macroend
!define CallArtificialFunction2 `!insertmacro CallArtificialFunction2`
!ifndef WINVER_7
!define WINVER_7 0x06010000 ;6.01.????
!insertmacro __MOZ__WinVer_DefineOSTests 7
!endif
!ifndef _WINVER_VERXBIT
; The following defines and macros are for service pack detection support and
; are from WinVer.nsh in NSIS 2.46. They can be removed after building with
; NSIS 2.33 is deprecated.
!define _WINVER_VERXBIT 0x00000001
!define _WINVER_NTBIT 0x80000000
!define _WINVER_NTSRVBIT 0x40000000
!define _WINVER_MASKSP 0x000F0000
!ifndef WINVER_2008R2
!define WINVER_2008R2 0x601
!define WINVER_2008R2 0x06010001 ;6.01.????
!insertmacro __MOZ__WinVer_DefineOSTests 2008R2
!endif
!define OSVERSIONINFOW_SIZE 276
!define OSVERSIONINFOEXW_SIZE 284
!define VER_PLATFORM_WIN32_NT 2
!define VER_NT_WORKSTATION 1
!macro __WinVer_DeclareVars
!ifndef __WINVER_VARS_DECLARED
!define __WINVER_VARS_DECLARED
Var /GLOBAL __WINVERV
Var /GLOBAL __WINVERSP
!endif
!macroend
# lazy initialization macro
!ifmacrondef __WinVer_Call_GetVersionEx
!macro __WinVer_Call_GetVersionEx STRUCT_SIZE
System::Call '*$0(i ${STRUCT_SIZE})'
System::Call kernel32::GetVersionEx(ir0)i.r3
!macroend
!ifndef WINVER_8
!define WINVER_8 0x06020000 ;6.02.????
!insertmacro __MOZ__WinVer_DefineOSTests 8
!endif
!macro __WinVer_InitVars
# variables
!insertmacro __WinVer_DeclareVars
# only calculate version once
StrCmp $__WINVERV "" _winver_noveryet
Return
_winver_noveryet:
# push used registers on the stack
Push $0
Push $1 ;maj
Push $2 ;min
Push $3 ;bld
Push $R0 ;temp
# allocate memory
System::Alloc ${OSVERSIONINFOEXW_SIZE}
Pop $0
# use OSVERSIONINFOEX
!insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOEXW_SIZE}
IntCmp $3 0 "" _winver_ex _winver_ex
# OSVERSIONINFOEX not allowed (Win9x or NT4 w/SP < 6), use OSVERSIONINFO
!insertmacro __WinVer_Call_GetVersionEx ${OSVERSIONINFOW_SIZE}
_winver_ex:
# The original struct formatting string here was:
# '*$0(i.s,i.r1,i.r2,i.r3,i.s,&t128.s,&i2.s,&i2,&i2,&i1.s,&i1)'
# but in NSIS v2.33u strings take the size in bytes instead of size in chars
# so the 128 char '&t128.s' is changed here to '&t256.s'.
System::Call '*$0(i.s,i.r1,i.r2,i.r3,i.s,&t256.s,&i2.s,&i2,&i2,&i1.s,&i1)'
# free struct
System::Free $0
# win9x has major and minor info in high word of dwBuildNumber - remove it
IntOp $3 $3 & 0xFFFF
# get dwOSVersionInfoSize
Pop $R0
# get dwPlatformId
Pop $0
# NT?
IntCmp $0 ${VER_PLATFORM_WIN32_NT} "" _winver_notnt _winver_notnt
IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTBIT}
IntOp $__WINVERV $__WINVERV | ${_WINVER_NTBIT}
_winver_notnt:
# get service pack information
IntCmp $0 ${VER_PLATFORM_WIN32_NT} _winver_nt "" _winver_nt # win9x
# get szCSDVersion
Pop $0
# copy second char
StrCpy $0 $0 1 1
# discard invalid wServicePackMajor and wProductType
Pop $R0
Pop $R0
# switch
StrCmp $0 'A' "" +3
StrCpy $0 1
Goto _winver_sp_done
StrCmp $0 'B' "" +3
StrCpy $0 2
Goto _winver_sp_done
StrCmp $0 'C' "" +3
StrCpy $0 3
Goto _winver_sp_done
StrCpy $0 0
Goto _winver_sp_done
_winver_nt: # nt
IntCmp $R0 ${OSVERSIONINFOEXW_SIZE} "" _winver_sp_noex _winver_sp_noex
# discard szCSDVersion
Pop $0
# get wProductType
Exch
Pop $0
# is server?
IntCmp $0 ${VER_NT_WORKSTATION} _winver_noserver _winver_noserver ""
IntOp $__WINVERSP $__WINVERSP | ${_WINVER_NTSRVBIT}
_winver_noserver:
# get wServicePackMajor
Pop $0
# done with sp
Goto _winver_sp_done
_winver_sp_noex: # OSVERSIONINFO, not OSVERSIONINFOEX
#### TODO
## For IsServer to support < NT4SP6, we need to check the registry
## here to see if we are a server and/or DC
# get szCSDVersion
Pop $0
# discard invalid wServicePackMajor and wProductType
Pop $R0
Pop $R0
# get service pack number from text
StrCpy $R0 $0 13
StrCmp $R0 "Service Pack " "" +3
StrCpy $0 $0 "" 13 # cut "Service Pack "
Goto +2
StrCpy $0 0 # no service pack
!ifdef WINVER_NT4_OVER_W95
IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT}
!endif
_winver_sp_done:
# store service pack
IntOp $0 $0 << 16
IntOp $__WINVERSP $__WINVERSP | $0
### now for the version
# is server?
IntOp $0 $__WINVERSP & ${_WINVER_NTSRVBIT}
# windows xp x64?
IntCmp $0 0 "" _winver_not_xp_x64 _winver_not_xp_x64 # not server
IntCmp $1 5 "" _winver_not_xp_x64 _winver_not_xp_x64 # maj 5
IntCmp $2 2 "" _winver_not_xp_x64 _winver_not_xp_x64 # min 2
# change XP x64 from 5.2 to 5.1 so it's still XP
StrCpy $2 1
_winver_not_xp_x64:
# server 2008?
IntCmp $0 0 _winver_not_ntserver # server
IntCmp 6 $1 "" "" _winver_not_ntserver # maj 6
# extra bit so Server 2008 comes after Vista SP1 that has the same minor version, same for Win7 vs 2008R2
IntOp $__WINVERV $__WINVERV | ${_WINVER_VERXBIT}
_winver_not_ntserver:
# pack version
IntOp $1 $1 << 24 # VerMajor
IntOp $__WINVERV $__WINVERV | $1
IntOp $0 $2 << 16
IntOp $__WINVERV $__WINVERV | $0 # VerMinor
IntOp $__WINVERSP $__WINVERSP | $3 # VerBuild
# restore registers
Pop $R0
Pop $3
Pop $2
Pop $1
Pop $0
!macroend
!macro _WinVer_GetServicePackLevel OUTVAR
${CallArtificialFunction} __WinVer_InitVars
IntOp ${OUTVAR} $__WINVERSP & ${_WINVER_MASKSP}
IntOp ${OUTVAR} ${OUTVAR} >> 16
!macroend
!define WinVerGetServicePackLevel '!insertmacro _WinVer_GetServicePackLevel '
!macro _AtLeastServicePack _a _b _t _f
!insertmacro _LOGICLIB_TEMP
${WinVerGetServicePackLevel} $_LOGICLIB_TEMP
!insertmacro _>= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
!macroend
!define AtLeastServicePack `"" AtLeastServicePack`
!macro _AtMostServicePack _a _b _t _f
!insertmacro _LOGICLIB_TEMP
${WinVerGetServicePackLevel} $_LOGICLIB_TEMP
!insertmacro _<= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
!macroend
!define AtMostServicePack `"" AtMostServicePack`
!macro _IsServicePack _a _b _t _f
!insertmacro _LOGICLIB_TEMP
${WinVerGetServicePackLevel} $_LOGICLIB_TEMP
!insertmacro _= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}`
!macroend
!define IsServicePack `"" IsServicePack`
!ifndef AtMostWin2008R2
!insertmacro __WinVer_DefineOSTest AtMost 2008R2
!endif
!endif # _WINVER_VERXBIT
!verbose push
!verbose 3
!ifndef _OVERRIDE_VERBOSE

Просмотреть файл

@ -328,6 +328,10 @@ WinTaskbar::RegisterAppUserModelID() {
if (WinUtils::GetWindowsVersion() < WinUtils::WIN7_VERSION)
return false;
if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
return false;
}
SetCurrentProcessExplicitAppUserModelIDPtr funcAppUserModelID = nullptr;
bool retVal = false;