v2.4 hopefully
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include <comdef.h>
|
||||
#include "Utils.h"
|
||||
|
||||
#ifndef PROCESS_PER_MONITOR_DPI_AWARE
|
||||
typedef int PROCESS_DPI_AWARENESS;
|
||||
#define PROCESS_PER_MONITOR_DPI_AWARE 2
|
||||
#endif
|
||||
|
||||
#ifndef DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
|
||||
typedef int DPI_AWARENESS_CONTEXT;
|
||||
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
|
||||
#endif
|
||||
|
||||
typedef BOOL (WINAPI *_GetProductInfo)(DWORD, DWORD, DWORD, DWORD, PDWORD);
|
||||
|
||||
typedef BOOL (WINAPI *_SetProcessDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
|
||||
typedef HRESULT (WINAPI *_SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS);
|
||||
typedef void (WINAPI *_SetProcessDPIAware)();
|
||||
|
||||
_GetProductInfo $GetProductInfo = (_GetProductInfo)GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetProductInfo");
|
||||
|
||||
BOOL GetVistaProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpMajorVersion, DWORD dwSpMinorVersion, PDWORD pdwReturnedProductType) {
|
||||
if ($GetProductInfo) {
|
||||
return $GetProductInfo(dwOSMajorVersion, dwOSMinorVersion, dwSpMajorVersion, dwSpMinorVersion, pdwReturnedProductType);
|
||||
} else {
|
||||
*pdwReturnedProductType = PRODUCT_UNDEFINED;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void BecomeDPIAware() {
|
||||
// Make the process DPI-aware... hopefully
|
||||
// Windows 10 1703+ per-monitor v2
|
||||
_SetProcessDpiAwarenessContext $SetProcessDpiAwarenessContext = (_SetProcessDpiAwarenessContext)GetProcAddress(LoadLibrary(L"user32.dll"), "SetProcessDpiAwarenessContext");
|
||||
if ($SetProcessDpiAwarenessContext) {
|
||||
$SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||
return;
|
||||
}
|
||||
|
||||
// Windows 8.1 - 10 1607 per-monitor v1
|
||||
_SetProcessDpiAwareness $SetProcessDpiAwareness = (_SetProcessDpiAwareness)GetProcAddress(LoadLibrary(L"shcore.dll"), "SetProcessDpiAwareness");
|
||||
if ($SetProcessDpiAwareness) {
|
||||
$SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
|
||||
return;
|
||||
}
|
||||
|
||||
// Windows Vista - 8
|
||||
_SetProcessDPIAware $SetProcessDPIAware = (_SetProcessDPIAware)GetProcAddress(LoadLibrary(L"user32.dll"), "SetProcessDPIAware");
|
||||
if ($SetProcessDPIAware) {
|
||||
$SetProcessDPIAware();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
BOOL GetVistaProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpMajorVersion, DWORD dwSpMinorVersion, PDWORD pdwReturnedProductType);
|
||||
void BecomeDPIAware();
|
||||
@@ -1,84 +0,0 @@
|
||||
// ElevationHelper.cpp : Implementation of CElevationHelper
|
||||
#include "stdafx.h"
|
||||
#include "Compat.h"
|
||||
#include "ElevationHelper.h"
|
||||
#include "HResult.h"
|
||||
#include "Utils.h"
|
||||
#include <strsafe.h>
|
||||
|
||||
const BSTR permittedProgIDs[] = {
|
||||
L"Microsoft.Update.",
|
||||
NULL
|
||||
};
|
||||
|
||||
BOOL ProgIDIsPermitted(PWSTR progID) {
|
||||
if (progID == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (int i = 0; permittedProgIDs[i] != NULL; i++) {
|
||||
if (wcsncmp(progID, permittedProgIDs[i], wcslen(permittedProgIDs[i])) == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CoCreateInstanceAsAdmin(HWND hwnd, __in REFCLSID rclsid, __in REFIID riid, __deref_out void **ppv) {
|
||||
WCHAR clsidString[45];
|
||||
StringFromGUID2(rclsid, clsidString, ARRAYSIZE(clsidString));
|
||||
|
||||
WCHAR monikerName[75];
|
||||
HRESULT hr = StringCchPrintf(monikerName, ARRAYSIZE(monikerName), L"Elevation:Administrator!new:%s", clsidString);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
BIND_OPTS3 bindOpts;
|
||||
memset(&bindOpts, 0, sizeof(bindOpts));
|
||||
bindOpts.cbStruct = sizeof(bindOpts);
|
||||
bindOpts.hwnd = hwnd;
|
||||
bindOpts.dwClassContext = CLSCTX_LOCAL_SERVER;
|
||||
return CoGetObject(monikerName, &bindOpts, riid, ppv);
|
||||
}
|
||||
|
||||
CElevationHelper::CElevationHelper() {
|
||||
BecomeDPIAware();
|
||||
}
|
||||
|
||||
STDMETHODIMP CElevationHelper::CreateObject(BSTR progID, IDispatch **retval) {
|
||||
if (progID == NULL) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
CComPtr<IDispatch> object;
|
||||
if (!ProgIDIsPermitted(progID)) {
|
||||
hr = E_ACCESSDENIED;
|
||||
goto end;
|
||||
}
|
||||
|
||||
CLSID clsid;
|
||||
hr = CLSIDFromProgID(progID, &clsid);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
hr = object.CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
*retval = object.Detach();
|
||||
|
||||
end:
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE("CreateObject(%ls) failed: %ls\n", progID, GetMessageForHresult(hr));
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP CElevationHelper::Reboot(void) {
|
||||
return ::Reboot();
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// ElevationHelper.h : Declaration of the CElevationHelper class.
|
||||
|
||||
#include <atlctl.h>
|
||||
#include "resource.h"
|
||||
#include "LegacyUpdate_i.h"
|
||||
|
||||
BOOL ProgIDIsPermitted(PWSTR progID);
|
||||
STDMETHODIMP CoCreateInstanceAsAdmin(HWND hwnd, __in REFCLSID rclsid, __in REFIID riid, __deref_out void **ppv);
|
||||
|
||||
// CElevationHelper
|
||||
class ATL_NO_VTABLE CElevationHelper :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public CComCoClass<CElevationHelper, &CLSID_ElevationHelper>,
|
||||
public ISupportErrorInfo,
|
||||
public IDispatchImpl<IElevationHelper, &IID_IElevationHelper, &LIBID_LegacyUpdateLib, /*wMajor =*/ 1, /*wMinor =*/ 0> {
|
||||
|
||||
public:
|
||||
CElevationHelper();
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_ELEVATIONHELPER)
|
||||
|
||||
BEGIN_COM_MAP(CElevationHelper)
|
||||
COM_INTERFACE_ENTRY(IElevationHelper)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
||||
END_COM_MAP()
|
||||
|
||||
// ISupportsErrorInfo
|
||||
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) {
|
||||
return IsEqualGUID(riid, IID_IElevationHelper) ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
// IElevationHelper
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
HRESULT FinalConstruct() { return S_OK; }
|
||||
void FinalRelease() {}
|
||||
|
||||
STDMETHODIMP CreateObject(BSTR progID, IDispatch **retval);
|
||||
STDMETHODIMP Reboot(void);
|
||||
};
|
||||
|
||||
OBJECT_ENTRY_AUTO(__uuidof(ElevationHelper), CElevationHelper)
|
||||
@@ -1,31 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
LegacyUpdate.ElevationHelper.1 = s 'Legacy Update Elevation Helper'
|
||||
{
|
||||
CLSID = s '{84F517AD-6438-478F-BEA8-F0B808DC257F}'
|
||||
}
|
||||
LegacyUpdate.ElevationHelper = s 'Legacy Update Elevation Helper'
|
||||
{
|
||||
CurVer = s 'LegacyUpdate.ElevationHelper.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {84F517AD-6438-478F-BEA8-F0B808DC257F} = s 'Legacy Update Elevation Helper'
|
||||
{
|
||||
ProgID = s 'LegacyUpdate.ElevationHelper.1'
|
||||
VersionIndependentProgID = s 'LegacyUpdate.ElevationHelper'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
val AppID = s '%APPID%'
|
||||
val LocalizedString = s '@%MODULE%,-1'
|
||||
TypeLib = s '{05D22F33-C7C3-4C90-BDD9-CEDC86EA8FBE}'
|
||||
Version = s '1.0'
|
||||
Elevation
|
||||
{
|
||||
val Enabled = d '1'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,650 +0,0 @@
|
||||
#pragma once
|
||||
#include <wuapi.h>
|
||||
|
||||
// Copied from wuapi.h in Windows SDK 10.0.19041.0
|
||||
|
||||
#ifndef __IUpdateInstaller3_FWD_DEFINED__
|
||||
#define __IUpdateInstaller3_FWD_DEFINED__
|
||||
typedef interface IUpdateInstaller3 IUpdateInstaller3;
|
||||
|
||||
#endif /* __IUpdateInstaller3_FWD_DEFINED__ */
|
||||
|
||||
#ifndef __IUpdateInstaller4_FWD_DEFINED__
|
||||
#define __IUpdateInstaller4_FWD_DEFINED__
|
||||
typedef interface IUpdateInstaller4 IUpdateInstaller4;
|
||||
|
||||
#endif /* __IUpdateInstaller4_FWD_DEFINED__ */
|
||||
|
||||
// {16d11c35-099a-48d0-8338-5fae64047f8e}
|
||||
DEFINE_GUID(IID_IUpdateInstaller3,0x16d11c35,0x099a,0x48d0,0x83,0x38,0x5f,0xae,0x64,0x04,0x7f,0x8e);
|
||||
|
||||
// {EF8208EA-2304-492D-9109-23813B0958E1}
|
||||
DEFINE_GUID(IID_IUpdateInstaller4, 0xef8208ea, 0x2304, 0x492d, 0x91, 0x9, 0x23, 0x81, 0x3b, 0x9, 0x58, 0xe1);
|
||||
|
||||
#ifndef __IUpdateInstaller3_INTERFACE_DEFINED__
|
||||
#define __IUpdateInstaller3_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IUpdateInstaller3 */
|
||||
/* [hidden][unique][uuid][nonextensible][dual][oleautomation][object][helpstring] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IUpdateInstaller3;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("16d11c35-099a-48d0-8338-5fae64047f8e")
|
||||
IUpdateInstaller3 : public IUpdateInstaller2
|
||||
{
|
||||
public:
|
||||
virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_AttemptCloseAppsIfNecessary(
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval) = 0;
|
||||
|
||||
virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_AttemptCloseAppsIfNecessary(
|
||||
/* [in] */ VARIANT_BOOL value) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IUpdateInstaller3Vtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
__RPC__in IUpdateInstaller3 * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
__RPC__in IUpdateInstaller3 * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [out] */ __RPC__out UINT *pctinfo);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ UINT iTInfo,
|
||||
/* [in] */ LCID lcid,
|
||||
/* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames,
|
||||
/* [range][in] */ __RPC__in_range(0,16384) UINT cNames,
|
||||
/* [in] */ LCID lcid,
|
||||
/* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId);
|
||||
|
||||
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
|
||||
IUpdateInstaller3 * This,
|
||||
/* [annotation][in] */
|
||||
_In_ DISPID dispIdMember,
|
||||
/* [annotation][in] */
|
||||
_In_ REFIID riid,
|
||||
/* [annotation][in] */
|
||||
_In_ LCID lcid,
|
||||
/* [annotation][in] */
|
||||
_In_ WORD wFlags,
|
||||
/* [annotation][out][in] */
|
||||
_In_ DISPPARAMS *pDispParams,
|
||||
/* [annotation][out] */
|
||||
_Out_opt_ VARIANT *pVarResult,
|
||||
/* [annotation][out] */
|
||||
_Out_opt_ EXCEPINFO *pExcepInfo,
|
||||
/* [annotation][out] */
|
||||
_Out_opt_ UINT *puArgErr);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ClientApplicationID )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt BSTR *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClientApplicationID )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in BSTR value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsForced )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IsForced )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
/* [helpstring][restricted][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentHwnd )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt HWND *retval);
|
||||
|
||||
/* [helpstring][restricted][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentHwnd )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [unique][in] */ __RPC__in_opt HWND value);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentWindow )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [unique][in] */ __RPC__in_opt IUnknown *value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentWindow )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IUnknown **retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Updates )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IUpdateCollection **retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Updates )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in_opt IUpdateCollection *value);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginInstall )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onCompleted,
|
||||
/* [in] */ VARIANT state,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginUninstall )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onCompleted,
|
||||
/* [in] */ VARIANT state,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndInstall )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in_opt IInstallationJob *value,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndUninstall )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ __RPC__in_opt IInstallationJob *value,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Install )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RunWizard )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [defaultvalue][unique][in] */ __RPC__in_opt BSTR dialogTitle,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsBusy )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Uninstall )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AllowSourcePrompts )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AllowSourcePrompts )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RebootRequiredBeforeInstallation )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ForceQuiet )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ForceQuiet )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AttemptCloseAppsIfNecessary )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AttemptCloseAppsIfNecessary )(
|
||||
__RPC__in IUpdateInstaller3 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
END_INTERFACE
|
||||
} IUpdateInstaller3Vtbl;
|
||||
|
||||
interface IUpdateInstaller3
|
||||
{
|
||||
CONST_VTBL struct IUpdateInstaller3Vtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IUpdateInstaller3_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IUpdateInstaller3_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IUpdateInstaller3_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IUpdateInstaller3_GetTypeInfoCount(This,pctinfo) \
|
||||
( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
|
||||
|
||||
#define IUpdateInstaller3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
|
||||
( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
|
||||
|
||||
#define IUpdateInstaller3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
|
||||
( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
|
||||
|
||||
#define IUpdateInstaller3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
|
||||
( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
|
||||
|
||||
|
||||
#define IUpdateInstaller3_get_ClientApplicationID(This,retval) \
|
||||
( (This)->lpVtbl -> get_ClientApplicationID(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_put_ClientApplicationID(This,value) \
|
||||
( (This)->lpVtbl -> put_ClientApplicationID(This,value) )
|
||||
|
||||
#define IUpdateInstaller3_get_IsForced(This,retval) \
|
||||
( (This)->lpVtbl -> get_IsForced(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_put_IsForced(This,value) \
|
||||
( (This)->lpVtbl -> put_IsForced(This,value) )
|
||||
|
||||
#define IUpdateInstaller3_get_ParentHwnd(This,retval) \
|
||||
( (This)->lpVtbl -> get_ParentHwnd(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_put_ParentHwnd(This,value) \
|
||||
( (This)->lpVtbl -> put_ParentHwnd(This,value) )
|
||||
|
||||
#define IUpdateInstaller3_put_ParentWindow(This,value) \
|
||||
( (This)->lpVtbl -> put_ParentWindow(This,value) )
|
||||
|
||||
#define IUpdateInstaller3_get_ParentWindow(This,retval) \
|
||||
( (This)->lpVtbl -> get_ParentWindow(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_get_Updates(This,retval) \
|
||||
( (This)->lpVtbl -> get_Updates(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_put_Updates(This,value) \
|
||||
( (This)->lpVtbl -> put_Updates(This,value) )
|
||||
|
||||
#define IUpdateInstaller3_BeginInstall(This,onProgressChanged,onCompleted,state,retval) \
|
||||
( (This)->lpVtbl -> BeginInstall(This,onProgressChanged,onCompleted,state,retval) )
|
||||
|
||||
#define IUpdateInstaller3_BeginUninstall(This,onProgressChanged,onCompleted,state,retval) \
|
||||
( (This)->lpVtbl -> BeginUninstall(This,onProgressChanged,onCompleted,state,retval) )
|
||||
|
||||
#define IUpdateInstaller3_EndInstall(This,value,retval) \
|
||||
( (This)->lpVtbl -> EndInstall(This,value,retval) )
|
||||
|
||||
#define IUpdateInstaller3_EndUninstall(This,value,retval) \
|
||||
( (This)->lpVtbl -> EndUninstall(This,value,retval) )
|
||||
|
||||
#define IUpdateInstaller3_Install(This,retval) \
|
||||
( (This)->lpVtbl -> Install(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_RunWizard(This,dialogTitle,retval) \
|
||||
( (This)->lpVtbl -> RunWizard(This,dialogTitle,retval) )
|
||||
|
||||
#define IUpdateInstaller3_get_IsBusy(This,retval) \
|
||||
( (This)->lpVtbl -> get_IsBusy(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_Uninstall(This,retval) \
|
||||
( (This)->lpVtbl -> Uninstall(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_get_AllowSourcePrompts(This,retval) \
|
||||
( (This)->lpVtbl -> get_AllowSourcePrompts(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_put_AllowSourcePrompts(This,value) \
|
||||
( (This)->lpVtbl -> put_AllowSourcePrompts(This,value) )
|
||||
|
||||
#define IUpdateInstaller3_get_RebootRequiredBeforeInstallation(This,retval) \
|
||||
( (This)->lpVtbl -> get_RebootRequiredBeforeInstallation(This,retval) )
|
||||
|
||||
|
||||
#define IUpdateInstaller3_get_ForceQuiet(This,retval) \
|
||||
( (This)->lpVtbl -> get_ForceQuiet(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_put_ForceQuiet(This,value) \
|
||||
( (This)->lpVtbl -> put_ForceQuiet(This,value) )
|
||||
|
||||
|
||||
#define IUpdateInstaller3_get_AttemptCloseAppsIfNecessary(This,retval) \
|
||||
( (This)->lpVtbl -> get_AttemptCloseAppsIfNecessary(This,retval) )
|
||||
|
||||
#define IUpdateInstaller3_put_AttemptCloseAppsIfNecessary(This,value) \
|
||||
( (This)->lpVtbl -> put_AttemptCloseAppsIfNecessary(This,value) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IUpdateInstaller3_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IUpdateInstaller4_INTERFACE_DEFINED__
|
||||
#define __IUpdateInstaller4_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IUpdateInstaller4 */
|
||||
/* [hidden][unique][uuid][nonextensible][dual][oleautomation][object][helpstring] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IUpdateInstaller4;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("EF8208EA-2304-492D-9109-23813B0958E1")
|
||||
IUpdateInstaller4 : public IUpdateInstaller3
|
||||
{
|
||||
public:
|
||||
virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Commit(
|
||||
/* [in] */ DWORD dwFlags) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IUpdateInstaller4Vtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
__RPC__in IUpdateInstaller4 * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
__RPC__in IUpdateInstaller4 * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [out] */ __RPC__out UINT *pctinfo);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ UINT iTInfo,
|
||||
/* [in] */ LCID lcid,
|
||||
/* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in REFIID riid,
|
||||
/* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames,
|
||||
/* [range][in] */ __RPC__in_range(0,16384) UINT cNames,
|
||||
/* [in] */ LCID lcid,
|
||||
/* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId);
|
||||
|
||||
/* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
|
||||
IUpdateInstaller4 * This,
|
||||
/* [annotation][in] */
|
||||
_In_ DISPID dispIdMember,
|
||||
/* [annotation][in] */
|
||||
_In_ REFIID riid,
|
||||
/* [annotation][in] */
|
||||
_In_ LCID lcid,
|
||||
/* [annotation][in] */
|
||||
_In_ WORD wFlags,
|
||||
/* [annotation][out][in] */
|
||||
_In_ DISPPARAMS *pDispParams,
|
||||
/* [annotation][out] */
|
||||
_Out_opt_ VARIANT *pVarResult,
|
||||
/* [annotation][out] */
|
||||
_Out_opt_ EXCEPINFO *pExcepInfo,
|
||||
/* [annotation][out] */
|
||||
_Out_opt_ UINT *puArgErr);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ClientApplicationID )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt BSTR *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClientApplicationID )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in BSTR value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsForced )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IsForced )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
/* [helpstring][restricted][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentHwnd )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt HWND *retval);
|
||||
|
||||
/* [helpstring][restricted][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentHwnd )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [unique][in] */ __RPC__in_opt HWND value);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentWindow )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [unique][in] */ __RPC__in_opt IUnknown *value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentWindow )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IUnknown **retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Updates )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IUpdateCollection **retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Updates )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in_opt IUpdateCollection *value);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginInstall )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onCompleted,
|
||||
/* [in] */ VARIANT state,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginUninstall )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
|
||||
/* [in] */ __RPC__in_opt IUnknown *onCompleted,
|
||||
/* [in] */ VARIANT state,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndInstall )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in_opt IInstallationJob *value,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndUninstall )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ __RPC__in_opt IInstallationJob *value,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Install )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RunWizard )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [defaultvalue][unique][in] */ __RPC__in_opt BSTR dialogTitle,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsBusy )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Uninstall )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AllowSourcePrompts )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AllowSourcePrompts )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RebootRequiredBeforeInstallation )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ForceQuiet )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ForceQuiet )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
/* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AttemptCloseAppsIfNecessary )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
|
||||
|
||||
/* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AttemptCloseAppsIfNecessary )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ VARIANT_BOOL value);
|
||||
|
||||
/* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Commit )(
|
||||
__RPC__in IUpdateInstaller4 * This,
|
||||
/* [in] */ DWORD dwFlags);
|
||||
|
||||
END_INTERFACE
|
||||
} IUpdateInstaller4Vtbl;
|
||||
|
||||
interface IUpdateInstaller4
|
||||
{
|
||||
CONST_VTBL struct IUpdateInstaller4Vtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IUpdateInstaller4_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IUpdateInstaller4_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IUpdateInstaller4_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IUpdateInstaller4_GetTypeInfoCount(This,pctinfo) \
|
||||
( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
|
||||
|
||||
#define IUpdateInstaller4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
|
||||
( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
|
||||
|
||||
#define IUpdateInstaller4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
|
||||
( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
|
||||
|
||||
#define IUpdateInstaller4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
|
||||
( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
|
||||
|
||||
|
||||
#define IUpdateInstaller4_get_ClientApplicationID(This,retval) \
|
||||
( (This)->lpVtbl -> get_ClientApplicationID(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_put_ClientApplicationID(This,value) \
|
||||
( (This)->lpVtbl -> put_ClientApplicationID(This,value) )
|
||||
|
||||
#define IUpdateInstaller4_get_IsForced(This,retval) \
|
||||
( (This)->lpVtbl -> get_IsForced(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_put_IsForced(This,value) \
|
||||
( (This)->lpVtbl -> put_IsForced(This,value) )
|
||||
|
||||
#define IUpdateInstaller4_get_ParentHwnd(This,retval) \
|
||||
( (This)->lpVtbl -> get_ParentHwnd(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_put_ParentHwnd(This,value) \
|
||||
( (This)->lpVtbl -> put_ParentHwnd(This,value) )
|
||||
|
||||
#define IUpdateInstaller4_put_ParentWindow(This,value) \
|
||||
( (This)->lpVtbl -> put_ParentWindow(This,value) )
|
||||
|
||||
#define IUpdateInstaller4_get_ParentWindow(This,retval) \
|
||||
( (This)->lpVtbl -> get_ParentWindow(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_get_Updates(This,retval) \
|
||||
( (This)->lpVtbl -> get_Updates(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_put_Updates(This,value) \
|
||||
( (This)->lpVtbl -> put_Updates(This,value) )
|
||||
|
||||
#define IUpdateInstaller4_BeginInstall(This,onProgressChanged,onCompleted,state,retval) \
|
||||
( (This)->lpVtbl -> BeginInstall(This,onProgressChanged,onCompleted,state,retval) )
|
||||
|
||||
#define IUpdateInstaller4_BeginUninstall(This,onProgressChanged,onCompleted,state,retval) \
|
||||
( (This)->lpVtbl -> BeginUninstall(This,onProgressChanged,onCompleted,state,retval) )
|
||||
|
||||
#define IUpdateInstaller4_EndInstall(This,value,retval) \
|
||||
( (This)->lpVtbl -> EndInstall(This,value,retval) )
|
||||
|
||||
#define IUpdateInstaller4_EndUninstall(This,value,retval) \
|
||||
( (This)->lpVtbl -> EndUninstall(This,value,retval) )
|
||||
|
||||
#define IUpdateInstaller4_Install(This,retval) \
|
||||
( (This)->lpVtbl -> Install(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_RunWizard(This,dialogTitle,retval) \
|
||||
( (This)->lpVtbl -> RunWizard(This,dialogTitle,retval) )
|
||||
|
||||
#define IUpdateInstaller4_get_IsBusy(This,retval) \
|
||||
( (This)->lpVtbl -> get_IsBusy(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_Uninstall(This,retval) \
|
||||
( (This)->lpVtbl -> Uninstall(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_get_AllowSourcePrompts(This,retval) \
|
||||
( (This)->lpVtbl -> get_AllowSourcePrompts(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_put_AllowSourcePrompts(This,value) \
|
||||
( (This)->lpVtbl -> put_AllowSourcePrompts(This,value) )
|
||||
|
||||
#define IUpdateInstaller4_get_RebootRequiredBeforeInstallation(This,retval) \
|
||||
( (This)->lpVtbl -> get_RebootRequiredBeforeInstallation(This,retval) )
|
||||
|
||||
|
||||
#define IUpdateInstaller4_get_ForceQuiet(This,retval) \
|
||||
( (This)->lpVtbl -> get_ForceQuiet(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_put_ForceQuiet(This,value) \
|
||||
( (This)->lpVtbl -> put_ForceQuiet(This,value) )
|
||||
|
||||
|
||||
#define IUpdateInstaller4_get_AttemptCloseAppsIfNecessary(This,retval) \
|
||||
( (This)->lpVtbl -> get_AttemptCloseAppsIfNecessary(This,retval) )
|
||||
|
||||
#define IUpdateInstaller4_put_AttemptCloseAppsIfNecessary(This,value) \
|
||||
( (This)->lpVtbl -> put_AttemptCloseAppsIfNecessary(This,value) )
|
||||
|
||||
|
||||
#define IUpdateInstaller4_Commit(This,dwFlags) \
|
||||
( (This)->lpVtbl -> Commit(This,dwFlags) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IUpdateInstaller4_INTERFACE_DEFINED__ */
|
||||
@@ -1,36 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "Exec.h"
|
||||
#include "HResult.h"
|
||||
#include "LegacyUpdate.h"
|
||||
#include <shellapi.h>
|
||||
|
||||
// Function signature required by Rundll32.exe.
|
||||
void CALLBACK LaunchUpdateSite(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow) {
|
||||
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
LPWSTR path;
|
||||
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
// This just calls LegacyUpdate.exe now for backwards compatibility.
|
||||
hr = GetInstallPath(&path);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
PathAppend(path, L"LegacyUpdate.exe");
|
||||
|
||||
DWORD code;
|
||||
hr = Exec(L"open", path, NULL, NULL, nCmdShow, TRUE, &code);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = HRESULT_FROM_WIN32(code);
|
||||
}
|
||||
|
||||
end:
|
||||
if (!SUCCEEDED(hr)) {
|
||||
MessageBox(NULL, GetMessageForHresult(hr), L"Legacy Update", MB_OK | MB_ICONERROR);
|
||||
}
|
||||
|
||||
CoUninitialize();
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
void CALLBACK LaunchUpdateSite(HWND hwnd, HINSTANCE hinstance, LPSTR lpszCmdLine, int nCmdShow);
|
||||
@@ -1,14 +0,0 @@
|
||||
; LegacyUpdate.def : Declares the module parameters.
|
||||
|
||||
EXPORTS
|
||||
; Registration
|
||||
DllCanUnloadNow PRIVATE
|
||||
DllGetClassObject PRIVATE
|
||||
DllRegisterServer PRIVATE
|
||||
DllUnregisterServer PRIVATE
|
||||
|
||||
; Rundll32
|
||||
LaunchUpdateSite PRIVATE
|
||||
|
||||
; Internal use
|
||||
GetMessageForHresult
|
||||
@@ -1,126 +0,0 @@
|
||||
// LegacyUpdate.idl : IDL source for LegacyUpdate
|
||||
//
|
||||
|
||||
// This file will be processed by the MIDL tool to
|
||||
// produce the type library (LegacyUpdate.tlb) and marshalling code.
|
||||
|
||||
#include <olectl.h>
|
||||
#include <idispids.h>
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
import "wuapi.idl";
|
||||
|
||||
typedef enum OSVersionField {
|
||||
e_majorVer = 0,
|
||||
e_minorVer = 1,
|
||||
e_buildNumber = 2,
|
||||
e_platform = 3,
|
||||
e_SPMajor = 4,
|
||||
e_SPMinor = 5,
|
||||
e_productSuite = 6,
|
||||
e_productType = 7,
|
||||
e_systemMetric = 8,
|
||||
e_SPVersionString = 9,
|
||||
e_controlVersionString = 10,
|
||||
e_VistaProductType = 11,
|
||||
e_productName = 12,
|
||||
e_displayVersion = 13,
|
||||
e_maxOSVersionFieldValue = 13
|
||||
} OSVersionField;
|
||||
|
||||
typedef enum UserType {
|
||||
e_nonAdmin = 0,
|
||||
e_admin = 2,
|
||||
e_elevated = 3
|
||||
} UserType;
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(C33085BB-C3E1-4D27-A214-AF01953DF5E5),
|
||||
dual,
|
||||
nonextensible,
|
||||
helpstring("ILegacyUpdateCtrl Interface"),
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface ILegacyUpdateCtrl : IDispatch {
|
||||
[id(1)] HRESULT CheckControl([out, retval] VARIANT_BOOL *retval);
|
||||
[id(2)] HRESULT MessageForHresult(LONG inHresult, [out, retval] BSTR *retval);
|
||||
[id(3)] HRESULT GetOSVersionInfo(OSVersionField osField, LONG systemMetric, [out, retval] VARIANT *retval);
|
||||
[id(14)] HRESULT RequestElevation(void);
|
||||
[id(4)] HRESULT CreateObject(BSTR progID, [out, retval] IDispatch **retval);
|
||||
[id(15)] HRESULT SetBrowserHwnd(IUpdateInstaller *installer);
|
||||
[id(5)] HRESULT GetUserType([out, retval] UserType *retval);
|
||||
[id(8)] HRESULT RebootIfRequired(void);
|
||||
[id(9)] HRESULT ViewWindowsUpdateLog(void);
|
||||
[id(13)] HRESULT OpenWindowsUpdateSettings(void);
|
||||
|
||||
[id(6), propget] HRESULT IsRebootRequired([out, retval] VARIANT_BOOL *retval);
|
||||
[id(7), propget] HRESULT IsWindowsUpdateDisabled([out, retval] VARIANT_BOOL *retval);
|
||||
[id(10), propget] HRESULT IsUsingWsusServer([out, retval] VARIANT_BOOL *retval);
|
||||
[id(11), propget] HRESULT WsusServerUrl([out, retval] BSTR *retval);
|
||||
[id(12), propget] HRESULT WsusStatusServerUrl([out, retval] BSTR *retval);
|
||||
};
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(4524BFBF-70BD-4EAC-AD33-6BADA4FB0638),
|
||||
dual,
|
||||
nonextensible,
|
||||
pointer_default(unique)
|
||||
]
|
||||
interface IProgressBarControl : IDispatch
|
||||
{
|
||||
[id(1), propget] HRESULT Value([out, retval] SHORT *retval);
|
||||
[id(1), propput] HRESULT Value([in] SHORT newVal);
|
||||
};
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(3236E684-0E4B-4780-9F31-F1983F5AB78D),
|
||||
dual,
|
||||
nonextensible,
|
||||
pointer_default(unique),
|
||||
oleautomation
|
||||
]
|
||||
interface IElevationHelper : IDispatch
|
||||
{
|
||||
[id(1)] HRESULT CreateObject(BSTR progID, [out, retval] IDispatch **retval);
|
||||
[id(2)] HRESULT Reboot(void);
|
||||
};
|
||||
|
||||
[
|
||||
uuid(05D22F33-C7C3-4C90-BDD9-CEDC86EA8FBE),
|
||||
version(1.0),
|
||||
helpstring("Legacy Update Control")
|
||||
]
|
||||
library LegacyUpdateLib {
|
||||
importlib(STDOLE_TLB);
|
||||
|
||||
[
|
||||
uuid(AD28E0DF-5F5A-40B5-9432-85EFD97D1F9F),
|
||||
control,
|
||||
helpstring("LegacyUpdateCtrl Class")
|
||||
]
|
||||
coclass LegacyUpdateCtrl {
|
||||
[default] interface ILegacyUpdateCtrl;
|
||||
};
|
||||
|
||||
[
|
||||
uuid(7B875A2F-2DFB-4D38-91F5-5C0BFB74C377),
|
||||
control,
|
||||
helpstring("ProgressBarControl Class")
|
||||
]
|
||||
coclass ProgressBarControl
|
||||
{
|
||||
[default] interface IProgressBarControl;
|
||||
};
|
||||
|
||||
[
|
||||
uuid(84F517AD-6438-478F-BEA8-F0B808DC257F),
|
||||
helpstring("ElevationHelper Class")
|
||||
]
|
||||
coclass ElevationHelper
|
||||
{
|
||||
[default] interface IElevationHelper;
|
||||
};
|
||||
};
|
||||
@@ -1,134 +0,0 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
#include "Version.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
#include "targetver.h"
|
||||
#endif
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (United States) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(65001)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#ifndef APSTUDIO_INVOKED\r\n"
|
||||
"#include ""targetver.h""\r\n"
|
||||
"#endif\r\n"
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"1 TYPELIB ""LegacyUpdate.tlb""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_BUILD
|
||||
PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_BUILD
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Hashbang Productions"
|
||||
VALUE "FileDescription", "Legacy Update"
|
||||
VALUE "FileVersion", VERSION_STRING
|
||||
VALUE "InternalName", "LegacyUpdate.dll"
|
||||
VALUE "LegalCopyright", "© Hashbang Productions. All rights reserved."
|
||||
VALUE "OriginalFilename", "LegacyUpdate.dll"
|
||||
VALUE "ProductName", "Legacy Update"
|
||||
VALUE "ProductVersion", VERSION_STRING
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_LEGACYUPDATEOCX REGISTRY "LegacyUpdate.rgs"
|
||||
|
||||
IDR_LEGACYUPDATECTRL REGISTRY "LegacyUpdateCtrl.rgs"
|
||||
|
||||
IDR_PROGRESSBARCONTROL REGISTRY "ProgressBarControl.rgs"
|
||||
|
||||
IDR_ELEVATIONHELPER REGISTRY "ElevationHelper.rgs"
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_LEGACYUPDATE "Legacy Update"
|
||||
END
|
||||
|
||||
#endif // English (United States) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
1 TYPELIB "LegacyUpdate.tlb"
|
||||
|
||||
#include "wuerror.rc"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
NoRemove AppID
|
||||
{
|
||||
'%APPID%' = s 'Legacy Update Control'
|
||||
{
|
||||
val DllSurrogate = s ''
|
||||
}
|
||||
'LegacyUpdate.dll'
|
||||
{
|
||||
val AppID = s '%APPID%'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,601 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug-VC08|x64">
|
||||
<Configuration>Debug-VC08</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug-VC17|Win32">
|
||||
<Configuration>Debug-VC17</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug-VC08|Win32">
|
||||
<Configuration>Debug-VC08</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug-VC17|x64">
|
||||
<Configuration>Debug-VC17</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{95F3E1A1-5DDA-4C4D-B52B-981D46E6C98B}</ProjectGuid>
|
||||
<RootNamespace>LegacyUpdate</RootNamespace>
|
||||
<Keyword>AtlProj</Keyword>
|
||||
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v90</PlatformToolset>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v90</PlatformToolset>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<XPDeprecationWarning>false</XPDeprecationWarning>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<XPDeprecationWarning>false</XPDeprecationWarning>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v90</PlatformToolset>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<XPDeprecationWarning>false</XPDeprecationWarning>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<IncludePath>$(SolutionDir)\shared;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<IncludePath>$(SolutionDir)\shared;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<IncludePath>$(SolutionDir)\shared;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<IncludePath>$(SolutionDir)\shared;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<IncludePath>$(SolutionDir)\shared;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
<IncludePath>$(SolutionDir)\shared;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<CompileAs />
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>.\LegacyUpdate.def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalOptions>/filealign:0x200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<RegisterOutput>false</RegisterOutput>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)LegacyUpdate.tlb</TypeLibraryName>
|
||||
<HeaderFileName>LegacyUpdate_i.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>LegacyUpdate_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>LegacyUpdate_p.c</ProxyFileName>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>cmd /c start /min "" taskkill /im iexplore.exe</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<CompileAs />
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>.\LegacyUpdate.def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalOptions>/filealign:0x200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<RegisterOutput>false</RegisterOutput>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)LegacyUpdate.tlb</TypeLibraryName>
|
||||
<HeaderFileName>LegacyUpdate_i.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>LegacyUpdate_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>LegacyUpdate_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>cmd /c start /min "" taskkill /im iexplore.exe</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<CompileAs />
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>.\LegacyUpdate.def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalOptions>/filealign:0x200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<RegisterOutput>false</RegisterOutput>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)LegacyUpdate.tlb</TypeLibraryName>
|
||||
<HeaderFileName>LegacyUpdate_i.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>LegacyUpdate_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>LegacyUpdate_p.c</ProxyFileName>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>cmd /c start /min "" taskkill /im iexplore.exe</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<CompileAs />
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ModuleDefinitionFile>.\LegacyUpdate.def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalOptions>/filealign:0x200 %(AdditionalOptions)</AdditionalOptions>
|
||||
<RegisterOutput>false</RegisterOutput>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)LegacyUpdate.tlb</TypeLibraryName>
|
||||
<HeaderFileName>LegacyUpdate_i.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>LegacyUpdate_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>LegacyUpdate_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Command>cmd /c start /min "" taskkill /im iexplore.exe</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>
|
||||
</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>
|
||||
</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<CompileAs />
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>.\LegacyUpdate.def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalDependencies>
|
||||
</AdditionalDependencies>
|
||||
<AdditionalOptions>/filealign:0x200 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)LegacyUpdate.tlb</TypeLibraryName>
|
||||
<HeaderFileName>LegacyUpdate_i.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>LegacyUpdate_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>LegacyUpdate_p.c</ProxyFileName>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<PreBuildEvent>
|
||||
<Command>cmd /c start /min "" taskkill /im iexplore.exe</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>
|
||||
</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>
|
||||
</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<CompileAs />
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>.\LegacyUpdate.def</ModuleDefinitionFile>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalDependencies>
|
||||
</AdditionalDependencies>
|
||||
<AdditionalOptions>/filealign:0x200 %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)LegacyUpdate.tlb</TypeLibraryName>
|
||||
<HeaderFileName>LegacyUpdate_i.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>LegacyUpdate_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>LegacyUpdate_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0409</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ElevationHelper.rgs" />
|
||||
<None Include="icon.ico" />
|
||||
<None Include="LegacyUpdate.def" />
|
||||
<None Include="LegacyUpdate.rgs" />
|
||||
<None Include="LegacyUpdateCtrl.rgs" />
|
||||
<None Include="ProgressBarControl.html">
|
||||
<DeploymentContent>true</DeploymentContent>
|
||||
</None>
|
||||
<None Include="ProgressBarControl.rgs" />
|
||||
<CustomBuild Include="wuerror.mc">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc %(FullPath) -r $(IntDir) -h $(IntDir)</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling Message Table</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Identity).rc;$(IntDir)%(Identity).h;$(IntDir)MSG0409.bin</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mc %(FullPath) -r $(IntDir) -h $(IntDir)</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compiling Message Table</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Identity).rc;$(IntDir)%(Identity).h;$(IntDir)MSG0409.bin</Outputs>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</DeploymentContent>
|
||||
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</DeploymentContent>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">mc %(FullPath) -r $(IntDir) -h $(IntDir)</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">mc %(FullPath) -r $(IntDir) -h $(IntDir)</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">mc %(FullPath) -r $(IntDir) -h $(IntDir)</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">mc %(FullPath) -r $(IntDir) -h $(IntDir)</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">Compiling Message Table</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">Compiling Message Table</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">Compiling Message Table</Message>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">Compiling Message Table</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">$(IntDir)%(Identity).rc;$(IntDir)%(Identity).h;$(IntDir)MSG0409.bin</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">$(IntDir)%(Identity).rc;$(IntDir)%(Identity).h;$(IntDir)MSG0409.bin</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">$(IntDir)%(Identity).rc;$(IntDir)%(Identity).h;$(IntDir)MSG0409.bin</Outputs>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">$(IntDir)%(Identity).rc;$(IntDir)%(Identity).h;$(IntDir)MSG0409.bin</Outputs>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">false</ExcludedFromBuild>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\shared\Exec.c">
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\LegacyUpdate.c">
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\Registry.c">
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\VersionInfo.c">
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\HResult.c">
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\WMI.c">
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">CompileAsCpp</CompileAs>
|
||||
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ElevationHelper.cpp" />
|
||||
<ClCompile Include="LaunchUpdateSite.cpp" />
|
||||
<ClCompile Include="LegacyUpdateCtrl.cpp" />
|
||||
<ClCompile Include="Compat.cpp" />
|
||||
<ClCompile Include="ProgressBarControl.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Utils.cpp" />
|
||||
<ClCompile Include="dlldatax.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">false</CompileAsManaged>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">false</CompileAsManaged>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">false</CompileAsManaged>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">false</CompileAsManaged>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
|
||||
</ClCompile>
|
||||
<ClCompile Include="LegacyUpdate_i.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC08|x64'">false</CompileAsManaged>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug-VC17|x64'">false</CompileAsManaged>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</PrecompiledHeader>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
|
||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\wuerror.h" />
|
||||
<ClInclude Include="..\shared\Exec.h" />
|
||||
<ClInclude Include="..\shared\LegacyUpdate.h" />
|
||||
<ClInclude Include="..\shared\VersionInfo.h" />
|
||||
<ClInclude Include="..\shared\WMI.h" />
|
||||
<ClInclude Include="..\shared\HResult.h" />
|
||||
<ClInclude Include="Compat.h" />
|
||||
<ClInclude Include="ElevationHelper.h" />
|
||||
<ClInclude Include="IUpdateInstaller4.h" />
|
||||
<ClInclude Include="LaunchUpdateSite.h" />
|
||||
<ClInclude Include="LegacyUpdateCtrl.h" />
|
||||
<ClInclude Include="ProgressBarControl.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="Utils.h" />
|
||||
<ClInclude Include="dlldatax.h" />
|
||||
<ClInclude Include="dllmain.h" />
|
||||
<ClInclude Include="LegacyUpdate_i.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="LegacyUpdate.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="LegacyUpdate.idl" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties RESOURCE_FILE="LegacyUpdate.rc" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
@@ -1,168 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Shared">
|
||||
<UniqueIdentifier>{7f88225c-35ff-498e-a402-49bc456952b5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="LegacyUpdate.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
<None Include="icon.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="LegacyUpdate.rgs">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="LegacyUpdateCtrl.rgs">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="ProgressBarControl.rgs">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="ProgressBarControl.html" />
|
||||
<None Include="ElevationHelper.rgs">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="LegacyUpdateCtrl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Utils.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="LaunchUpdateSite.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Compat.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dlldatax.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="LegacyUpdate_i.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ProgressBarControl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ElevationHelper.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\WMI.c">
|
||||
<Filter>Shared</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\Registry.c">
|
||||
<Filter>Shared</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\VersionInfo.c">
|
||||
<Filter>Shared</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\HResult.c">
|
||||
<Filter>Shared</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\Exec.c">
|
||||
<Filter>Shared</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\shared\LegacyUpdate.c">
|
||||
<Filter>Shared</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="LegacyUpdateCtrl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Utils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="LaunchUpdateSite.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Compat.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dlldatax.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dllmain.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="LegacyUpdate_i.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ProgressBarControl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ElevationHelper.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\shared\WMI.h">
|
||||
<Filter>Shared</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\shared\VersionInfo.h">
|
||||
<Filter>Shared</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\shared\HResult.h">
|
||||
<Filter>Shared</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\wuerror.h">
|
||||
<Filter>Shared</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="IUpdateInstaller4.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\shared\Exec.h">
|
||||
<Filter>Shared</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\shared\LegacyUpdate.h">
|
||||
<Filter>Shared</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="LegacyUpdate.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="LegacyUpdate.idl">
|
||||
<Filter>Source Files</Filter>
|
||||
</Midl>
|
||||
<Midl Include="wuapi.idl">
|
||||
<Filter>Source Files</Filter>
|
||||
</Midl>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="wuerror.mc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,521 +0,0 @@
|
||||
// LegacyUpdateCtrl.cpp : Implementation of the CLegacyUpdateCtrl ActiveX Control class.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "LegacyUpdateCtrl.h"
|
||||
#include "Compat.h"
|
||||
#include "ElevationHelper.h"
|
||||
#include "Exec.h"
|
||||
#include "HResult.h"
|
||||
#include "LegacyUpdate.h"
|
||||
#include "Registry.h"
|
||||
#include "User.h"
|
||||
#include "Utils.h"
|
||||
#include "VersionInfo.h"
|
||||
#include "WULog.h"
|
||||
#include <atlbase.h>
|
||||
#include <ShlObj.h>
|
||||
#include <wuapi.h>
|
||||
#include "IUpdateInstaller4.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
const BSTR permittedHosts[] = {
|
||||
L"legacyupdate.net",
|
||||
L"test.legacyupdate.net",
|
||||
NULL
|
||||
};
|
||||
|
||||
// CLegacyUpdateCtrl message handlers
|
||||
|
||||
IHTMLDocument2 *CLegacyUpdateCtrl::GetHTMLDocument() {
|
||||
CComPtr<IOleClientSite> clientSite;
|
||||
HRESULT hr = GetClientSite(&clientSite);
|
||||
if (!SUCCEEDED(hr) || clientSite == NULL) {
|
||||
TRACE("GetDocument() failed: %ls\n", GetMessageForHresult(hr));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CComPtr<IOleContainer> container;
|
||||
hr = clientSite->GetContainer(&container);
|
||||
if (!SUCCEEDED(hr) || container == NULL) {
|
||||
TRACE("GetDocument() failed: %ls\n", GetMessageForHresult(hr));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CComPtr<IHTMLDocument2> document;
|
||||
hr = container->QueryInterface(IID_IHTMLDocument2, (void **)&document);
|
||||
if (!SUCCEEDED(hr) || document == NULL) {
|
||||
TRACE("GetDocument() failed: %ls\n", GetMessageForHresult(hr));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return document.Detach();
|
||||
}
|
||||
|
||||
HWND CLegacyUpdateCtrl::GetIEWindowHWND() {
|
||||
CComPtr<IOleWindow> oleWindow;
|
||||
HRESULT hr = QueryInterface(IID_IOleWindow, (void **)&oleWindow);
|
||||
if (!SUCCEEDED(hr) || !oleWindow) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
HWND hwnd;
|
||||
hr = oleWindow->GetWindow(&hwnd);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
return hwnd;
|
||||
|
||||
end:
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE("GetIEWindowHWND() failed: %ls\n", GetMessageForHresult(hr));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL CLegacyUpdateCtrl::IsPermitted(void) {
|
||||
CComPtr<IHTMLDocument2> document = GetHTMLDocument();
|
||||
if (document == NULL) {
|
||||
#ifdef _DEBUG
|
||||
// Allow debugging outside of IE (e.g. via PowerShell)
|
||||
TRACE("GetHTMLDocument() failed - allowing anyway due to debug build\n");
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
CComPtr<IHTMLLocation> location;
|
||||
CComBSTR host;
|
||||
HRESULT hr = document->get_location(&location);
|
||||
if (!SUCCEEDED(hr) || location == NULL) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
hr = location->get_host(&host);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
for (int i = 0; permittedHosts[i] != NULL; i++) {
|
||||
if (wcscmp(host, permittedHosts[i]) == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE("IsPermitted() failed: %ls\n", GetMessageForHresult(hr));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::GetElevatedHelper(CComPtr<IElevationHelper> &retval) {
|
||||
CComPtr<IElevationHelper> elevatedHelper = m_elevatedHelper ? m_elevatedHelper : m_nonElevatedHelper;
|
||||
if (elevatedHelper == NULL) {
|
||||
// Use the helper directly, without elevation. It's the responsibility of the caller to ensure it
|
||||
// is already running as admin on 2k/XP, or that it has requested elevation on Vista+.
|
||||
HRESULT hr = m_nonElevatedHelper.CoCreateInstance(CLSID_ElevationHelper, NULL, CLSCTX_INPROC_SERVER);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
elevatedHelper = m_nonElevatedHelper;
|
||||
}
|
||||
|
||||
retval = elevatedHelper;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#define DoIsPermittedCheck() \
|
||||
if (!IsPermitted()) { \
|
||||
return E_ACCESSDENIED; \
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::SetClientSite(IOleClientSite *pClientSite) {
|
||||
HRESULT hr = IOleObjectImpl::SetClientSite(pClientSite);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
DoIsPermittedCheck();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::CheckControl(VARIANT_BOOL *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
// Just return true so the site can confirm the control is working.
|
||||
*retval = VARIANT_TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::MessageForHresult(LONG inHresult, BSTR *retval) {
|
||||
DoIsPermittedCheck();
|
||||
*retval = SysAllocString(GetMessageForHresult(inHresult));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::GetOSVersionInfo(OSVersionField osField, LONG systemMetric, VARIANT *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
VariantInit(retval);
|
||||
|
||||
OSVERSIONINFOEX *versionInfo = GetVersionInfo();
|
||||
|
||||
switch (osField) {
|
||||
case e_majorVer:
|
||||
retval->vt = VT_UI4;
|
||||
retval->ulVal = versionInfo->dwMajorVersion;
|
||||
break;
|
||||
|
||||
case e_minorVer:
|
||||
retval->vt = VT_UI4;
|
||||
retval->ulVal = versionInfo->dwMinorVersion;
|
||||
break;
|
||||
|
||||
case e_buildNumber:
|
||||
retval->vt = VT_UI4;
|
||||
retval->ulVal = versionInfo->dwBuildNumber;
|
||||
break;
|
||||
|
||||
case e_platform:
|
||||
retval->vt = VT_UI4;
|
||||
retval->ulVal = versionInfo->dwPlatformId;
|
||||
break;
|
||||
|
||||
case e_SPMajor:
|
||||
retval->vt = VT_I4;
|
||||
retval->lVal = versionInfo->wServicePackMajor;
|
||||
break;
|
||||
|
||||
case e_SPMinor:
|
||||
retval->vt = VT_I4;
|
||||
retval->lVal = versionInfo->wServicePackMinor;
|
||||
break;
|
||||
|
||||
case e_productSuite:
|
||||
retval->vt = VT_I4;
|
||||
retval->lVal = versionInfo->wSuiteMask;
|
||||
break;
|
||||
|
||||
case e_productType:
|
||||
retval->vt = VT_I4;
|
||||
retval->lVal = versionInfo->wProductType;
|
||||
break;
|
||||
|
||||
case e_systemMetric:
|
||||
retval->vt = VT_I4;
|
||||
retval->lVal = GetSystemMetrics(systemMetric);
|
||||
break;
|
||||
|
||||
case e_SPVersionString: {
|
||||
LPWSTR data;
|
||||
DWORD size;
|
||||
HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"BuildLab", 0, &data, &size);
|
||||
retval->vt = VT_BSTR;
|
||||
retval->bstrVal = SUCCEEDED(hr)
|
||||
? SysAllocStringLen(data, size - 1)
|
||||
// BuildLab doesn't exist on Windows 2000.
|
||||
: SysAllocString(versionInfo->szCSDVersion);
|
||||
if (data) {
|
||||
LocalFree(data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case e_controlVersionString: {
|
||||
LPWSTR data;
|
||||
HRESULT hr = GetOwnVersion(&data);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
retval->vt = VT_BSTR;
|
||||
retval->bstrVal = SysAllocString(data);
|
||||
break;
|
||||
}
|
||||
|
||||
case e_VistaProductType: {
|
||||
DWORD productType;
|
||||
GetVistaProductInfo(versionInfo->dwMajorVersion, versionInfo->dwMinorVersion, versionInfo->wServicePackMajor, versionInfo->wServicePackMinor, &productType);
|
||||
retval->vt = VT_UI4;
|
||||
retval->ulVal = productType;
|
||||
break;
|
||||
}
|
||||
|
||||
case e_productName: {
|
||||
HRESULT hr = GetOSProductName(retval);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
LPWSTR data;
|
||||
DWORD size;
|
||||
hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"ProductName", 0, &data, &size);
|
||||
if (SUCCEEDED(hr)) {
|
||||
retval->vt = VT_BSTR;
|
||||
retval->bstrVal = SysAllocStringLen(data, size - 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case e_displayVersion: {
|
||||
LPWSTR data;
|
||||
DWORD size;
|
||||
HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"DisplayVersion", 0, &data, &size);
|
||||
if (SUCCEEDED(hr)) {
|
||||
retval->vt = VT_BSTR;
|
||||
retval->bstrVal = SysAllocStringLen(data, size - 1);
|
||||
LocalFree(data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::RequestElevation() {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
if (m_elevatedHelper != NULL || !AtLeastWinVista()) {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// https://learn.microsoft.com/en-us/windows/win32/com/the-com-elevation-moniker
|
||||
HRESULT hr = CoCreateInstanceAsAdmin(GetIEWindowHWND(), CLSID_ElevationHelper, IID_IElevationHelper, (void**)&m_elevatedHelper);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE("RequestElevation() failed: %ls\n", GetMessageForHresult(hr));
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::CreateObject(BSTR progID, IDispatch **retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
CComPtr<IElevationHelper> elevatedHelper;
|
||||
if (progID == NULL) {
|
||||
hr = E_INVALIDARG;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!ProgIDIsPermitted(progID)) {
|
||||
hr = E_ACCESSDENIED;
|
||||
goto end;
|
||||
}
|
||||
|
||||
hr = GetElevatedHelper(elevatedHelper);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
return elevatedHelper->CreateObject(progID, retval);
|
||||
|
||||
end:
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE("CreateObject(%ls) failed: %ls\n", progID, GetMessageForHresult(hr));
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::SetBrowserHwnd(IUpdateInstaller *installer) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
if (installer == NULL) {
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
CComPtr<IUpdateInstaller> updateInstaller = NULL;
|
||||
HRESULT hr = installer->QueryInterface(IID_IUpdateInstaller, (void **)&updateInstaller);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
updateInstaller->put_ParentHwnd(GetIEWindowHWND());
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::GetUserType(UserType *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
if (IsUserAdmin()) {
|
||||
// Entire process is elevated.
|
||||
*retval = e_admin;
|
||||
} else if (m_elevatedHelper != NULL) {
|
||||
// Our control has successfully received elevation.
|
||||
*retval = e_elevated;
|
||||
} else {
|
||||
// The control has no admin rights (although it may not have requested them yet).
|
||||
*retval = e_nonAdmin;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::get_IsRebootRequired(VARIANT_BOOL *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
// Ask WU itself whether a reboot is required
|
||||
CComPtr<ISystemInformation> systemInfo;
|
||||
if (SUCCEEDED(systemInfo.CoCreateInstance(CLSID_SystemInformation, NULL, CLSCTX_INPROC_SERVER))) {
|
||||
if (SUCCEEDED(systemInfo->get_RebootRequired(retval)) && *retval == VARIANT_TRUE) {
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Check reboot flag in registry
|
||||
HKEY subkey;
|
||||
HRESULT hr = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\RebootRequired", KEY_WOW64_64KEY, KEY_READ, &subkey));
|
||||
if (SUCCEEDED(hr)) {
|
||||
RegCloseKey(subkey);
|
||||
*retval = VARIANT_TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*retval = VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::get_IsWindowsUpdateDisabled(VARIANT_BOOL *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
// Future note: These are in HKCU on NT; HKLM on 9x.
|
||||
// Remove links and access to Windows Update
|
||||
DWORD value;
|
||||
HRESULT hr = GetRegistryDword(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", L"NoWindowsUpdate", KEY_WOW64_64KEY, &value);
|
||||
if (SUCCEEDED(hr) && value == 1) {
|
||||
*retval = VARIANT_TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Remove access to use all Windows Update features
|
||||
hr = GetRegistryDword(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\WindowsUpdate", L"DisableWindowsUpdateAccess", KEY_WOW64_64KEY, &value);
|
||||
if (SUCCEEDED(hr) && value == 1) {
|
||||
*retval = VARIANT_TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*retval = VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::RebootIfRequired(void) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
VARIANT_BOOL isRebootRequired;
|
||||
if (SUCCEEDED(get_IsRebootRequired(&isRebootRequired)) && isRebootRequired == VARIANT_TRUE) {
|
||||
// Calling Commit() is recommended on Windows 10, to ensure feature updates are properly prepared
|
||||
// prior to the reboot. If IUpdateInstaller4 doesn't exist, we can skip this.
|
||||
CComPtr<IUpdateInstaller4> installer;
|
||||
hr = installer.CoCreateInstance(CLSID_UpdateInstaller, NULL, CLSCTX_INPROC_SERVER);
|
||||
if (SUCCEEDED(hr) && hr != REGDB_E_CLASSNOTREG) {
|
||||
hr = installer->Commit(0);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CComPtr<IElevationHelper> elevatedHelper;
|
||||
hr = GetElevatedHelper(elevatedHelper);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = elevatedHelper->Reboot();
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT StartLauncher(LPWSTR params, BOOL wait) {
|
||||
LPWSTR path;
|
||||
HRESULT hr = GetInstallPath(&path);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
PathAppend(path, L"LegacyUpdate.exe");
|
||||
|
||||
DWORD code;
|
||||
hr = Exec(L"open", path, params, NULL, SW_SHOW, wait, &code);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = HRESULT_FROM_WIN32(code);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::ViewWindowsUpdateLog(void) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
HRESULT hr = StartLauncher(L"/log", FALSE);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
// Try directly
|
||||
hr = ::ViewWindowsUpdateLog(SW_SHOWDEFAULT);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::OpenWindowsUpdateSettings(void) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
HRESULT hr = StartLauncher(L"/options", FALSE);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE(L"OpenWindowsUpdateSettings() failed, falling back: %ls\n", GetMessageForHresult(hr));
|
||||
|
||||
// Might happen if the site isn't trusted, and the user rejected the IE medium integrity prompt.
|
||||
// Use the basic Automatic Updates dialog directly from COM.
|
||||
CComPtr<IAutomaticUpdates> automaticUpdates;
|
||||
hr = automaticUpdates.CoCreateInstance(CLSID_AutomaticUpdates, NULL, CLSCTX_INPROC_SERVER);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = automaticUpdates->ShowSettingsDialog();
|
||||
}
|
||||
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE(L"OpenWindowsUpdateSettings() failed: %ls\n", GetMessageForHresult(hr));
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::get_IsUsingWsusServer(VARIANT_BOOL *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
DWORD useWUServer;
|
||||
HRESULT hr = GetRegistryDword(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU", L"UseWUServer", 0, &useWUServer);
|
||||
*retval = SUCCEEDED(hr) && useWUServer == 1 ? VARIANT_TRUE : VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::get_WsusServerUrl(BSTR *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
LPWSTR data;
|
||||
DWORD size;
|
||||
HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate", L"WUServer", 0, &data, &size);
|
||||
*retval = SUCCEEDED(hr) ? SysAllocStringLen(data, size - 1) : NULL;
|
||||
if (data) {
|
||||
LocalFree(data);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CLegacyUpdateCtrl::get_WsusStatusServerUrl(BSTR *retval) {
|
||||
DoIsPermittedCheck();
|
||||
|
||||
LPWSTR data;
|
||||
DWORD size;
|
||||
HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate", L"WUStatusServer", 0, &data, &size);
|
||||
*retval = SUCCEEDED(hr) ? SysAllocStringLen(data, size - 1) : NULL;
|
||||
if (data) {
|
||||
LocalFree(data);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// LegacyUpdateCtrl.h : Declaration of the CLegacyUpdateCtrl ActiveX Control class.
|
||||
|
||||
// CLegacyUpdateCtrl : See LegacyUpdateCtrl.cpp for implementation.
|
||||
|
||||
#include <atlctl.h>
|
||||
#include <MsHTML.h>
|
||||
#include <wuapi.h>
|
||||
#include "resource.h"
|
||||
#include "LegacyUpdate_i.h"
|
||||
|
||||
// CLegacyUpdateCtrl
|
||||
class ATL_NO_VTABLE CLegacyUpdateCtrl :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public IDispatchImpl<ILegacyUpdateCtrl, &IID_ILegacyUpdateCtrl, &LIBID_LegacyUpdateLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
|
||||
public IPersistStreamInitImpl<CLegacyUpdateCtrl>,
|
||||
public IOleControlImpl<CLegacyUpdateCtrl>,
|
||||
public IOleObjectImpl<CLegacyUpdateCtrl>,
|
||||
public IOleInPlaceActiveObjectImpl<CLegacyUpdateCtrl>,
|
||||
public IViewObjectExImpl<CLegacyUpdateCtrl>,
|
||||
public IOleInPlaceObjectWindowlessImpl<CLegacyUpdateCtrl>,
|
||||
public ISupportErrorInfo,
|
||||
public IObjectWithSiteImpl<CLegacyUpdateCtrl>,
|
||||
public IPersistStorageImpl<CLegacyUpdateCtrl>,
|
||||
public IQuickActivateImpl<CLegacyUpdateCtrl>,
|
||||
public IProvideClassInfo2Impl<&CLSID_LegacyUpdateCtrl, NULL, &LIBID_LegacyUpdateLib>,
|
||||
public CComCoClass<CLegacyUpdateCtrl, &CLSID_LegacyUpdateCtrl>,
|
||||
public CComControl<CLegacyUpdateCtrl> {
|
||||
private:
|
||||
CComPtr<IElevationHelper> m_elevatedHelper;
|
||||
CComPtr<IElevationHelper> m_nonElevatedHelper;
|
||||
|
||||
public:
|
||||
CLegacyUpdateCtrl() {
|
||||
m_bWindowOnly = TRUE;
|
||||
}
|
||||
|
||||
DECLARE_OLEMISC_STATUS(
|
||||
OLEMISC_INVISIBLEATRUNTIME |
|
||||
OLEMISC_ACTIVATEWHENVISIBLE |
|
||||
OLEMISC_SETCLIENTSITEFIRST |
|
||||
OLEMISC_INSIDEOUT |
|
||||
OLEMISC_CANTLINKINSIDE |
|
||||
OLEMISC_RECOMPOSEONRESIZE
|
||||
)
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_LEGACYUPDATECTRL)
|
||||
|
||||
BEGIN_COM_MAP(CLegacyUpdateCtrl)
|
||||
COM_INTERFACE_ENTRY(ILegacyUpdateCtrl)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
COM_INTERFACE_ENTRY(IViewObjectEx)
|
||||
COM_INTERFACE_ENTRY(IViewObject2)
|
||||
COM_INTERFACE_ENTRY(IViewObject)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceObject)
|
||||
COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
|
||||
COM_INTERFACE_ENTRY(IOleControl)
|
||||
COM_INTERFACE_ENTRY(IOleObject)
|
||||
COM_INTERFACE_ENTRY(IPersistStreamInit)
|
||||
COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
|
||||
COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
||||
COM_INTERFACE_ENTRY(IQuickActivate)
|
||||
COM_INTERFACE_ENTRY(IPersistStorage)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo)
|
||||
COM_INTERFACE_ENTRY(IProvideClassInfo2)
|
||||
END_COM_MAP()
|
||||
|
||||
BEGIN_PROP_MAP(CLegacyUpdateCtrl)
|
||||
END_PROP_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CLegacyUpdateCtrl)
|
||||
CHAIN_MSG_MAP(CComControl<CLegacyUpdateCtrl>)
|
||||
DEFAULT_REFLECTION_HANDLER()
|
||||
END_MSG_MAP()
|
||||
|
||||
// ISupportsErrorInfo
|
||||
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid) {
|
||||
return IsEqualGUID(riid, IID_ILegacyUpdateCtrl) ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
// IViewObjectEx
|
||||
DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE)
|
||||
|
||||
// ILegacyUpdateCtrl
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
HRESULT FinalConstruct() { return S_OK; }
|
||||
void FinalRelease() {}
|
||||
|
||||
private:
|
||||
IHTMLDocument2 *GetHTMLDocument();
|
||||
HWND GetIEWindowHWND();
|
||||
BOOL IsPermitted();
|
||||
STDMETHODIMP GetElevatedHelper(CComPtr<IElevationHelper> &retval);
|
||||
|
||||
public:
|
||||
STDMETHODIMP SetClientSite(IOleClientSite *pClientSite);
|
||||
|
||||
STDMETHODIMP CheckControl(VARIANT_BOOL *retval);
|
||||
STDMETHODIMP MessageForHresult(LONG inHresult, BSTR *retval);
|
||||
STDMETHODIMP GetOSVersionInfo(OSVersionField osField, LONG systemMetric, VARIANT *retval);
|
||||
STDMETHODIMP RequestElevation();
|
||||
STDMETHODIMP CreateObject(BSTR progID, IDispatch **retval);
|
||||
STDMETHODIMP SetBrowserHwnd(IUpdateInstaller *installer);
|
||||
STDMETHODIMP GetUserType(UserType *retval);
|
||||
STDMETHODIMP get_IsRebootRequired(VARIANT_BOOL *retval);
|
||||
STDMETHODIMP get_IsWindowsUpdateDisabled(VARIANT_BOOL *retval);
|
||||
STDMETHODIMP RebootIfRequired(void);
|
||||
STDMETHODIMP ViewWindowsUpdateLog(void);
|
||||
STDMETHODIMP OpenWindowsUpdateSettings(void);
|
||||
STDMETHODIMP get_IsUsingWsusServer(VARIANT_BOOL *retval);
|
||||
STDMETHODIMP get_WsusServerUrl(BSTR *retval);
|
||||
STDMETHODIMP get_WsusStatusServerUrl(BSTR *retval);
|
||||
};
|
||||
|
||||
OBJECT_ENTRY_AUTO(__uuidof(LegacyUpdateCtrl), CLegacyUpdateCtrl)
|
||||
@@ -1,37 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
LegacyUpdate.Control.1 = s 'LegacyUpdateCtrl Class'
|
||||
{
|
||||
CLSID = s '{AD28E0DF-5F5A-40B5-9432-85EFD97D1F9F}'
|
||||
}
|
||||
LegacyUpdate.Control = s 'LegacyUpdateCtrl Class'
|
||||
{
|
||||
CurVer = s 'LegacyUpdate.Control.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {AD28E0DF-5F5A-40B5-9432-85EFD97D1F9F} = s 'Legacy Update Control'
|
||||
{
|
||||
ProgID = s 'LegacyUpdate.Control.1'
|
||||
VersionIndependentProgID = s 'LegacyUpdate.Control'
|
||||
ForceRemove 'Programmable'
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
val AppID = s '%APPID%'
|
||||
ForceRemove 'Control'
|
||||
'MiscStatus' = s '0'
|
||||
{
|
||||
'1' = s '%OLEMISC%'
|
||||
}
|
||||
'TypeLib' = s '{05D22F33-C7C3-4C90-BDD9-CEDC86EA8FBE}'
|
||||
'Version' = s '1.0'
|
||||
'Implemented Categories'
|
||||
{
|
||||
'{7DD95801-9882-11CF-9FA9-00AA006C42C4}'
|
||||
'{7DD95802-9882-11CF-9FA9-00AA006C42C4}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
override DEBUG := $(or $(DEBUG),1)
|
||||
|
||||
MSBUILDCONFIG32 = $(if $(filter 1,$(DEBUG)),Debug-VC08,Release)
|
||||
MSBUILDCONFIG64 = $(if $(filter 1,$(DEBUG)),Debug-VC17,Release)
|
||||
|
||||
MSBUILDFLAGS = /v:minimal /m
|
||||
|
||||
ifeq ($(CI),1)
|
||||
ifeq ($(DEBUG),1)
|
||||
MSBUILDCONFIG32 = Debug-VC17
|
||||
endif
|
||||
MSBUILDFLAGS += /p:PlatformToolset=v141_xp
|
||||
endif
|
||||
|
||||
MSBUILDFLAGS32 = $(MSBUILDFLAGS) /p:Configuration=$(MSBUILDCONFIG32) /p:Platform=Win32
|
||||
MSBUILDFLAGS64 = $(MSBUILDFLAGS) /p:Configuration=$(MSBUILDCONFIG64) /p:Platform=x64
|
||||
|
||||
VSPATH ?= $(shell wslpath "$(shell '/mnt/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe' -latest -property installationPath)")
|
||||
PATH := $(VSPATH)/MSBuild/Current/Bin:$(PATH)
|
||||
|
||||
MSBUILD = msbuild.exe
|
||||
|
||||
all:
|
||||
@# Workaround for "dlldatax.obj: LNK2001: unresolved external symbol _LegacyUpdate_ProxyFileInfo"
|
||||
rm -f LegacyUpdate_p.c
|
||||
cd ..; $(MSBUILD) $(MSBUILDFLAGS32) LegacyUpdate.sln
|
||||
rm -f LegacyUpdate_p.c
|
||||
cd ..; $(MSBUILD) $(MSBUILDFLAGS64) LegacyUpdate.sln
|
||||
|
||||
ifeq ($(SIGN),1)
|
||||
../build/sign.sh \
|
||||
../Release/LegacyUpdate.dll \
|
||||
../x64/Release/LegacyUpdate.dll
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -rf \
|
||||
Debug-VC08 Debug-VC17 Release x64 \
|
||||
LegacyUpdate_i.c LegacyUpdate_i.h LegacyUpdate_p.c LegacyUpdateidl.h
|
||||
cd ..; $(MSBUILD) $(MSBUILDFLAGS32) LegacyUpdate.sln /t:Clean
|
||||
cd ..; $(MSBUILD) $(MSBUILDFLAGS64) LegacyUpdate.sln /t:Clean
|
||||
|
||||
.PHONY: all clean
|
||||
@@ -1,65 +0,0 @@
|
||||
// ProgressBarControl.cpp : Implementation of CProgressBarControl
|
||||
#include "stdafx.h"
|
||||
#include "ProgressBarControl.h"
|
||||
#include <CommCtrl.h>
|
||||
|
||||
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
|
||||
#ifndef PBS_MARQUEE
|
||||
#define PBS_MARQUEE 0x08
|
||||
#endif
|
||||
|
||||
#ifndef PBM_SETMARQUEE
|
||||
#define PBM_SETMARQUEE (WM_USER + 10)
|
||||
#endif
|
||||
|
||||
LRESULT CProgressBarControl::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) {
|
||||
RECT rc;
|
||||
GetWindowRect(&rc);
|
||||
rc.right -= rc.left;
|
||||
rc.bottom -= rc.top;
|
||||
rc.left = 0;
|
||||
rc.top = 0;
|
||||
m_ctl.Create(m_hWnd, rc, PROGRESS_CLASS, WS_CHILD | WS_VISIBLE, WS_EX_CLIENTEDGE);
|
||||
put_Value(-1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
STDMETHODIMP CProgressBarControl::SetObjectRects(LPCRECT prcPos, LPCRECT prcClip) {
|
||||
IOleInPlaceObjectWindowlessImpl<CProgressBarControl>::SetObjectRects(prcPos, prcClip);
|
||||
::SetWindowPos(m_ctl.m_hWnd, NULL, 0, 0,
|
||||
prcPos->right - prcPos->left,
|
||||
prcPos->bottom - prcPos->top,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CProgressBarControl::get_Value(SHORT *pValue) {
|
||||
if (m_ctl.GetWindowLongPtr(GWL_STYLE) & PBS_MARQUEE) {
|
||||
// Marquee - no value
|
||||
*pValue = -1;
|
||||
} else {
|
||||
// Normal - return PBM_GETPOS
|
||||
*pValue = (SHORT)m_ctl.SendMessage(PBM_GETPOS, 0, 0);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CProgressBarControl::put_Value(SHORT value) {
|
||||
if (value == -1) {
|
||||
// Marquee style
|
||||
m_ctl.SetWindowLongPtr(GWL_STYLE, m_ctl.GetWindowLongPtr(GWL_STYLE) | PBS_MARQUEE);
|
||||
m_ctl.SendMessage(PBM_SETMARQUEE, TRUE, 100);
|
||||
} else {
|
||||
// Normal style
|
||||
SHORT oldValue;
|
||||
get_Value(&oldValue);
|
||||
if (oldValue == -1) {
|
||||
m_ctl.SetWindowLongPtr(GWL_STYLE, m_ctl.GetWindowLongPtr(GWL_STYLE) & ~PBS_MARQUEE);
|
||||
m_ctl.SendMessage(PBM_SETRANGE, 0, MAKELPARAM(0, 100));
|
||||
}
|
||||
|
||||
m_ctl.SendMessage(PBM_SETPOS, value, 0);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// ProgressBarControl.h : Declaration of the CProgressBarControl class.
|
||||
|
||||
#include <atlctl.h>
|
||||
#include "resource.h"
|
||||
#include "LegacyUpdate_i.h"
|
||||
|
||||
// CProgressBarControl
|
||||
class ATL_NO_VTABLE CProgressBarControl :
|
||||
public CComObjectRootEx<CComSingleThreadModel>,
|
||||
public IDispatchImpl<IProgressBarControl, &IID_IProgressBarControl, &LIBID_LegacyUpdateLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
|
||||
public IOleControlImpl<CProgressBarControl>,
|
||||
public IOleObjectImpl<CProgressBarControl>,
|
||||
public IOleInPlaceActiveObjectImpl<CProgressBarControl>,
|
||||
public IViewObjectExImpl<CProgressBarControl>,
|
||||
public IOleInPlaceObjectWindowlessImpl<CProgressBarControl>,
|
||||
public CComCoClass<CProgressBarControl, &CLSID_ProgressBarControl>,
|
||||
public CComControl<CProgressBarControl>
|
||||
{
|
||||
public:
|
||||
CContainedWindow m_ctl;
|
||||
|
||||
CProgressBarControl() : m_ctl(L"msctls_progress32", this, 1) {
|
||||
m_bWindowOnly = TRUE;
|
||||
}
|
||||
|
||||
DECLARE_OLEMISC_STATUS(
|
||||
OLEMISC_RECOMPOSEONRESIZE |
|
||||
OLEMISC_CANTLINKINSIDE |
|
||||
OLEMISC_INSIDEOUT |
|
||||
OLEMISC_ACTIVATEWHENVISIBLE |
|
||||
OLEMISC_SETCLIENTSITEFIRST
|
||||
)
|
||||
|
||||
DECLARE_REGISTRY_RESOURCEID(IDR_PROGRESSBARCONTROL)
|
||||
|
||||
BEGIN_COM_MAP(CProgressBarControl)
|
||||
COM_INTERFACE_ENTRY(IProgressBarControl)
|
||||
COM_INTERFACE_ENTRY(IDispatch)
|
||||
COM_INTERFACE_ENTRY(IViewObjectEx)
|
||||
COM_INTERFACE_ENTRY(IViewObject2)
|
||||
COM_INTERFACE_ENTRY(IViewObject)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceObject)
|
||||
COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
|
||||
COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
|
||||
COM_INTERFACE_ENTRY(IOleControl)
|
||||
COM_INTERFACE_ENTRY(IOleObject)
|
||||
END_COM_MAP()
|
||||
|
||||
BEGIN_PROP_MAP(CProgressBarControl)
|
||||
END_PROP_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CProgressBarControl)
|
||||
MESSAGE_HANDLER(WM_CREATE, OnCreate)
|
||||
CHAIN_MSG_MAP(CComControl<CProgressBarControl>)
|
||||
ALT_MSG_MAP(1)
|
||||
END_MSG_MAP()
|
||||
|
||||
// IViewObjectEx
|
||||
DECLARE_VIEW_STATUS(VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE)
|
||||
|
||||
// IProgressBarControl
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
HRESULT FinalConstruct() { return S_OK; }
|
||||
void FinalRelease() {}
|
||||
|
||||
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
|
||||
STDMETHODIMP SetObjectRects(LPCRECT prcPos, LPCRECT prcClip);
|
||||
|
||||
STDMETHODIMP get_Value(SHORT *pValue);
|
||||
STDMETHODIMP put_Value(SHORT value);
|
||||
};
|
||||
|
||||
OBJECT_ENTRY_AUTO(__uuidof(ProgressBarControl), CProgressBarControl)
|
||||
@@ -1,48 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>ATL test page for object ProgressBarControl</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=8">
|
||||
<meta http-equiv="MSThemeCompatible" content="yes">
|
||||
</head>
|
||||
<body>
|
||||
<div style="border: 1px solid;">
|
||||
<object id="ProgressBarControl" classid="CLSID:7b875a2f-2dfb-4d38-91f5-5c0bfb74c377" width="208" height="14"></object>
|
||||
</div>
|
||||
|
||||
<div id="Value">-1</div>
|
||||
|
||||
<button onclick="marquee()">Marquee</button>
|
||||
<button onclick="normal()">Normal</button>
|
||||
<button onclick="zero()">Zero</button>
|
||||
|
||||
<script>
|
||||
var timer = -1;
|
||||
|
||||
function marquee() {
|
||||
if (timer !== -1) {
|
||||
clearInterval(timer);
|
||||
}
|
||||
|
||||
ProgressBarControl.Value = -1;
|
||||
Value.innerText = "-1";
|
||||
}
|
||||
|
||||
function normal() {
|
||||
if (timer !== -1) {
|
||||
clearInterval(timer);
|
||||
}
|
||||
|
||||
timer = setInterval(function() {
|
||||
var value = ProgressBarControl.Value;
|
||||
Value.innerText = value;
|
||||
ProgressBarControl.Value = value === 100 ? 0 : value + 1;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
function zero() {
|
||||
ProgressBarControl.Value = 0;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,34 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
LegacyUpdate.ProgressBar.1 = s 'ProgressBarControl Class'
|
||||
{
|
||||
CLSID = s '{7B875A2F-2DFB-4D38-91F5-5C0BFB74C377}'
|
||||
}
|
||||
LegacyUpdate.ProgressBar = s 'ProgressBarControl Class'
|
||||
{
|
||||
CurVer = s 'LegacyUpdate.ProgressBar.1'
|
||||
}
|
||||
NoRemove CLSID
|
||||
{
|
||||
ForceRemove {7B875A2F-2DFB-4D38-91F5-5C0BFB74C377} = s 'Legacy Update Progress Bar Control'
|
||||
{
|
||||
ForceRemove Programmable
|
||||
InprocServer32 = s '%MODULE%'
|
||||
{
|
||||
val ThreadingModel = s 'Apartment'
|
||||
}
|
||||
ForceRemove Control
|
||||
MiscStatus = s '0'
|
||||
{
|
||||
'1' = s '%OLEMISC%'
|
||||
}
|
||||
TypeLib = s '{05D22F33-C7C3-4C90-BDD9-CEDC86EA8FBE}'
|
||||
Version = s '1.0'
|
||||
'Implemented Categories'
|
||||
{
|
||||
'{7DD95801-9882-11CF-9FA9-00AA006C42C4}'
|
||||
'{7DD95802-9882-11CF-9FA9-00AA006C42C4}'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by LegacyUpdate.rc
|
||||
//
|
||||
#define IDS_LEGACYUPDATE 1
|
||||
#define IDR_LEGACYUPDATEOCX 101
|
||||
#define IDR_LEGACYUPDATECTRL 102
|
||||
#define IDR_PROGRESSBARCONTROL 103
|
||||
#define IDR_ELEVATIONHELPER 104
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 204
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 201
|
||||
#define _APS_NEXT_SYMED_VALUE 105
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,167 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include <comdef.h>
|
||||
#include <atlstr.h>
|
||||
#include <shlwapi.h>
|
||||
#include "HResult.h"
|
||||
#include "WMI.h"
|
||||
#include "VersionInfo.h"
|
||||
|
||||
#pragma comment(lib, "advapi32.lib")
|
||||
#pragma comment(lib, "shlwapi.lib")
|
||||
#pragma comment(lib, "version.lib")
|
||||
|
||||
typedef DWORD (WINAPI *_InitiateShutdownW)(LPWSTR lpMachineName, LPWSTR lpMessage, DWORD dwGracePeriod, DWORD dwShutdownFlags, DWORD dwReason);
|
||||
|
||||
static BOOL _loadedProductName = FALSE;
|
||||
static CComVariant _productName;
|
||||
|
||||
typedef struct {
|
||||
DWORD version;
|
||||
DWORD osFlag;
|
||||
LPWSTR library;
|
||||
UINT stringIDs[3];
|
||||
} WinNT5Variant;
|
||||
|
||||
static const WinNT5Variant nt5Variants[] = {
|
||||
// XP
|
||||
{0x0501, OS_TABLETPC, L"winbrand.dll", { 180, 2000}},
|
||||
{0x0501, OS_MEDIACENTER, L"winbrand.dll", { 180, 2001}},
|
||||
{0x0501, OS_STARTER, L"winbrand.dll", { 180, 2002}},
|
||||
{0x0501, OS_EMBPOS, L"winbrand.dll", { 180, 2003}},
|
||||
{0x0501, OS_WINFLP, L"winbrand.dll", { 180, 2004}},
|
||||
{0x0501, OS_EMBSTD2009, L"winbrand.dll", { 180, 2005}},
|
||||
{0x0501, OS_EMBPOS2009, L"winbrand.dll", { 180, 2006}},
|
||||
// Check for XP Embedded last as WES2009 also identifies as OS_EMBEDDED.
|
||||
{0x0501, OS_EMBEDDED, L"sysdm.cpl", { 180, 189}},
|
||||
|
||||
// Server 2003
|
||||
{0x0502, OS_APPLIANCE, L"winbrand.dll", { 181, 2002}},
|
||||
{0x0502, OS_STORAGESERVER, L"wssbrand.dll", {1101, 1102}},
|
||||
{0x0502, OS_COMPUTECLUSTER, L"hpcbrand.dll", {1101, 1102, 1103}},
|
||||
{0x0502, OS_HOMESERVER, L"whsbrand.dll", {1101, 1102}},
|
||||
};
|
||||
|
||||
HRESULT GetOSProductName(LPVARIANT productName) {
|
||||
if (!_loadedProductName) {
|
||||
_loadedProductName = TRUE;
|
||||
VariantInit(&_productName);
|
||||
|
||||
// Handle the absolute disaster of Windows XP/Server 2003 edition branding
|
||||
WORD winver = GetWinVer();
|
||||
if (HIBYTE(winver) == 5) {
|
||||
WinNT5Variant variant = {};
|
||||
for (DWORD i = 0; i < ARRAYSIZE(nt5Variants); i++) {
|
||||
if (winver == nt5Variants[i].version && IsOS(nt5Variants[i].osFlag)) {
|
||||
variant = nt5Variants[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (variant.version) {
|
||||
HMODULE brandDll = LoadLibraryEx(variant.library, NULL, LOAD_LIBRARY_AS_DATAFILE);
|
||||
if (brandDll) {
|
||||
WCHAR brandStr[1024];
|
||||
ZeroMemory(brandStr, ARRAYSIZE(brandStr));
|
||||
|
||||
DWORD j = 0;
|
||||
while (variant.stringIDs[j] != 0) {
|
||||
UINT id = variant.stringIDs[j];
|
||||
WCHAR str[340];
|
||||
if (id == 180 || id == 181) {
|
||||
// Get "Microsoft Windows XP" or "Microsoft Windows Server 2003" string
|
||||
HMODULE sysdm = LoadLibraryEx(L"sysdm.cpl", NULL, LOAD_LIBRARY_AS_DATAFILE);
|
||||
if (sysdm) {
|
||||
LoadString(sysdm, id, str, ARRAYSIZE(str));
|
||||
FreeLibrary(sysdm);
|
||||
}
|
||||
} else {
|
||||
LoadString(brandDll, id, str, ARRAYSIZE(str));
|
||||
}
|
||||
|
||||
if (j > 0) {
|
||||
wcscat(brandStr, L" ");
|
||||
}
|
||||
|
||||
wcscat(brandStr, str);
|
||||
j++;
|
||||
}
|
||||
|
||||
_productName.vt = VT_BSTR;
|
||||
_productName.bstrVal = SysAllocString(brandStr);
|
||||
FreeLibrary(brandDll);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_productName.vt == VT_EMPTY) {
|
||||
// Get from WMI
|
||||
HRESULT hr = QueryWMIProperty(L"SELECT Caption FROM Win32_OperatingSystem", L"Caption", &_productName);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VariantCopy(productName, &_productName);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT Reboot() {
|
||||
HRESULT hr = E_FAIL;
|
||||
|
||||
// Make sure we have permission to shut down
|
||||
HANDLE token;
|
||||
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) {
|
||||
hr = AtlHresultFromLastError();
|
||||
TRACE("OpenProcessToken() failed: %ls\n", GetMessageForHresult(hr));
|
||||
goto end;
|
||||
}
|
||||
|
||||
LUID shutdownLuid;
|
||||
if (!LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &shutdownLuid)) {
|
||||
hr = AtlHresultFromLastError();
|
||||
TRACE("LookupPrivilegeValue() failed: %ls\n", GetMessageForHresult(hr));
|
||||
goto end;
|
||||
}
|
||||
|
||||
// Ask the system nicely to give us shutdown privilege
|
||||
TOKEN_PRIVILEGES privileges;
|
||||
privileges.PrivilegeCount = 1;
|
||||
privileges.Privileges[0].Luid = shutdownLuid;
|
||||
privileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||
if (!AdjustTokenPrivileges(token, FALSE, &privileges, 0, NULL, NULL)) {
|
||||
hr = AtlHresultFromLastError();
|
||||
TRACE("AdjustTokenPrivileges() failed: %ls\n", GetMessageForHresult(hr));
|
||||
goto end;
|
||||
}
|
||||
|
||||
// Reboot with reason "Operating System: Security fix (Unplanned)", ensuring to install updates.
|
||||
// Try InitiateShutdown first (Vista+)
|
||||
_InitiateShutdownW $InitiateShutdownW = (_InitiateShutdownW)GetProcAddress(GetModuleHandle(L"advapi32.dll"), "InitiateShutdownW");
|
||||
if ($InitiateShutdownW) {
|
||||
hr = HRESULT_FROM_WIN32($InitiateShutdownW(NULL, NULL, 0, SHUTDOWN_RESTART | SHUTDOWN_INSTALL_UPDATES, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX));
|
||||
}
|
||||
|
||||
// Try InitiateSystemShutdownEx (2k/XP)
|
||||
if (!SUCCEEDED(hr)) {
|
||||
TRACE("InitiateShutdown() failed: %ls\n", GetMessageForHresult(hr));
|
||||
|
||||
if (InitiateSystemShutdownEx(NULL, NULL, 0, FALSE, TRUE, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX) == 0) {
|
||||
hr = AtlHresultFromLastError();
|
||||
TRACE("InitiateSystemShutdownExW() failed: %ls\n", GetMessageForHresult(hr));
|
||||
}
|
||||
}
|
||||
|
||||
// Last-ditch attempt ExitWindowsEx (only guaranteed to work for the current logged in user)
|
||||
if (!ExitWindowsEx(EWX_REBOOT | EWX_FORCEIFHUNG, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX)) {
|
||||
hr = AtlHresultFromLastError();
|
||||
TRACE("ExitWindowsEx() failed: %ls\n", GetMessageForHresult(hr));
|
||||
}
|
||||
|
||||
end:
|
||||
if (token) {
|
||||
CloseHandle(token);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
HRESULT GetOSProductName(LPVARIANT productName);
|
||||
|
||||
HRESULT Reboot();
|
||||
@@ -1,17 +0,0 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
cd %~dp0\..
|
||||
|
||||
:: Clean
|
||||
call build\getvc.cmd x86
|
||||
msbuild LegacyUpdate.sln /v:quiet /m /p:Configuration=Release /p:Platform=Win32 /t:clean
|
||||
if "%errorlevel%" neq "0" exit /b %errorlevel%
|
||||
msbuild LegacyUpdate.sln /v:quiet /m /p:Configuration=Release /p:Platform=x64 /t:clean
|
||||
if "%errorlevel%" neq "0" exit /b %errorlevel%
|
||||
|
||||
:: Build DLL
|
||||
msbuild LegacyUpdate.sln /v:minimal /m /p:Configuration=Release /p:Platform=Win32 %*
|
||||
if "%errorlevel%" neq "0" exit /b %errorlevel%
|
||||
call build\getvc.cmd x64
|
||||
msbuild LegacyUpdate.sln /v:minimal /m /p:Configuration=Release /p:Platform=x64 %*
|
||||
if "%errorlevel%" neq "0" exit /b %errorlevel%
|
||||
@@ -1,38 +0,0 @@
|
||||
/*********************************************************
|
||||
DllData file -- generated by MIDL compiler
|
||||
|
||||
DO NOT ALTER THIS FILE
|
||||
|
||||
This file is regenerated by MIDL on every IDL file compile.
|
||||
|
||||
To completely reconstruct this file, delete it and rerun MIDL
|
||||
on all the IDL files in this DLL, specifying this file for the
|
||||
/dlldata command line option
|
||||
|
||||
*********************************************************/
|
||||
|
||||
#define PROXY_DELEGATION
|
||||
|
||||
#include <rpcproxy.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXTERN_PROXY_FILE( LegacyUpdate )
|
||||
|
||||
|
||||
PROXYFILE_LIST_START
|
||||
/* Start of list */
|
||||
REFERENCE_PROXY_FILE( LegacyUpdate ),
|
||||
/* End of list */
|
||||
PROXYFILE_LIST_END
|
||||
|
||||
|
||||
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C" */
|
||||
#endif
|
||||
|
||||
/* end of generated dlldata file */
|
||||
@@ -1,18 +0,0 @@
|
||||
// wrapper for dlldata.c
|
||||
|
||||
#ifdef _MERGE_PROXYSTUB // merge proxy stub DLL
|
||||
|
||||
#define REGISTER_PROXY_DLL //DllRegisterServer, etc.
|
||||
|
||||
#define _WIN32_WINNT _WIN32_WINNT_WIN2K //for WinNT 4.0 or Win95 with DCOM
|
||||
#define USE_STUBLESS_PROXY //defined only with MIDL switch /Oicf
|
||||
|
||||
#pragma comment(lib, "rpcns4.lib")
|
||||
#pragma comment(lib, "rpcrt4.lib")
|
||||
|
||||
#define ENTRY_PREFIX Prx
|
||||
|
||||
#include "dlldata.c"
|
||||
#include "LegacyUpdate_p.c"
|
||||
|
||||
#endif //_MERGE_PROXYSTUB
|
||||
@@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _MERGE_PROXYSTUB
|
||||
extern "C" {
|
||||
BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved);
|
||||
STDAPI PrxDllCanUnloadNow(void);
|
||||
STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
|
||||
STDAPI PrxDllRegisterServer(void);
|
||||
STDAPI PrxDllUnregisterServer(void);
|
||||
}
|
||||
#endif
|
||||
@@ -1,144 +0,0 @@
|
||||
// dllmain.cpp : Implementation of DLL Exports.
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "LegacyUpdate_i.h"
|
||||
#include "dllmain.h"
|
||||
|
||||
#include <strsafe.h>
|
||||
|
||||
#include "dlldatax.h"
|
||||
#include "Registry.h"
|
||||
#include "LegacyUpdate.h"
|
||||
|
||||
CLegacyUpdateModule _AtlModule;
|
||||
HINSTANCE g_hInstance;
|
||||
|
||||
// DLL Entry Point
|
||||
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) {
|
||||
#ifdef _MERGE_PROXYSTUB
|
||||
if (!PrxDllMain(hInstance, dwReason, lpReserved))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
switch (dwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
g_hInstance = hInstance;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
g_hInstance = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return _AtlModule.DllMain(dwReason, lpReserved);
|
||||
}
|
||||
|
||||
|
||||
// Used to determine whether the DLL can be unloaded by OLE
|
||||
STDAPI DllCanUnloadNow(void) {
|
||||
#ifdef _MERGE_PROXYSTUB
|
||||
HRESULT hr = PrxDllCanUnloadNow();
|
||||
if (hr != S_OK) {
|
||||
return hr;
|
||||
}
|
||||
#endif
|
||||
return _AtlModule.DllCanUnloadNow();
|
||||
}
|
||||
|
||||
|
||||
// Returns a class factory to create an object of the requested type
|
||||
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
|
||||
#ifdef _MERGE_PROXYSTUB
|
||||
if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK) {
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
|
||||
// DllRegisterServer - Adds entries to the system registry
|
||||
STDAPI DllRegisterServer(void) {
|
||||
// registers object, typelib and all interfaces in typelib
|
||||
HRESULT hr = _AtlModule.DllRegisterServer();
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
// Fix the icon path
|
||||
HKEY subkey;
|
||||
hr = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CLASSES_ROOT, L"CLSID\\{84F517AD-6438-478F-BEA8-F0B808DC257F}\\Elevation", 0, KEY_WRITE, &subkey));
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
LPWSTR installPath;
|
||||
hr = GetInstallPath(&installPath);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
WCHAR iconRef[512];
|
||||
hr = StringCchPrintf((LPWSTR)&iconRef, ARRAYSIZE(iconRef), L"@%ls\\LegacyUpdate.exe,-100", installPath);
|
||||
LocalFree(installPath);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = HRESULT_FROM_WIN32(RegSetValueEx(subkey, L"IconReference", 0, REG_SZ, (LPBYTE)iconRef, (DWORD)(lstrlen(iconRef) + 1) * sizeof(TCHAR)));
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = RegCloseKey(subkey);
|
||||
|
||||
#ifdef _MERGE_PROXYSTUB
|
||||
if (!SUCCEEDED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
hr = PrxDllRegisterServer();
|
||||
#endif
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
// DllUnregisterServer - Removes entries from the system registry
|
||||
STDAPI DllUnregisterServer(void) {
|
||||
HRESULT hr = _AtlModule.DllUnregisterServer();
|
||||
#ifdef _MERGE_PROXYSTUB
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
hr = PrxDllRegisterServer();
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
hr = PrxDllUnregisterServer();
|
||||
#endif
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
// DllInstall - Adds/Removes entries to the system registry per user per machine.
|
||||
STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) {
|
||||
HRESULT hr = E_FAIL;
|
||||
static const wchar_t szUserSwitch[] = L"user";
|
||||
|
||||
if (pszCmdLine != NULL) {
|
||||
if (_wcsnicmp(pszCmdLine, szUserSwitch, _countof(szUserSwitch)) == 0) {
|
||||
AtlSetPerUserRegistration(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (bInstall) {
|
||||
hr = DllRegisterServer();
|
||||
if (FAILED(hr)) {
|
||||
DllUnregisterServer();
|
||||
}
|
||||
} else {
|
||||
hr = DllUnregisterServer();
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
// dllmain.h : Declaration of module class.
|
||||
|
||||
class CLegacyUpdateModule : public CAtlDllModuleT<CLegacyUpdateModule> {
|
||||
public:
|
||||
DECLARE_LIBID(LIBID_LegacyUpdateLib)
|
||||
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_LEGACYUPDATEOCX, "{D0A82CD0-B6F0-4101-83ED-DA47D0D04830}")
|
||||
};
|
||||
|
||||
extern class CLegacyUpdateModule _AtlModule;
|
||||
extern HINSTANCE g_hInstance;
|
||||
@@ -1,5 +0,0 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// LegacyUpdate.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
@@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently,
|
||||
// but are changed infrequently
|
||||
|
||||
#ifndef STRICT
|
||||
#define STRICT
|
||||
#endif
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
#define _ATL_NO_AUTOMATIC_NAMESPACE
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
|
||||
|
||||
#define ISOLATION_AWARE_ENABLED 1 // Enable comctl 6.0 (visual styles)
|
||||
|
||||
#include "resource.h"
|
||||
#include <atltrace.h>
|
||||
#include <atlbase.h>
|
||||
#include <atlcom.h>
|
||||
#include <atlctl.h>
|
||||
|
||||
using namespace ATL;
|
||||
|
||||
#define TRACE ATLTRACE
|
||||
@@ -1,11 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#if _MSC_VER > 1599
|
||||
// VC17: Windows XP
|
||||
#define WINVER _WIN32_WINNT_WINXP
|
||||
#define _WIN32_WINNT _WIN32_WINNT_WINXP
|
||||
#else
|
||||
// VC08: Windows 2000 RTM
|
||||
#define WINVER _WIN32_WINNT_WIN2K
|
||||
#define _WIN32_WINNT _WIN32_WINNT_WIN2K
|
||||
#endif
|
||||
@@ -1,39 +0,0 @@
|
||||
import "oaidl.idl";
|
||||
|
||||
// Just types we need from wuapi.idl
|
||||
|
||||
[
|
||||
helpstring("IUpdateInstaller Interface"),
|
||||
object,
|
||||
oleautomation,
|
||||
dual,
|
||||
nonextensible,
|
||||
uuid(7b929c68-ccdc-4226-96b1-8724600b54c2),
|
||||
pointer_default(unique),
|
||||
]
|
||||
interface IUpdateInstaller : IDispatch {
|
||||
[id(0x60020003), propget, restricted]
|
||||
HRESULT ParentHwnd([out, retval] HWND *retval);
|
||||
|
||||
[id(0x60020003), propput, restricted]
|
||||
HRESULT ParentHwnd([in, unique] HWND value);
|
||||
};
|
||||
|
||||
[
|
||||
uuid(B596CC9F-56E5-419E-A622-E01BB457431E),
|
||||
version(2.0),
|
||||
helpstring("WUAPI 2.0 Type Library")
|
||||
]
|
||||
library WUApiLib
|
||||
{
|
||||
importlib("stdole2.tlb");
|
||||
|
||||
[
|
||||
helpstring("UpdateInstaller Class"),
|
||||
uuid(D2E0FE7F-D23E-48E1-93C0-6FA8CC346474)
|
||||
]
|
||||
coclass UpdateInstaller
|
||||
{
|
||||
[default] interface IUpdateInstaller2;
|
||||
};
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user