Bug 1129209 - Use a separate manifest for comctl32.dll. r=bbondy

This commit is contained in:
Robert Strong 2015-02-05 14:12:39 -08:00
Родитель 761968a7ea
Коммит 7a9277815f
7 изменённых файлов: 90 добавлений и 15 удалений

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

@ -2402,7 +2402,10 @@ function createUpdaterINI(aIsExeAsync) {
}
}
let updaterIniContents = "[PostUpdateMac]\n" +
let updaterIniContents = "[Strings]\n" +
"Title=Update Test\n" +
"Info=Running update test " + gTestID + "\n\n" +
"[PostUpdateMac]\n" +
"ExeRelPath=" + DIR_RESOURCES + gPostUpdateBinFile + "\n" +
exeArg +
exeAsync +

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

@ -74,7 +74,7 @@ struct AutoLoadSystemDependencies
WCHAR systemDirectory[MAX_PATH + 1] = { L'\0' };
// If GetSystemDirectory fails we accept that we'll load the DLLs from the
// normal search path.
GetSystemDirectory(systemDirectory, MAX_PATH + 1);
GetSystemDirectoryW(systemDirectory, MAX_PATH + 1);
size_t systemDirLen = wcslen(systemDirectory);
// Make the system directory path terminate with a slash

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

@ -200,7 +200,7 @@ DialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
}
int
InitProgressUI(int *argc, NS_tchar ***argv)
InitProgressUI(int *argc, WCHAR ***argv)
{
return 0;
}
@ -245,10 +245,49 @@ ShowProgressUI(bool indeterminate, bool initUIStrings)
return 0;
}
// Don't load the UI if there's an <exe_name>.Local directory for redirection.
WCHAR appPath[MAX_PATH + 1] = { L'\0' };
if (!GetModuleFileNameW(nullptr, appPath, MAX_PATH)) {
return -1;
}
if (wcslen(appPath) + wcslen(L".Local") >= MAX_PATH) {
return -1;
}
wcscat(appPath, L".Local");
if (!_waccess(appPath, 04)) {
return -1;
}
// Don't load the UI if the strings for the UI are not provided.
if (initUIStrings && InitProgressUIStrings() == -1) {
return -1;
}
if (!GetModuleFileNameW(nullptr, appPath, MAX_PATH)) {
return -1;
}
// Use an activation context that supports visual styles for the controls.
ACTCTXW actx = {0};
actx.cbSize = sizeof(ACTCTXW);
actx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID;
actx.hModule = GetModuleHandle(NULL); // Use the embedded manifest
// This is needed only for Win XP but doesn't cause a problem with other
// versions of Windows.
actx.lpSource = appPath;
actx.lpResourceName = MAKEINTRESOURCE(IDR_COMCTL32_MANIFEST);
HANDLE hactx = INVALID_HANDLE_VALUE;
hactx = CreateActCtxW(&actx);
ULONG_PTR actxCookie = NULL;
if (hactx != INVALID_HANDLE_VALUE) {
// Push the specified activation context to the top of the activation stack.
ActivateActCtx(hactx, &actxCookie);
}
INITCOMMONCONTROLSEX icc = {
sizeof(INITCOMMONCONTROLSEX),
ICC_PROGRESS_CLASS
@ -259,6 +298,11 @@ ShowProgressUI(bool indeterminate, bool initUIStrings)
MAKEINTRESOURCE(IDD_DIALOG), nullptr,
(DLGPROC) DialogProc);
if (hactx != INVALID_HANDLE_VALUE) {
// Deactivate the context now that the comctl32.dll is loaded.
DeactivateActCtx(0, actxCookie);
}
return 0;
}

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

@ -15,6 +15,7 @@
#define IDR_BACKUP_CERT 1005
#define IDS_UPDATER_IDENTITY 1006
#define IDR_XPCSHELL_CERT 1007
#define IDR_COMCTL32_MANIFEST 17
// Next default values for new objects
//

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

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="Updater"
type="win32"
/>
<description>Updater</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
<ms_asmv3:security>
<ms_asmv3:requestedPrivileges>
<ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false" />
</ms_asmv3:requestedPrivileges>
</ms_asmv3:security>
</ms_asmv3:trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
</assembly>

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

@ -7,18 +7,6 @@
type="win32"
/>
<description>Updater</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
<ms_asmv3:security>
<ms_asmv3:requestedPrivileges>

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

@ -31,6 +31,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
1 RT_MANIFEST "updater.exe.manifest"
IDR_COMCTL32_MANIFEST RT_MANIFEST "updater.exe.comctl32.manifest"
/////////////////////////////////////////////////////////////////////////////
//