oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.12k stars 176 forks source link

Problem with Condition.Net462_Installed #573

Closed digitalsigi closed 5 years ago

digitalsigi commented 5 years ago

I want to check whether .Net 4.6.2 is installed using

project.SetNetFxPrerequisite(Condition.Net462_Installed, "RVS-Cockpit benötigt .NET 4.6.2.\nDownload: https://www.microsoft.com/de-de/download/details.aspx?id=53344");

this results in

    <Condition Message="RVS-Cockpit benötigt .NET 4.6.2.&#xA;Download: https://www.microsoft.com/de-de/download/details.aspx?id=53344"><![CDATA[ (NETFRAMEWORK45 >= "#394802 ") ]]></Condition>

Although .NET is installed - i verified several times, even in registry, resulting msi constantly is asking for it. Further investigation discovered that the space after #394802 might be the problem. When removing it with orca installation continues. How to get around this?

oleg-shilo commented 5 years ago

The fix is committed but it just missed the release by 2 days. You can use this work around until the next release is available:

var fixed_Net462_Installed = new Condition(" (NETFRAMEWORK45 >= '#394802') ");
...
var project =
    new Project("My Product",
        new Dir("dynamic_installdir",
            new File(@"Files\Bin\MyApp.exe"),
                new ManagedAction(
                    Script.GetInstanceDir, 
                    Return.check, 
                    When.Before, 
                    Step.LaunchConditions, 
                    fixed_Net462_Installed, 
                    Sequence.InstallUISequence));
digitalsigi commented 5 years ago

Hi Oleg, thx for the hit, shame on me that I didn't discover it myself. I'll test it as soon as possible.