Here the author introduces the simplest installation method, which is to use the packaging program that comes with VB for packaging. Although it is relatively common, there are many tricks inside. I believe that not many people know this! ! (Please be sure to watch to the end, the fun is to come) Okay, no more nonsense, let’s get to the point.
①Run the packaging wizard, as shown in the figure below:
②Click the "Browse" button and select the project to be packaged. Then click the "Package" button (only packaging will be introduced here, other functions will not be introduced). Enter the next page, as shown below:
③ Select the type of package to be packaged. For ordinary EXE projects, just select "Standard Installation Package". For controls and the like, it depends on where they are used. If it is used on a web page, please select "Internet Software Package" and then click "Next" " button. As shown below:
④Select the location where the package file is stored (needless to say more about this), as shown in the figure below:
⑤The wizard automatically finds the controls, DLL and other files used in the project. You need to go to the project to check to see if all the files included are complete. You must bring the files of the third-party controls, otherwise you will be in trouble~ ~~, and then click Next, as shown in the figure below:
⑥Select the file type for packaging. If you want to publish using a CD, select a single compressed file. If you want to publish using a floppy disk, select multiple compressed files. (Of course, this is not absolute. You can also select multiple compressed files using a CD, but maybe no one does this~~~). Then click "Next". As shown below:
⑦ Determine the title of the installation program, which is the text displayed on the installation background. Then click "Next" as shown below:
⑧Here you can set which items are displayed in the "Start Menu". For example, you can add and uninstall program items, you can select the "New Item" button, and then enter $(WinPath)/st6unst.exe-n in the "Target" column "$(AppPath)/ST6UNST.LOG", including double quotes. Select "$(WinPath)" in the Start project, without the double quotes. Then click OK, as shown below:
⑨Here you can change the installation location of the folder, and then click "Next", as shown in the figure below:
⑩Here you can set the file to be shared (that is, the file can be used by multiple programs). At this point the installation is complete.
After installation, three files and a folder will be generated, as shown in the figure below:
SERTUP.LST installation information file
The .CAB file package is a data file, and all the installed files are in the package.
Setup.exe is the main file of the installation.
Support are all files included in the compressed package. As shown below:
One of the more important files in this folder is the batch file "License Template.BAT" (the file name will be different for different projects). After your project is changed, you can recompile the project, and then Copy the executable file to this SUPPORT directory, execute this batch file, and you can repackage without running the packaging wizard every time you make changes.
Another important file is the SETUP1.EXE file. It is the main file of the installation. The interface we see during installation is generated by running this file. It is written in VB. The source program is in the VB installation directory: "C:/PRogramFiles/MicrosoftVisualStudio/VB98/Wizards/PDWizard/Setup1/SETUP1.VBP". You can use VB to compile it directly. Edit this project (VB’s installation interface is too ugly, so you can change it yourself. How you change it depends on your own ability~~~). If you want to add a shortcut to the program on the desktop after installation, You can compile this project, open the "frmSetup1" window, and add the following code at line 463 of its code:
DimsProgramsPathAsString
DimsDesktopPathAsString
sProgramsPath=GetSpecialFolder(sfidPROGRAMS)
sDesktopPath=GetSpecialFolder(sfidDESKTOP)
sProgramsPath=sProgramsPath&"/"&gstrAppName&"/"&gstrAppName&".lnk"
sDesktopPath=sDesktopPath&"/"&gstrAppName&".lnk"
FileCopysProgramsPath,sDesktopPath
The following is an introduction to the SERTUP.LST (installation information file) generated by the wizard, as shown in the figure below:
This is the content of the first area of the file. SetupTitle sets the title of the decompression window, and SetupText sets the content of the decompression window. After the change, it looks like the picture below:
Next, we will introduce the role of the Setup area of the SERTUP.LST file, as shown in the following figure:
Changing Color to a different value can change the background color of the installation window (the default is blue, which is boring to see). Change it to green after 16 (of course there are other colors, you can try it yourself~~~), the effect is as shown in the picture below (this is the installation interface of the VB built-in installer after I changed it, what do you think? In this way, is it not inferior to the interface of some other installation software?):
Okay, that’s it for introducing the installation program. Of course, the VB installation program is completely made by VB itself. How to change it and whether it is beautiful or not depends on your own level and art skills. Anyway, the installation program The source code is given to you, you can do whatever you want! ->