Preface After a long sleep, we completed a program that made us proud. In this case, we have to write the installation program for the work. In the traditional windows programming field, writing the installation program is also a learning. In a classic book: Windows 3.1: A developer's guide, written by Jeffery Richter, an early master of windows, explains how to write an installer. However, in recent years, the use of software components has become a common practice. More and more useful software components or tool programs have been developed one after another, and the installation program (Install Program) this is a representative member. Open the programmer's paradise to see many of these products. Among them, Install Shield is the best among them. In the past, software companies or personal studios had to spend money to purchase a set of Installation Tools unless they wrote their own installation programs. However, due to the fierce competition among compiler manufacturers, most of them will include a set of Installation tool programs for the spring edition, for example, C ++ builder and Visual C ++ are all attached with a set of Installation Tools. Their common choice is install shield. It can be seen that Install Shield has laid the foundation for its stability in the field of installation programs and is used by major vendors. Now I will introduce how to use Install Shield. Install Shield C ++ builder version Install Shield will handle the special requirements of different vendors with the versions provided by the vendor, for example, The Install Shield version provided by C ++ builder adds additional options for borland database engine, SQL link, and RTL (runtime-Library) of C ++ builder. See figure 1. Figure 1 additional options of Install Shield C ++ builder editition. Visual c ++ also provides additional processing for ODBC and Dao. See figure 2. The main objects we will discuss here are the C ++ builder version. However, they are basically the same, so if you have learned this set, you can also master the main parts of other versions, just pay attention to the differences. Start a new project Here, we use the email-bcbmail in this book to describe the setup of the installation program. First, you must start a new installation project. . Figure 3. Open a new project file. After setting the project name and directory path, we can press [Create] to create a new project file. Note that this project file is named iwz. In this example, you will get a project file named bcbmail. iwz. Install Shield After creating a new project file, you can set the information required for the installation program one by one. Figure 4 shows the projects we need to set. The checked items indicate the projects that have already been set, and the projects that have not been checked are the ones that have not yet been set. You do not need to set all projects one by one. You only need to set them as needed. For example, if you do not need to modify the registry, you do not have to set the [make Registry Changes] project. Here I will illustrate it one by one using bcbmail as an example. Take bcbmail as an example because it is not only a complete example, but also uses Borland database engine. Therefore, you can learn a BDE application, precautions when using Install Shield to create an installation program. Figure 4 detailed options of Install Shield. Set the program appearance and Directory First, set the program name, executable file name, version number, and preset program installation directory on the [App info] Page. See Figure 5. Figure 5. Set the program directory and related information. Then, set whether bitmap or text is used as the background. Here, I use text as the background text. You can also use a pattern as the background. However, the version provided in C ++ builder only supports 16 colors, therefore, you cannot use a pattern with more than 16 colors as the background pattern. At the same time, we can also select the background color. In this example, the gradient blue that is most commonly used by everyone is used as the background color of the installer. See Figure 6. Figure 6 sets the text and background color. In addition, we can decide whether to provide the anti-installation program. In this example, I choose to provide automatic anti-installation. See Figure 7. Figure 7 provides the anti-installation program. Set additional options for C ++ Builder Because bcbmail uses Borland Database Engine (BDE) as a tool to store letters, we must install BDE. In this case, we only need to check the BDE option. See Figure 8. Figure 8 configure borland database engine (BDE) In addition, we can also set BDE one by one, so that we can selectively install BDE, just select the necessary File Installation. In this example, because bcbmail uses the Paradox database, we only need to install the Paradox database engine. (Figure 9) If you use an alias (alias), you must set alias to add the alias name to the list. (Figure 9-2 ). Then you can choose whether to set the storage. (3 in Figure 9 ). The last step is to set each alias (alias) one by one ). The attributes of an alias include the database category, path, and necessary parameters used. After the above program is completed, the additional options of C ++ Builder are set. Figure 9 select a Database Engine Figure 9 2 adds an alias (alias ). Figure 9-4 shows the attributes of each alias. Set groups and file elements After setting BDE, we can set various program groups and files. First, you will see the following picture, because we previously specified to use BDE, So in addition to the general program group, there are also three BDE-related files. (Figure 10) Figure 10 set a Program Group Use the archive Administrator To set the program group, you must use the archive administrator to add the archive in drag & Drop mode. In this case, you can run launch explorer to run the archive administrator, then, place the files required by the program into the file list (figure 11 ). Figure 11 use the archive administrator to add the required archive to the list in drag & Drop mode. In addition, you must note that install shield does not automatically add BDE Chinese drivers to the list. Therefore, you must find the BDE location on your computer, then the Chinese driver Fareast. add BLL to the list (figure 12 ). Figure 12 adds a Chinese driver. Set the dialog box for the installer Install Shield can be determined by the user to install the dialog box that appears in the program. You can decide whether or not the dialog box appears. Generally, Install Shield will set the internal value for us. If you do not have any additional settings, you can directly use it (Figure 10 ). Figure 10: whether the dialog box is used Set registry Most programs do not use the registry. However, some programs, such as VxD drivers and BDE, use registry to record parameters. The Install Shield version included in C ++ Builder automatically modifies the registry for BDE, so no additional settings are required. However, if your program uses registry to record parameters, you must set them one by one in Install Shield (figure 14 ). Figure 14 Registry Settings Set folder and icon Setting folders and icons is a required feature of the installer. in windows, we can create a folder for our program and set the icons for each executable file, in this way, the user can find the program in the Start tool column after running the installation program, and then execute it (figure 15 ). Figure 15 configure the program file name and its icon Test Program and mother-piece Manufacturing After completing the above settings, we can test this program first. Install Shield provides a convenient way for us to test the installer directly in the integrated environment, you only need to select testrun directly. Before the test, however, you must submit the previous settings to install shield to generate the master chip. It provides four different master chip types: CD-Rom, 120 MB, 1.44mb, and 1.2mb, you can specify it as needed (figure 16 ). Conclusion After the test on the master chip is correct, you can directly submit the master chip to others for installation or mass production. After reading the above introduction, are you eager to try? Basically, I think Install Shield greatly simplifies the writing of the installation program. From then on, we no longer have to write complicated installation programs, and all the work can be done by Install Shield in the bullet box. Figure 16 specify the parent Disk Type |