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.
source share