Our application is .NET 3.5 deployed via ClickOnce. We just upgrade to .NET 4.0 and updated the pre-requisities appropriately.
The install still works fine for first-time users or users who install via the setup HTML page. It will automatically install the .NET 4 framework for them. However, users who already have the application installed and attempt to run it via the start menu get the prompt:
"Unable to install or run this application. This application requires your system to be updated to the Microsoft Common Language Runtime Version 4.0.30319.0. More information can be found here" (link to MS website)
Why doesn't it automatically install .NET 4.0 as it does when you run it from the html page? It does not even give the option to download updates. We need a seamless solution for our customers to upgrade to the new application without re-installing manually.
To check for updates before the application startsClick the Publish tab. Click the Updates button to open the Application Updates dialog box.
ClickOnce and DirectInvoke are supported out of the box for all Windows users. Users that want to disable ClickOnce support can go to edge://flags/#edge-click-once and select Disabled from the dropdown list. You'll have to Restart the browser.
Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.
To delete the ClickOnce file cache, delete the contents of this folder based on the operating system. Deleting these files will clear the information for all installed ClickOnce applications. They'll reinstall the next time their shortcut or Uniform Resource Identifiers (URIs) are used.
Read this question and answer first.
Here's what's happening in your scenarios.
"The install works fine for first-time users..."
Actually, this would work for any user that went to the html page, not just first-time users. The html page has some script that checks their user-agent string for the 4.0 framework. If they don't have it, it gives them an explanation and tells them to install it from a link to the bootstrapper that Visual Studio created (setup.exe). This is all separate from ClickOnce; ClickOnce does nothing until they click on the link to the .application file or they run the setup.exe which launches the .application file when it finishes.
"Users who already have the application installed and attempt to run it via the start menu..."
What happens here, is that the application updates correctly. They get the latest version. Only they can't run the latest version because it's a .Net 4.0 executable and they don't have the 4.0 framework.
At this point you have a few options...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With