Usually, the projects we publish using Unity are composed of .exe executable files and Data folders. Although they can be used outside the development environment, when we want to share them with others, we always feel that the entire project lacks the steps of software installation. incomplete. This article will teach you how to use the NSIS tool to make the project released by Unity as an installation package.
1. Install NSIS
First, let’s introduce NSIS (from Baidu Encyclopedia): NSIS (Nullsoft Scriptable Install System) is an open source installer program for Windows systems . It provides functions such as installation , uninstallation , system settings , and file decompression .
1. Install NSIS
Here I downloaded version 3.0.8, added the NSIS installation directory to the system environment variable, after the installation is complete, cd to the NSIS installation path in the terminal, and use the makensis command to test, the display is as follows:
2. Install HM NIS EDIT
HM NIS EDIT is a free NSIS script editor, here I downloaded version 2.0.3.
2. Create a new NSIS script
1. Open HM NIS EDIT, select File - New Script: Wizard
2. Fill in the basic information of the program, if there is no program website, you can leave it blank
3. Set the installer language to SimpChinese, and the default is English. The rest can be defaulted
4. If there is no authorization document, it is optional
5. Specify the application file
Click the boxed button in the figure to add the folder to be packaged.
Select the folder where Unity publishes the project
Contains all sub-files in the folder.
6. Set the start menu folder name and shortcut (default)
7. Set the exe program to run after the installer
8. Set the uninstaller (default)
9. Save the script
3. Complete the installation package
1. Compile and run the script
Click the two tools selected in the box below in turn to compile the script first and then run it; you can also directly click the second tool to compile and run it.
If "Win32 Error, Code:740. The requested operation needs to be elevated" appears, you can use administrator privileges to open HM NIS EDIT to recompile and run.