HTML host control external.MsiEvaluateCondition(aCondition) issues - Advanced Installer Community
dlenis
Posts: 40
Joined: Wed Nov 02, 2016 2:37 pm

HTML host control external.MsiEvaluateCondition(aCondition) issues

I have a host control that is using the "external.MsiEvaluateCondition(aCondition)" to evaluate 3 conditions: (see below)
The 2 conditions to check for DOTNET will return false when they should return true.
I did get them too worked. In order for the DOTNET conditions to work from the html host control I added the condition (AI_DETECTED_DOTNET_VERSION >= "2.0") to any control in the dialog. It does not matter what version or if it returns true or false in the dialog control condition.

I believe this is a bug since the "external.MsiEvaluateCondition('VersionNT >= 602 AND MsiNTProductType <> 1');" works without any issues. It does not need a condition to exist in a dialog control. Please confirm.
  • external.MsiEvaluateCondition(aCondition):
    var OsResult = external.MsiEvaluateCondition('VersionNT >= 602 AND MsiNTProductType <> 1');
    var Net35Result = external.MsiEvaluateCondition('AI_DETECTED_DOTNET_VERSION >= "3.5"');
    var Net40Result = external.MsiEvaluateCondition('AI_DETECTED_DOTNET_VERSION >= "4.0"');
Thank you,

Diego
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: HTML host control external.MsiEvaluateCondition(aCondition) issues

Hello Diego,

AI_DETECTED_DOTNET_VERSION property only gets resolved only when it's used in a condition field from the project.

To have the conditions from the script evaluated, you can add a condition like this in the project:

Code: Select all

1=1 OR AI_DETECTED_DOTNET_VERSION
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dlenis
Posts: 40
Joined: Wed Nov 02, 2016 2:37 pm

Re: HTML host control external.MsiEvaluateCondition(aCondition) issues

Mihai,
I've added the condition as you described in "Launch Conditions, Custom tab". My concern is will this get evaluated right away and if it failed the installer will stop execution since it does not meet launch conditions?

Thank you,

Diego
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: HTML host control external.MsiEvaluateCondition(aCondition) issues

Dear Diego,

Please note that this condition:

Code: Select all

1=1 OR AI_DETECTED_DOTNET_VERSION
...will always evaluate to true.

Also, as a side note FYI: AI_DETECTED_DOTNET_VERSION property can be used in any condition field from the project. It doesn't necessarily have to be a launch condition. As long as the property is referenced anywhere, it will get evaluated.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”