ClickOnce cannot find its prerequisites while the files are in the place where they should be

I want to publish my application using ClickOnce with some prerequisites (.NET 4.5 and SQL Server Express ).

I did as they say in How to enable prerequisites in a ClickOnce application (note that the folder folders were in the v8.1A folder instead of the v8A folder), but it still says that it cannot find the files. I tried both Visual Studio 2013 and Visual Studio 2015 RC.

To enable "Download prerequisites from the same location as my application" in the Prerequisites dialog box, you must download the file "DotNetFX45 \ dotNetFx45_Full_x86_x64.exe" for the item "Microsoft.NET Framework 4.5 (x86 and x64)" on your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883 .

To enable "Download prerequisites from the same location as my application" in the "Prerequisites" dialog box, you must download the file "SqlExpress2012 \ SQLEXPR32_x86_ENU.EXE" for the SQL Server 2012 Express item to your local computer. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883 .

To enable "Prospects for downloading from the same location as my application" in the Prerequisites dialog box, you must download the file "SqlExpress2012 \ SQLEXPR_x64_ENU.EXE" for the SQL Server 2012 Express item to the local computer. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883 .

To enable “Download prerequisites from the same location as my application” in the “Prerequisites” dialog box, you must download the file “DotNetFX40ClientKB2468871 \ dotNetFx40_Client_x86_x64.exe” for the item "Microsoft.NET Framework 4 Client Profile (x86 and x64) and Updates for the .NET Framework 4 (KB2468871) "on your local computer. For more information, see http://go.microsoft.com/fwlink/?LinkId=239883 .

+6
source share
2 answers

You have a very poor idea of ​​what's possible in a ClickOnce deployment. The canonical MSDN page is this . Highlighting the most significant sections of this web page:

Impact on the user computer . When deploying the Windows Installer, applications often rely on shared components, with the possibility of version conflicts; With the deployment of ClickOnce, each application is standalone and cannot interfere with other applications.
Security Permissions Deploying Windows Installer requires administrative permissions and only limited user installation is allowed; ClickOnce deployment allows non-administrator users to set and grant only those code access permissions that are required by the application.

Does not affect common components or other applications : Yes
Installation of shared files : No
Installation in the global assembly cache : No
Installation for multiple users : No
Set registry access time : Limited

These intentional limitations were designed to make users feel good about installing .NET programs with ClickOnce. They do not need administrator help to install the program. And the installer cannot make serious changes to the machine, which leads to failures in the work of other programs. A very, very common problem with installers.

This is grossly incompatible with what you are trying to do. Both the .NET Framework and SQL Express are common components and require administrator access to install and destabilize the risk of a machine on which a .NET or SQL server is already installed.

So it just can't work. You can select them as Prerequisites, but all that happens during the installation is that the ClickOnce installer verifies that they are complete. In other words, .NET and SQL Express versions must already be installed on the machine. If this does not happen, the deployment will fail, and the user will receive a dialog box in which he tells where to download the installer. Then it fully (or its administrator) downloads and launches the installer. After that, ClickOnce installation completes without any problems.

The deployment wizard is quite meticulous, he had to hide the switches below. Only “from the component vendor’s website” is a valid choice for these prerequisites. The bootstrapper.xml file format is not complex enough to limit the selection.

The only way to move forward if you want to provide the user with these prerequisites included in the installation kit is to create a regular MSI installer.

+6
source

The way I have done this script in the past is to simply use the built-in "publish" functions. They seem to work well in my experience.

In the Publish Configuration section of your application, there is a Prerequisite button that you can click and check, among other things, the .NET Framework and SQL Express. During the installation of ClickOnce, it asks the user to pull them out of Microsoft before installing the application. Application properties

Prerequisites selection

0
source

All Articles