7

This is WIX script fragment

<InstallExecuteSequence>
    <Custom Action="Warning" After="InstallFinalize">NOT INSTALLED</Custom>
</InstallExecuteSequence>
<CustomAction Id="Warning" BinaryKey="ExtendedActions" DllEntry="WarningAboutUpgrade" Execute="immediate" Return="check"/>
<Binary Id="ExtendedActions" SourceFile="$(var.ExtendedActions.TargetDir)$(var.ExtendedActions.TargetName).CA.dll" />

This is c# custom action code

using Microsoft.Deployment.WindowsInstaller;

namespace ExtendedActions
{
    public class CustomActions
    {
        [CustomAction]
        public static ActionResult WarningAboutUpgrade(Session session)
        {
            session.Log($"Begin CustomAction WarningAboutUpgrade");
            session.Message(InstallMessage.Info, new Record { FormatString = "Product updated. To upgrade Project execute initHeating.ps1 }" });
            return ActionResult.Success;
        }
    }
}

during the install process Message is not shown;

drgrd
  • 73
  • 1
  • 4

1 Answers1

8

That's because you call session.Message with the parameter InstallMessage.Info. This causes that the text will not be shown to the user. The message can be found in the log-file instead. This behaviour is by design.

To archive your goal change the first parameter to InstallMessage.Warning or InstallMessage.Error

session.Message(InstallMessage.Warning, new Record 
{ 
  FormatString = "Product updated. To upgrade Project execute initHeating.ps1" 
});
Stefan Wanitzek
  • 2,059
  • 1
  • 15
  • 29
  • Hi @Stefan Wanitzek , can we pass a link along with the message ,if yes can you please suggest how can we achieve that – Aditya Dalai Jul 13 '23 at 10:39