Search code examples
wixwindows-installer

Check RAM in WIX Installer


I want to create a WIX Installer, during the prerequisites check, I want to see the amount of RAM Installed on the system.If it is less than 1 GB, It should show a Message to the user Indicating that "Amount of RAM on the system is less than the minimum required by this product. Do you still want to proceed with the Installation?" There are two buttons in the message box shown (Yes and No). If User clicks on Yes, I continue with the Installation, If user clicks on No, I will just show the finish dialog or abort the Installation. How can I achieve this?


Solution

  • Windows Installer sets the system RAM amount in PhysicalMemory property. Usually this property is used as a launch condition which stops the installation and shows a message to the user.

    Launch conditions do not allow the user to continue. So if this is not an option, a solution is to use a custom action. Your custom action can check PhysicalMemory and show a custom message box if it's not enough. Based on the user answer, the custom action can then return 0 to continue or 1602 to stop.

    Here is a sample condition:

    PhysicalMemory >= 1024