C # Window programming note-ClickOnce program deployment
There are two main points about ClickOnce: What is ClickOnce? ClickOnce usage
1. What is ClickOnce?(From Baidu) ClickOnce is a deployment technology that allows you to create self-update Windows-based applications that can be installed and run through minimal user interaction.
Advantages of using ClickOnce deployment:1. Easy to update:If you use Microsoft Windows Installer to deploy a program, you must reinstall the entire program every time you update the program. If you use ClickOnce to deploy the program, the system automatically provides updates. Only the changed application is downloaded, and the complete and updated application is re-installed from the new parallel folder.2. Computer Security:When using Windows Installer for deployment, applications usually rely on shared components, which may lead to version conflicts. When using ClickOnce for deployment, each application is independent, it does not interfere with other applications.3. Permission security:For Windows Installer deployment, administrator permissions are required and only Restricted Users are allowed to install the program. ClickOnce deployment allows non-administrator users to install the application and only grant security permissions to the Code required by the application.
Ii. Use of ClickOnce We know that ClickOnce is a deployment technology, and deployment is actually what we call installation. So we can say that a ClickOnce application is a type of installation package, which can be installed in one step, unlike the traditional installation package we use, we need N "Next Steps", which is then completed. Next, let's try to release a Windows Forms Application. Use the previously created table export tool as an example: First open our project: open solution resource manager ", right-click the project node and select Properties to open the Properties window. In the Properties window, switch to the release window. We can see two release locations: the local folder and the Web server address on IIS can also be an FTP address. First, try the local folder publishing method: enter a folder address directly in the first column, for example, "D: \ Unity3D \ C # \ Window Forms Applications ". If you want to add the server to be published only on the server, you only need to enter the server Url in the second column. If both columns are filled in, the server will be published and backed up locally. Then, we need to set the installation mode, which can be divided into two types. Generally, the second option is selected: Next, we start to set the updated parameters, you can skip this option when you add or release the final version. However, you usually need to set it to a later version. After the configuration is complete, you can set the version number. For convenience, check the auto-increment option directly. After all the parameters are set, click "Release wizard". In the wizard, we can modify the parameters we just set again, for example, the deployment location, the IIS server address update, and the online status can be used. If no modification is required, click "Next". After the Wizard is complete, click "finish" to generate the deployment file: during deployment, you can view the printed information in the VS output window. The output after successful deployment is "published successfully ":
The hosts file can be installed.