Inno Setup: Notes for installation and production of. net programs

Source: Internet
Author: User
Tags constant definition

Recently downloaded and used the latest Inno Setup 5.5.3 as. netProgramMake the installation program and pay attention to it.

Directory

    • The program name is correctly defined.
    • Correction of installation information
    • Supports multi-language. Net VERSION Query
    • Download Sample ISS File

 

Returned directory
The program name is correctly defined.

The first is the definition of myappname constant (that is, the program name definition in the Inno Setup Wizard). Its value should be defined: "[company name] [program name] [version]", although the Inno Setup Wizard contains values of the company name and version, however, these values will not be automatically combined with the program names in the Wizard. Only the program names will appear separately as the installer title. The company name and version may only be displayed as the installer information in the control panel Add/delete programs.

 

 

Returned directory
Correction of installation information

After you use the Inno Setup default Wizard to create and execute the installation program, you will find that the installation program in the add and delete program in the control panel is similar to this:

 

There are several problems:

    1. No main program icon.
    2. Incorrect display name (this may be an error in the Inno Setup installation language file? I have not tested other languages ).
    3. All link information is the company website in the Wizard.

 

The solution is as follows. For the main program icon problem, you need to set the uninstalldisplayicon attribute in the [setup] block and set the value of this attribute to the application main program. Use {app} to reference the installation directory of the application. At the same time, the myappexename In the Inno Setup Wizard defines the file name of the main program. Set the uninstalldisplayicon in the [setup] block as follows:

Uninstalldisplayicon = {app }\{# myappexename}

 

Next is the name of the installer, which is similar to the uninstalldisplayicon attribute. It is also in the [setup] block. You need to set another attribute called uninstalldisplayname. Here you can directly use the myappname constant definition generated by the wizard. Therefore, add the following to the [setup] Block:

Uninstalldisplayname ={# myappname}

 

Finally, set the network link. Note that the wizard has set all the three network links as myappurl constants, as shown below:

Apppublisherurl ={# myappurl}

Appsupporturl = {# myappurl}

Appupdatesurl = {# myappurl}

So if you want to modify it, You can directly modify the above value.

 

After everything is done, install the program again, and the result will be much better, such:

 

 

Returned directory
Supports multi-language. Net VERSION Query

The title is "Create. Net installer". In fact, this topic is related to. net programs. To deploy the. NET installer, if you find that the required. NET Framework is not installed, you can be reminded that the installation of. NET is always better. net. Next we will start to implement this function. Note that this "multi-language support" refers to languages that support multiple installers, and. net Framework language is irrelevant because.. NET Framework language is not affected.. Net program.

 

Here, I will take the installation program that supports Chinese and English and requires. Net 4.5 as an example.

The result of our implementation is what we need when the user system is not installed.. Net 4.5, the installer prompts the user to install it based on the language selected by the user. net Framework 4.5 (of course, you can choose to continue the installation), the effect is as follows:

 

When you select Yes, the. NET Framework 4.5 download page in the corresponding language will pop up.

 

The specific implementation steps are as follows:

First, you have to judge the. NET version through Inno Setup. We will use a function called isdotnetdetected, which is defined from here (http://www.kynosarges.org/DotNetVersion.html ).

 

Next, define the specific language resources, including the prompts that the user has not installed. Net and the download link of the. NET Framework in the corresponding language.

Define language resources in the [mmmmessags] block. Note that the language identifier should match the name in the [languages] block. For example, the [languages] block is defined as follows:

[Ages]

Name: "en"; messagesfile: "compiler: Default. isl"

Name: "CS"; messagesfile: "compiler: Ages \ chinesesimplified. isl"

 

The resource must be defined as follows: The name attribute of the language is in the front, the period (.) is in the middle, the name of the resource is in the back, the equal sign (=) is in the middle, and the value of the resource is in the end.

The following is the definition of my [mmmmessages] Block:

[Mmmmessages]

En. DOTNET = this application requires Microsoft. net Framework 4.5, which may not be installed on your system. % nwowould you like to go to the download page now and exit setup or continue setup (the application may not run successfully )?

CS. DOTNET = Microsoft. NET Framework 4.5 is required for the program to run. This component may not be installed on your system. % N do you want to go to the download page and exit installation or continue installation (the application may fail to run )?

En. Link = http://www.microsoft.com/en-us/download/details.aspx? Id = 30653

En. Link = http://www.microsoft.com/zh-cn/download/details.aspx? Id = 30653

 

Finally, add the judgment. Net version to the initializesetup event function in the [Code] block, and the pop-up dialog box to display the download page logic.

Initializesetup Function DefinitionCode:

Function initializesetup (): Boolean;

VaR

Err: integer;

Begin

If (not isdotnetdetected ('v4. 5', 0) then begin

If msgbox (expandconstant ('{CM: DOTNET}'), mbconfirmation, mb_yesno) = idyes then begin

Shellexecasoriginaluser ('open', expandconstant ('{CM: link}'), '','', sw_show, ewnowait, err );

Result: = false;

End else

Result: = true;

End else

Result: = true;

End;

 

Note: Use expandconstant to reference the language resources defined in [custommessages.

 

Returned directory
Download Sample ISS File

Sample ISS File Download
Download Page
Note: the link is the Microsoft SkyDrive page. When downloading, use a browser to download it directly. Some download tools may not be available for downloading.
Environment: test environment 5.5.3.

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.