Wix CustomAction session.Log not working

I use Wix to install the Windows Installer MSI file. I have a CustomAction that sets the ScheduledTask, and in CustomAction I have introduced some session.Log statements.

If I create everything in debug mode, the session.Log statements seem to work, but when I create in Release mode, it looks like it is no longer being logged. It's right? Or are there other scenarios where session.Log will not work? Is there a way around any of these scenarios, so that session.Log always works?

Edit: CustomAction is written in C # (i.e. managed)

+3
source share
2 answers

, , ...

... ( WiX)

, ++, :

  • , .NET Framework. , MSI LaunchCondition, .NET Framework , - .

  • , , .NET Framework . , , .NET Framework .

  • .NET Framework, , . "" .NET Framework ..NET Framework - .

, , VBScript ( JScript) MSI CustomActions

, ... ++, - , . , .

#define _USE_RTM_VERSION 

void LogString(MSIHANDLE hInstall, TCHAR* szString)
{
    PMSIHANDLE newHandle = ::MsiCreateRecord(2);
    TCHAR szTemp[MAX_PATH * 2];
    sprintf_s(szTemp, MAX_PATH * 2, "-- MSI_LOGGING --   %s", szString); 
    MsiRecordSetString(newHandle, 0, szTemp);
    MsiProcessMessage(hInstall, INSTALLMESSAGE(INSTALLMESSAGE_INFO), newHandle);
}

UINT __stdcall MyCustomAction ( MSIHANDLE hModule )
{
    LogString(hModule, "Whoa! I am a custom action..");
    return ERROR_SUCCESS;
}
+1

, , . , ?

0

Source: https://habr.com/ru/post/1722021/