Compared with Windows InstallerProgramClickonce has the advantages of automatic update and security.
For automatic updates, you can configure them at the time of release, or directly in the form of codeCodeIt is flexible to call the applicationdeployment API to customize updates.
For security, the following is an excerpt from msdn:
Applications deployed using clickonce technology run in the "sandbox". the permissions of these applications are restricted by the security zone. The following table lists the default permissions based on the deployment location:
Deployment location |
Security Zone |
Run from Web |
Internet region |
Install from Web |
Internet region |
Shared installation from network files |
Intranet Region |
Install from CD-ROM |
Full Trust |
The default permission depends on the location where the initial application version is deployed. Updates to the application inherit these permissions. If you configure an application to check for updates from the Web or network location and a newer version exists, you can obtain the Internet or Intranet region permissions for the initial installation, rather than the full trust permission. If you do not want the system to prompt users, the system administrator can specify a clickonce deployment policy to define a specific application publisher as a trusted source. For computers that deploy this policy, the system automatically grants permissions without prompting users to grant permissions.
Clickonce technology is supported by the client, that is, the client must install. Net framework2.0 or later. There is no requirement on the server, as long as the directory after the release can be put, and ensure that the remote client can download all published files, such InWindows Server 2003Use onInternetInformation Service(IIS)And the deployment includesWindowsUnrecognized file type, suchMicrosoft WordFile, thenIISThe file will not be transmitted, so the deployment cannot be completed successfully.
The automatic update of clickonce downloads the change set assembly, not all the assembly. We all know that vs has integrated the clickonce release function, but it is worth noting that the publish command is used for this release function, and the publish command is the superset of the msbuild command. What does this mean? That is, the entire project will be re-compiled for each release, that is, when you update the next version, all the Assembly will be downloaded. Obviously, this does not reflect our initial commitment, because it introduces the concept of manually deploying clickonce, and Microsoft uses the mage.exe(mageui.exe) tool to support manual deployment of clickonce applications. The use of this tool is described in msdn in detail.
If mageui.exe cannot meet the requirements, for example, to automatically register the Assembly permission to the remote service after release, we can develop a suitable release tool around the mage command.
Finally, the manually released assembly must be checked with the Enable clickonce Security Settings option (on the Security tab of the Project Properties) before compilation ), otherwise, a message similar to "reference in the manifest does not match the identity of the downloaded assembly... "Error prompt
If a data file is included in the project to be released, how does clickonce handle version updates? See accessing local data and remote data in a clickonce Application
Unfortunately, manually deploying clickonce cannot be released together with. NET Framework like vs. At least I have not found any solutions yet.
If you have any questions, please refer to the clickonce deployment troubleshooting