Simon Fisher
Posts: 21
Joined: 2016-07-12
|
Hi,
We have an AddIn solution with multiple projects that all target .Net 4.5.2. We're using Visual Studio 2019 and the WiX framework for our setup projects. When I use the Add-In Express context menu to 'Create Setup Project', the project that is created always includes a prerequisite check for .Net Framework 2.
As an example, in the setup project it creates, the Product.wxs file contains this:
<!-- The ".NET Framework" launch condition. -->
<PropertyRef Id="NETFRAMEWORK20"/>
<Condition Message="This setup requires the .NET Framework 2.0. Please install the .NET Framework and run this setup again."><![CDATA[Installed OR NETFRAMEWORK20]]></Condition>
If I create a brand new Add-In Express project, by default it targets .Net 4.5. If I create a setup project using the same steps, that project has a check for .Net 4.5. In Product.wxs:
<PropertyRef Id="NETFRAMEWORK45"/> .
As soon as I change that same project to target 4.5.2 instead, and create a new setup project, it checks for 2.0 again.
I appreciate that I can manually change those checks after the setup project is created, but it would be nice if the setup project creator handled this properly.
Is this something that can be fixed? Or do you have any guidance as to what versions of the .Net framework are supported?
Regards,
Simon |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
|
Simon Fisher
Posts: 21
Joined: 2016-07-12
|
Thank you Andrei, I didn't think that it could be an issue with WiX.
I did a bit of research and I've come up with a slightly different solution. Even though WiX won't auto-detect the correct .NET version, it still has constants for them:
<PropertyRef Id="WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED"/>
<Condition Message="This setup requires the .NET Framework 4.5.2. Please install the .NET Framework and run this setup again."><![CDATA[Installed OR WIX_IS_NETFRAMEWORK_452_OR_LATER_INSTALLED]]></Condition>
On a machine with .NET 4.7.1 installed (only), my installer runs properly. I've yet to test it on a machine with only 4.5, or even 2.0, but I'm confident.
Reference: https://wixtoolset.org/documentation/manual/v3/customactions/wixnetfxextension.html |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Thank you, Simon!
Andrei Smolin
Add-in Express Team Leader |
|