Using WIX Toolset 3.11, custom bootstrapper.
Product has minimum requirements of Windows 7 SP1, all the way up to Windows 10. Another wrinkle is that the machine the user may be installing on may not be connected to the internet to download anything.
The end goal is to have .NET 4.6.2 installed prior to executing the installed product. I have a package in my installer that installs .NET 4.6.2 silently. I didn't use the NetFxExtension, because I couldn't figure out how to include the .NET installer for offline installation (all the redist stuff I tried didn't work).
Here comes the problem:
Windows 7 SP1, the default .NET installation is 3.5.
Windows 10, it's 4.something, 3.5 shows as installed in the registry, but not necessarily in the Add or Remove Programs screen.
When I execute the installer on Windows 10, I get my installer UI.
When I execute the installer on Windows 7, I get "Microsoft .NET Framework required for <application> setup". This SEEMS like it's a problem with the BootstrapperCore.config, which is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="wix.bootstrapper" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
<section name="host" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
</sectionGroup>
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
<!-- I've tried adding <supportedRuntime version="v2.0.50727" /> here too. Didn't work. -->
</startup>
<wix.bootstrapper>
<host assemblyName="ApplicationBootstrapper">
<supportedFramework version="v2.0.50727" />
<supportedFramework version="v4.0" />
</host>
</wix.bootstrapper>
</configuration>
It does get through the detect phase, which starts prior to the UI being displayed (I start the detect, then start the UI).
I've checked all the "Similar Questions" suggested by Stack Overflow, as well as digging around the various WIX bootstrapper websites.
This is the closest thing I've found, but it's for msbuild bootstrappers, not burn bootstrappers.
Related
I hope you are doing alright :)
So, I was doing some wix tutorials about Burn, Bootstrapper tool.
I tried to build my own UI (following this tutorial) and when I wanted to run it, it crashed.
I have included this to my AsseblyInfo.cs
[assembly: BootstrapperApplication(
typeof(CustomBootstrapperApplication))]
This is my BootstrapperCore.config
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<configuration>
<configSections>
<sectionGroup name="wix.bootstrapper" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
<section name="host" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
</sectionGroup>
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
<wix.bootstrapper>
<!-- Example only. Use only if the startup/supportedRuntime above cannot discern supported frameworks. -->
<!--
<supportedFramework version="v4\Client" />
<supportedFramework version="v3.5" />
<supportedFramework version="v3.0" />
-->
<!-- Example only. Replace the host/#assemblyName attribute with assembly that implements BootstrapperApplication. -->
<host assemblyName="CustomBA" />
</wix.bootstrapper>
</configuration>
My libraryclass is called CustomBA.
Everything compiles fine, however when trying to run the *.exe output file, it doesnt work.
After taking a look into the logs I found this ...
[5364:3710][2020-07-22T13:53:50]i000: Loading managed bootstrapper application.
[5364:3710][2020-07-22T13:53:50]e000: Error 0x8007000b: Failed to create the managed bootstrapper application.
[5364:3710][2020-07-22T13:53:50]e000: Error 0x8007000b: Failed to create UX.
[5364:3710][2020-07-22T13:53:50]e000: Error 0x8007000b: Failed to load UX.
[5364:3710][2020-07-22T13:53:50]e000: Error 0x8007000b: Failed while running
I have struggling for days. I can see that this problem arises from many years ago but no one comes with a solution for the new releases of netframework 4.8 and wix 3.11(which I think is the problem because the tutorial I am following uses NetF 3.5 and Wix 3.6 I think https://learning.oreilly.com/library/view/wix-36-a/9781782160427/ch16s07.html). Thats the reason i am comming up with a new post.
I hope someone could help me out with this. Kind regards :)
So, Like I said, I have seen too, I mean too many posts asking for help without a solution. However after whole days, I found out that the UI MVVM library class AND the bootstrapper application must be compiled with Release x86. I was compiling with x64 because my msi is built with such arch.
I hope It could be helpful for others.
I'm thinking of making a simple self-contained .NET application with WPF that can run on any modern Windows system without requiring the end-user to download and install .NET Framework manually.
As far as I know user just need to click on .exe and wait some time until required libraries are installed.
But applications that were compiled for 3.5 use old L&F on most recent Windows.
Is there any way to make applications look like this:
and not like this (if user already has .NET Framework 4+):
Finally I came up with simple solution. My assumption was wrong and it appears .NET Framework actually uses L&F of currently running version, not the targeting one.
Create App.config (Project -> Add -> New Item... -> App configuration (.config))
Paste following:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<!-- Use 4.0 -->
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<!-- Use 2.0 - 3.5 -->
<supportedRuntime version="v2.0.50727" />
</startup>
</configuration>
.NET Framework will scan <supportedRuntime> until it finds available. List of supported runtimes can be found here.
I want to write an application that run on windows 7 , 8 , 8.1 and 10 so I targeted 3.5 .NET framework on visual studio ( application name > build > Target framework > Select ".NET Framework 3.5" ) which as far as I know it's the version that windows 7 is shipped with by default (correct me if not) .
after that I added 2 entries to app.config file in visual studio so the whole file became like the following :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
now is this enough to have my application working on windows 7 and later ? if not enough , how I can achieve this ? I viewed all stack overflow "Similar Questions" but nothing helped
EDIT : I don't want the user to be prompted with .NET download dialog if the .Net framework not found.
It should be enough to make your application run on any computer where either the .NET Framework 4 or the .NET Framework 3.5 is installed.
<supportedRuntime version="v4.0" /> make the application prefer .NET Framework 4.0 if it is installed and <supportedRuntime version="v2.0.50727" /> makes sure that you still support users with only .NET Framework 3.5 installed. You should change the order if you want the application to prefer 3.5:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
I have a web app then needs framework 3.5 to run. A system update keeps installing framework 4.5, this breaks the web app. I updated the web.config and even tried an app config for IE (config listed below). But neither work, I downloaded processactivityview tool to see what was going on. It seems to load framework 4.5 before reading the config file.
How can I force the IE to load this page with framework 3.5?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
If you have access to IIS, create new Application Pool in IIS for FW 3.5 and assign your app to it.
I am currently developing a GUI using visual studio 2008 targeting .NetFramework 3.5 I was wondering can a computer without 3.5 but with the latest version(4.0) run the application without any problem or do I still need to install .netFramework 3.5?
You can add the supportedRuntime element to your app.config:
<configuration>
<startup>
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727" />
</startup>
</configuration>
I think you need to install 3.5 framework
You need to install .NET 3.5. .NET 4.0 comes with a different CLR, and therefore cannot execute .NET 3.5 assemblies.