Visual Studio 2015 applications are packaged as installers

Visual Studio 2015 applications are packaged as installers

1. Download Microsoft Visual Studio 2015 Installer Projects, the software tries VS2015 packaged components, and generally will not be installed together when installing VS2015; so it needs to be installed separately; close all VS-related application software during installation;

2. After the installation is complete, open Visual Studio 2015. Similar to creating a project normally, a
dialog box pops up in File-"New-"Project:
insert image description here
Create a "Setup Project" project according to the steps shown in the figure above, and modify the storage directory location required by the project; Click OK to get the project interface shown in the figure below;

insert image description here
There are three folders in the project:
Application Folder: used to store all the files contained in the application to be packaged;
User s Desktop:安装后放于桌面的文件; Users Programs Menu: files displayed on the "Start Menu" after installation;

3. Add files

(1) Add source files
Right-click the "Application Folder" after selecting it - "Add-" file; then find all the files compiled and generated before, and add all the files required by the application in this way.
insert image description here
(2) Create shortcut key
Find the running file ".exe" file, right-click -> "Create Shortcut xxx.exe"; then you will get a "Shortcut to xxx.exe" file; you can right-click to rename and change the name.
insert image description here
(3) Cut the shortcut key of "xxx.exe", and then paste it under "User`s Desktop"; related properties, such as icons, can be selected and applied, right-click - "Properties, and modify in the property bar. Check the online information for specific operations.

(4) Add uninstall program
Similarly, select "Application Folder", right-click->Add->File, find the file in the directory "C:\Windows\System32\msiexec.exe"; create a shortcut key, and then cut it to "" User`s Programs Menu"", which can be renamed if necessary.
Since the uninstaller comes with the computer, you only need to pass the parameters of the program application to the uninstaller;

Select the solution project with the mouse, check the "Product Code" in the properties on the right, and copy all the serial numbers.
insert image description here
Then go to "User`s Programs Menu" and select the shortcut key of the uninstaller that was pasted earlier. In "Arguments" in the property bar on the right, paste the serial number you just copied and add "/x" in front; Remember that a space is required after the "/x", and the serial number is only concatenated afterwards.
insert image description here

4. Other configurations
If you need more comprehensive functions during the installation process, you can add the required functions in the right-click of the project -> View, including interface, registry, startup conditions, and other related settings. For details, please check other information online.
insert image description here
5. The default installation path
Select "Application Folder", the "DefaultLocation" in the property bar on the right can modify the default installation path, you can add and modify it yourself;
insert image description here
6. The setting system is equipped
in the general application running framework, which will depend on ". NET Framework" version environment, so before ensuring the normal operation of the program, it is necessary to ensure that the computer is installed with the specified version or above of the dependency ". NET Framework", so when installing the software, you can detect whether the system has been installed, if not, then Can be installed automatically. The above functions can be completed by setting the properties of the installation package; select the project application->right-click->properties->Prerequisites, then check "Create an installer for installing system prerequisites", and use the corresponding ". net Framework" version, and then select "Download system prerequisites from the component supplier's website", and click OK;
insert image description here
insert image description here
insert image description here
7. Generate the packaged and installed executable file and
select the project - "Right click - "Regenerate; in the corresponding project You can see two files in the Debug or Release directory under the directory, "xxx.exe" and "xxx.msi";
"xxx.exe": is a complete installation software, including the configuration of computer components that need to be detected during the installation process (if set);
"xxx.msi": pure installation application (without environment detection), even if the version that depends on ".net Framework" is set to detect when packaging, if this installation is used, it will not be detected;

The above is a summary of the individual in the process of learning and using packaging. If there is anything unclear, welcome to communicate.
Reprint and indicate the source.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324492382&siteId=291194637