Jakob S.
Jakob S.

Reputation: 1891

Wix: Show conditional message box without cancel

is there some way to show a message box due to some condition but continue installation?

I would like to inform the user about the recommended amount of RAM if he has less.

If I use

<Condition Message="For running $(var.ProductName), 4GB of physical memory are recommended.">
    <![CDATA[PhysicalMemory > 3500]]>
</Condition>

the installation is unsuccessful on machines with less than 4GB of RAM.

How can I avoid this?

Thanks for your help!

Upvotes: 12

Views: 14100

Answers (2)

Jakob S.
Jakob S.

Reputation: 1891

Thanks to Cosmin Pirvu's answer I found the following solution with custom actions to work for me, I want to share with you:

<Custom Action="PhysicalMemoryWarning" After="InstallInitialize" />
<CustomAction Id="PhysicalMemoryWarning" Script="vbscript">
  <![CDATA[
  If session.Property("PhysicalMemory") < 3500 Then
    MsgBox("For running $(var.ProductName), 4GB of physical memory are recommended.")
  End If
  ]]>
</CustomAction>

Upvotes: 15

Cosmin
Cosmin

Reputation: 21436

Windows Installer doesn't offer direct support for this. But you can use a simple custom action. It can be an EXE, DLL, VBScript, JavaScript etc.

Upvotes: 2

Related Questions