installer: CustomActions: InstanceID

This commit is contained in:
Bill Zissimopoulos 2022-09-04 15:55:47 +01:00
parent 0b3ce52958
commit 9154ec784d
2 changed files with 36 additions and 0 deletions

View File

@ -25,6 +25,41 @@
#include <wcautil.h> #include <wcautil.h>
#include <strutil.h> #include <strutil.h>
UINT __stdcall InstanceID(MSIHANDLE MsiHandle)
{
#if 0
WCHAR MessageBuf[64];
wsprintfW(MessageBuf, L"PID=%ld", GetCurrentProcessId());
MessageBoxW(0, MessageBuf, L"" __FUNCTION__ " Break", MB_OK);
#endif
HRESULT hr = S_OK;
UINT err = ERROR_SUCCESS;
SYSTEMTIME SystemTime;
WCHAR Result[32+1];
hr = WcaInitialize(MsiHandle, __FUNCTION__);
ExitOnFailure(hr, "Failed to initialize");
WcaLog(LOGMSG_STANDARD, "Initialized");
GetSystemTime(&SystemTime);
wsprintfW(Result, L"%04u%02u%02uT%02u%02u%02uZ",
SystemTime.wYear,
SystemTime.wMonth,
SystemTime.wDay,
SystemTime.wHour,
SystemTime.wMinute,
SystemTime.wSecond);
Sleep(1000);
WcaSetProperty(L"" __FUNCTION__, Result);
LExit:
err = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
return WcaFinalize(err);
}
UINT __stdcall ServiceRunning(MSIHANDLE MsiHandle) UINT __stdcall ServiceRunning(MSIHANDLE MsiHandle)
{ {
#if 0 #if 0

View File

@ -1,2 +1,3 @@
EXPORTS EXPORTS
InstanceID
ServiceRunning ServiceRunning