Bump to 1.11

This commit is contained in:
Vichingo455
2025-03-23 12:49:51 +01:00
parent 7ca9105b8d
commit 23ac8a27f0
65 changed files with 2470 additions and 3597 deletions

View File

@@ -1,39 +1,33 @@
#define CINTERFACE
#define COBJMACROS
#include <windows.h>
#include <nsis/pluginapi.h>
#include <wuapi.h>
#include "main.h"
static const GUID our_CLSID_UpdateServiceManager = { 0xf8d253d9, 0x89a4, 0x4daa, { 0x87, 0xb6, 0x11, 0x68, 0x36, 0x9f, 0x0b, 0x21 } };
static const GUID our_IID_IUpdateServiceManager2 = { 0x0bb8531d, 0x7e8d, 0x424f, { 0x98, 0x6c, 0xa0, 0xb8, 0xf6, 0x0a, 0x3e, 0x7b } };
static const LPWSTR MicrosoftUpdateServiceID = L"7971f918-a847-4430-9279-4a52d1efe18d";
EXTERN_C __declspec(dllexport)
void __cdecl EnableMicrosoftUpdate(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters *extra) {
EXDLL_INIT();
g_hwndParent = hwndParent;
PLUGIN_METHOD(EnableMicrosoftUpdate) {
PLUGIN_INIT();
IUpdateServiceManager2 *serviceManager;
IUpdateServiceRegistration *registration;
HRESULT hr = CoCreateInstance(our_CLSID_UpdateServiceManager, NULL, CLSCTX_INPROC_SERVER, our_IID_IUpdateServiceManager2, (void **)&serviceManager);
HRESULT hr = CoCreateInstance(&CLSID_UpdateServiceManager, NULL, CLSCTX_INPROC_SERVER, &IID_IUpdateServiceManager2, (void **)&serviceManager);
if (!SUCCEEDED(hr)) {
goto end;
}
hr = IUpdateServiceManager2_AddService2(serviceManager, SysAllocString(MicrosoftUpdateServiceID), asfAllowPendingRegistration | asfAllowOnlineRegistration | asfRegisterServiceWithAU, SysAllocString(L""), &registration);
if (!SUCCEEDED(hr)) {
goto end;
}
BSTR serviceID = SysAllocString(MicrosoftUpdateServiceID);
BSTR serviceCab = SysAllocString(L"");
hr = IUpdateServiceManager2_AddService2(serviceManager, serviceID, asfAllowPendingRegistration | asfAllowOnlineRegistration | asfRegisterServiceWithAU, serviceCab, &registration);
SysFreeString(serviceID);
SysFreeString(serviceCab);
end:
if (registration != NULL) {
if (registration) {
IUpdateServiceManager2_Release(registration);
}
if (serviceManager != NULL) {
if (serviceManager) {
IUpdateServiceManager2_Release(serviceManager);
}