I’m trying to deploy a WPF application using ClickOnce.
The project’s target framework is: “.NET Framework 4.5”.
In the VS project properties -> “Publish” -> “Prerequisites” I have checked two items:
When I try to launch this application on a Windows 7 computer that doesn’t have .NET 4.5 preinstalled I get a popup saying:
The installation does not attempt to download/install the framework for me. It simply gives up displaying this message. The client user running the ClickOnce installation has administrator privileges on the machine.
Why doesn’t ClickOnce install .NET 4.5 automatically?
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.
Click the Prerequisites button to open the Prerequisites dialog box. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components check box is selected. In the Prerequisites list, check the components that you wish to install, and then click OK.
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.
I left out to mention in my question that I was upgrading from another ClickOnce application with prerequisites on .NET4.
ClickOnce prerequisites are only evaluated on the first installation so to upgrade to .NET4.5 I followed a technique described here. I.e. the old application uninstalls itself and then launches the installation of the new ClickOnce application with the new prerequisites on .NET4.5.
Process.Start("iexplore.exe", newClickOnceApplicationUrl);
Application.Current.Shutdown();
Some machines got the error message (“Please contact your system administrator.”) and some installed ok without any problems. On the machines that got the error it worked ok if the ClickOnce url was launched manually.
All users running the install were part of the Administrators group for their local machine. My theory is that the iexplorer.exe process launched from ClickOnce did not run under administrator privileges on the machines that had the problem. I did not investigate this any further though.
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