A complete InstallShield installer instance-goddess of the sea of azelas (5)-Addendum (complete Part 3)

Source: Internet
Author: User
Tags strfind
ArticleDirectory
    • Part 4: Addendum

Previous Article: a complete installer instance-goddess of the sea of azelas (4)-Advanced Settings 2

Make sure to keep the source and words produced by the goddess of the sea of azelas. If you want to publish them, contact the author. Little_fairycat@126.com.

Part 3: Others
1. Modify the style of the display interface
I always find the original installation interface of InstallShield ugly. Fortunately, installscript does not need to be written.CodeYou can change the interface style.
Find User Interface | dialogs in the left navigation tree of installation designer


Find dialogs | skins in the navigation tree in the middle.


The skins option shows different interface styles. The default value is none. Select a preferred style. I generally use blue or bluetc, which is applicable to the stability of general commercial software.
Heavy style; Midnight is cool, if it is used for computer game InstallationProgramI will definitely choose this style.
2. Compile and Package
After everything is ready, a compilation and packaging process will be worse.
Compile
You can use the tool bar to check for definition errors and compilation errors.
Package
You can use the tool bar for packaging.
1. Step 1: specify a package configuration version. If you use the same installer source to package different configurations, you can select a new configuration version. The configuration here refers
Is the configuration of the installer itself, including whether to compress the file, package it into a network installer or a CD installer, the client information of the installer, and whether it is encrypted.

2. Multiple versions are allowed under the same configuration. Generally, I am used to package a new version when installing the source file upgrade to show the difference. At the same time, I can retain the old version.
The version of the installer is not available for a while.

3. I have never used filter settings. It seems that it is a set parameter for feature, which is probably for some versions. If some feature does not need it, it will be filtered out directly.
You cannot choose to install it during installation. However, I have not used specific parameter settings, including the following language filtering. But recall some of the previously installed Large
For software such as Oracle, some options are gray and cannot be installed, which is similar to this function.

4. The language of the installer is not necessarily related to the language of the installed application. Therefore, you need to set the language used for installation. Select the language displayed in the list
It depends on the language selected during installation. Just now we only chose English, so only English is displayed here. If multiple languages are selected
The first interface is a very intelligent interface that allows you to select the language used for installation. This function is very useful for software that needs to be released to multiple language countries. No
In this case, when writing a script, as long as the language is displayed on the interface, in addition to what the system can display by default, you need to add a language to judge and display different
Content.

5. Select the media type, the author will burn the installation program to the CD, so select CD-ROM

 

6. The optical disc option. The first option, "automatic", will automatically detect the number of required optical disc specifications and create a breakpoint between the optical discs. I usually select the first item to avoid
A lot of worships, the second option should be selected by high talents.

7. This option specifies the packaging format:
Compress all files: All files are compressed and packaged (this does not include the files copied from the external during installation in the script, which are only included in the Project Assistant
To files under each feature)
Leave files uncompressed and separate from the installation package: All files are not packaged and exist in the original form.
Custom: customization. You can specify a part of the compression package and a part of the package.
I like to package all my files. It looks clean and professional.

8. The operating system requirements are generally set by default.

9. This is a Windows Installation engine, which has not been studied. With the above explanation, I chose the second one, which will help you package it into the installation program, so that you don't have to worry about it.

10. signature. It is unavailable currently. If you are interested, you can import the digital signature file.


11. Password and copyright notice. Forget the password. A commercial software shouldn't be set up like this, and the customer will die.

12. whether to include the. NET Framework. InstallShield seems to be in harmony with Microsoft.

13. The location of the compiled file and some related settings. We recommend that you select the long file name option to avoid unnecessary problems caused by too deep paths.

14. In the last step, the previously configured settings are displayed. Click "finish" to compile an installer.

15. The compiled installer file should be in the project path \ My project name \ product configuration x \ release x \ diskimages \ disk1

Click setup.exe to install it.
By the way, although the installation program has been prepared, if it is so bare to the customer, the customer wants to lose the impression of the product. You can use flash or its
His professional CD-making software is used to create a beautiful application interface for customers. A beautiful user interface is automatically displayed when the disc is inserted.
It is also convenient to use.

 

Part 4: Addendum

This addendum is 《A complete installer instance-Goddess of the sea of azelas"APPEND description, after the installation program is installed, it finds some minor problems when the application is running. It solves the problem by passing parameters in the installation program and setting environment variables, it has nothing to do with the installer itself.

After this program is completed, the project enters the final debugging stage. Two problems are found in the project, which are not related to the installation program, but can be solved by the installation program, which is recorded here, in case of such problems, you can check them later.

1. java_home Problems

As mentioned in the ninth section of the second section, after the installation is complete, set an environment variable for JDK. In fact, this document is written here in a wrong order, this environment variable is required for the program to be started after the installation in section 8 of the second part, so it was found during debugging, the program content in section 8 is changed to the program content in section 9.

However, a new problem was quickly discovered. Adding environment variables in the registry is different from adding environment variables directly in my computer on the desktop. Operations in the registry, you need to restart the computer to make it take effect, so the conflict arises: When this program is started, the environment variable has not yet taken effect; if you set to re-start the computer, it is very unfriendly to have the customer manually start the program.

So here we have modified the method. First, we need to start the program, that is, a batch processing file.

Set java_home = % java_home %

This sentence is changed

Set java_home = % 1

When you need to receive parameters from external sources in batch processing, you can write the parameters as % 1, % 2... % N.

Then, based on the Program in section 8

If (launchapp (servicetarget, "") <0) then

Modify this sentence

If (launchapp (servicetarget, javahome) <0) then

You can.

2. Code explanation

Javahome is the svvalue in the sentence if (regdbsetkeyvalueex (szkey, "java_home", regdb_string, svvalue,-1) <0) then in section 9, that is, the JDK installation path.

Launchapp (servicetarget, javahome)

I can't help but admire the is function designer. In this document, the launchapp function is used in three places, and each usage is different.

Parameter 1: Enter the file we want to open, with the relative path

Parameter 2: cmd_line. Here, we write the JDK path. This value will be passed as a parameter to the batch file to be opened. After receiving the JDK path for the batch processing, you can start it correctly.

3. Path Problems

This problem is actually related to javaserive and the operating system, because it has not been found on the author's computer.

As mentioned in section 8 of the second part, we will install a service on windows, but the service cannot be started on the computer used in the project. This debugging task is pushed to the manager, after many experiments, he found that it was a path problem in the environment variable. As long as the binfile path of JRE is added to the path, this service can be started correctly. I didn't have a deep understanding of the operating mechanism of javaserive and the operating mechanism of Windows Services, and I didn't have a deep understanding of why. I guess this path may be required for this service, some operating systems only need to specify java_home to search for jre, but some do not.

We need to write a program to implement this function.

Note the following points:

L path often exists and contains content. Therefore, you cannot add a JRE path to the existing content, just like setting java_home. You must also consider the semicolon between the content.

L The path cannot be detached considering the uninstall status. Speaking of this question, I would like to mention the ninth section above and find that the author of the citation still does not understand whether to uninstall the registry key value added by myself during uninstallation, the regdbsetkeyvalueex statement however in help, the newly created key is not logged for uninstallation unless it is a subkey of a key already logged for uninstallation. that is, the newly created key value is not recorded in the log and needs to be unmounted, unless it has a subkey value recorded in the log and needs to be detached.

The program content is still added to onend () and written at the end, as follows:

Szkey = "Software \ javasoft \ Java Runtime Environment \ 1.6.0 _ 04"; // JRE key

Regdbsetdefaultroot (HKEY_LOCAL_MACHINE); // you can specify the root key.

If (regdbkeyexist (szkey) = 1) Then // if this key exists

If (regdbgetkeyvalueex (szkey, "javahome", nvtype, svvalue, nvsize) = 0) Then // find the value of this key

Javapath = svvalue;

Endif;

Endif;

************************************ Part 1, the second part is as follows:

// Wirte the environment variable path

Szkey = "System \ CurrentControlSet \ Control \ Session Manager \ environment"; // location of the environment variable in the Registry

Javapath = javapath + "\ bin"; // path of JRE \ bin

If (regdbgetkeyvalueex (szkey, "path", nvtype, svvalue, nvsize) = 0) Then // if the path exists

If (svvalue! = "") Then

If (strfind (svvalue, javapath) <0) Then // if the path does not have JRE \ bin path information

Svvalue = svvalue + ";" + javapath; // Add path information with a semicolon

Endif;

Else

Svvalue = javapath; // if the key value is null, you can directly add it. In fact, if the key value is null, this statement is useless.

Endif;

Else

Svvalue = javapath; // if this key value is not available, add the value directly. In fact, this does not happen because path exists after the operating system is installed, // unless you manually delete the file, the operating system may be faulty.

Endif;

If (! Maintenance) then

Disable (logging );

If (regdbsetkeyvalueex (szkey, "path", regdb_string_expand, svvalue,-1) <0) Then // Add or reset the key value

MessageBox ("path create failed, please set it manually! ", Severe );

Endif;

Enable (logging );

Endif;

4. Code explanation

The purpose of the first part is to find the installation path of JRE. All functions have been explained before and will not be repeated.

Part 2:

Szkey = "System \ CurrentControlSet \ Control \ Session Manager \ environment ";

Environment variable, which is located in the Registry

**************************************** *********************************

Javapath = javapath + "\ bin ";

You need to find the binfile under JRE.

**************************************** *********************************

If (regdbgetkeyvalueex (szkey, "path", nvtype, svvalue, nvsize) = 0) then

If path exists and a value is returned.

In fact, if you add a key to determine whether the key exists, the code will be more complete, but this key must exist after the operating system is installed. I am lazy here.

**************************************** *********************************

If (strfind (svvalue, javapath) <0) then

Determines whether the returned key value contains the bin folder path of JRE.

Strfind (szstring, strfineme)

Find whether the specified string is contained in the source string

Parameter 1: szstring, the source string to be searched

Parameter 2: strfineme, the string to be searched

If the string to be searched is included, the position of the string to be searched in the source string is returned. If the string cannot be found, a random number smaller than 0 is returned.

**************************************** *********************************

If (! Maintenance) then

Determine the installation status so that it only works in non-maintenance (modification, Reinstallation, and uninstallation) status.

**************************************** *********************************

Disable (logging );

Enable (logging );

These two statements are used to stop logging and make logging take effect again. They are copied from an online article. When logging stops, the installer ignores all the operations after the log is stopped, so that the key value is not operated during the reverse installation. In fact, the above sentence if (! Maintenance) Then (Operation in non-maintenance state) is not added in the original article. The author said that this operation will not be uninstalled as long as logs are not recorded in the Operation registry, however, it seems that I have tried it for a while. I can add a sentence, which is more secure. At least it is okay to test it.

**************************************** *********************************

If (regdbsetkeyvalueex (szkey, "path", regdb_string _ expand, svvalue,-1) <0)

Write the key value of the registry.

In help, the corresponding help of regdbsetkeyvalueex contains the following sentence: If the value data already exists, regdbsetkeyvalueexoverwrites it, that is, if the key value exists, it will be overwritten. However, after registry operations, the computer must be restarted to take effect. This is different from operating environment variables directly on my computer.

Here, the third parameter is changedRegdb_string _ expandIn Windows 2003server, the path contains a relative path of % SystemRoot %. At that time, regdb_string was used at the beginning, and it was accidentally found that all DOS commands were useless, enter the path in DOS and check that the place where the path is replaced with the absolute path is not replaced. At that time, it was also difficult, someone warned me that I should check the type of the key value setting in the is program. When I run it back, I see that the setting is incorrect. regdb_string does not know the relative path, change to regdb_string _ expand.

5. File Read-Only

A problem occurs when you use a light disk to install a program. When a file is copied from a CD, the file is in read-only format by default. As a result, the configuration file cannot store database information normally, after copying the file in the installer code, specify the file attributes.

Setfileinfo (szpathfile, ntype, nattribute, szvalue );

Used as setfileinfo (szpathfile, file_attribute, file_attr_normal ,"");

Next article: answers to some frequently asked questions in InstallShield-produced by the goddess of the sea of azelas

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.