How do I do the installation package? First, you need to clarify what the installation is?
Remember to read the description from the ocean goddess's blog: "The essence of installation is copying ".
Yes, installation is replication, and the environment for your development and debugging andCodeCopy to the target machine. Of course, this copy is not as simple as copying the code component compiled by IDE to the target machine, but it is similar in general. The copy here requires the following content:
- Copy the generated module to the target machine.
- Copy the referenced module to the target machine,
- Copy related configurations to the target machine
The installation package completes copying the content to the target machine.Program.
After learning about the essence of installation, let's get into the whole. How can we use InstallShield to package the application and create your own installation package.
First, we need to download and install InstallShield. Here we select the 2010premier version. Different versions may have different restrictions.
When you open InstallShield for the first time, you will find that it is somewhat similar to the IDE that our developers often use.
- First, create a project.
InstallShield supports many different types of projects.
-
- Installscript Project
- Basic MSI Project
Here, we will refer to Kevin Wang's introduction to these two types of projects:
The installscript script language is easy to learn.
-
- In this project type, you can display full-screen ad boards (background images ).
- This type of project uses the installscript script language to allow you to write programs to control the installation process, rather than entering some table data.
- The installscript type project is easier to learn than the basic MSI type project. The learning curve of the installscript project is much shorter than that of the basic MSI project.
- Installscript allows you to perform your own operations before or after installation. You can use the event-driven model, which is very useful for Windows development.
- If you are maintaining an installscript project, you can only select the installscript project type.
- The installscript project does not use Windows Installer, so your installer cannot perform logo authentication for Windows Vista and Windows 7.
The basic MSI project is installed using the Windows Installer Service. The following describes the reasons for choosing the basic MSI project:
-
- Your installation program requires logo authentication for Windows Vista and Windows 7. This is also one of the main requirements for using Windows installer.
- You don't want to use scripting to control your installation process.
- You have to select basic MSI for basic MSI project maintenance.
- You want to maximize compatibility with Microsoft SMS management tools.
- Learning the basic MSI project requires a longer learning curve.
To put it simply
-
- Installscript needs to schedule the installation process by writing installscript, so this project is easy to control, but the corresponding coding workload is relatively large, however, as long as you have mastered installscript, you can basically master the installation package creation for this type of project.
- The Windows Installer Driver runs the basic MSI installation process step by step. relatively speaking, the basic MSI project has the advantage that the interface can be borrowed out of the box and needs to be encoded in the process to be controlled, however, because the project is driven by a Windows Installer, you need to understand some Windows Installer knowledge, and have a corresponding understanding of the MSI principle to better master the development of the installation package based on the Basic MSI project.
After understanding the basic principle of the project type provided by InstallShield, let's start to practice it. here we will use the project type of basic MSI for demonstration.
1. Basic installation operations
First, set the content to be installed. Which programs need to be released to the target machine?
Here we will demonstrate how to release a TXT file. The application only needs to publish the referenced module to the target machine at the same time.
Next, we need to create an InstallShield project. Here we select basic MSI project.
Enter Basic Information
Follow the wizard step by step
Add release content
If you do not need any custom operations, you do not need to write any installshieldscript.
2. Add custom control
First, you need to add a script. Here we will write a simple hello MSI pop-up window.
Select installscript on the designer tab.
Right-click files on the right to add a script file.
Add the following script
Export prototype myfunction (hwnd); // if this function needs to be called directly for event processing, it must be declared and the parameter must be hwnd
// The following statement is required for an internal call:
//////////////////////////////////////// /////////////
Function myfunction (hmsi) // The hwnd in the corresponding declaration is used to mark the handle of MSI
// To do: declare local variables.
String szmsg; // local variable Declaration
Begin
// To do: write script that will be executed when myfunction is called.
Szmsg = "This will install example program .";
MessageBox (szmsg, information );
End;
Bind the script to event processing
Select the customer action Column
Right-click "customer actions" on the right, and the wizard will pop up.
Enter name remarks
Select installscript type
Select the added Function
All the way to next, the name you added will be displayed in customer actions
Right-click User Interface-> installwelcome, right-click Edit behavior (edit event processing), edit layout (edit appearance), and select Edit Behavior
Select next Pushbutton
Add a new action in the list box on the right:
Event |
Doaction |
Argument |
Select the custom name under customer actions |
Condition |
Select 1 (always execute) |
Compile and click test user interface to test the operation.
On the welcome page, click "This will install example program ."
3. Release
Select build project to complete release
OK. The installation package PROCESS OF THE InstallShield installation package is described here. For more information, see the following documents.
References
Stefan Krueger http://msmvps.com/blogs/installsite/default.aspx
Rod Maupin http://www.installationdeveloper.com/
Goddess of the Sea http://www.cnblogs.com/Cindy_weiwei
Yiting http://www.cnblogs.com/sabrinahuang/
Kevin Wang http://www.cnblogs.com/installshield/archive/2010/06/25/1765043.html
Source Document
Install Shield User Manual