Inno Setup Primer (11)--Perform certain programs after installation

Source: Internet
Author: User
Tags compact

Sometimes our program can be very good to complete the installation, but the configuration of the program may require other programs to assist the completion, if not execute these programs, the main program can not do a good job, or even do not complete the work, a very obvious example is that many programs are currently developed through NET technology, This requires that the. NET Framework must be installed on the computer, otherwise the main program will not run, and only the NET Framework Master program can be installed beforehand. At this point, you can specify the program to be executed after the installation, and before the installer displays the final dialog box, through the Run section.

Imagine a main program for Ipmsg.exe, the initialization program for the Init.exe, the main program must be run in the Init.exe after running well, this time can do this (here Init.exe is my random file, and ipmsg no inevitable contact, just to demonstrate):

Defaultdirname= "E:\TEST"

appversion=1.0

Compression=lzma2/max

Showlanguagedialog=yes

[Components]

Name:main; Description: "Main program (required)"; Types:full Compact Custom; Flags:fixed

Name:data; Description: "Data File"; Types:full

Name:help;description: "Help file"; Types:full Compact

[Files]

A file that needs to be packaged

Source: "F:\desktop\test\ipmsg.exe"; DestDir: "{app}"; Components:main

Source: "F:\desktop\test\init.exe"; DestDir: "{app}"; Components:main

Source: "F:\desktop\test\bin.dat"; DestDir: "{app}"; Components:data

Source: "F:\desktop\test\help.chm"; DestDir: "{app}"; Components:help

Source: "F:\desktop\test\readme.txt"; DestDir: "{app}"; components:help; Flags:isreadme

[Run]

Filename: "{app}\init. EXE ";

Test the package file generated by the above code, run until the final finish, the following screen will appear, the following installation program will be suspended, waiting for the program under the Run section to complete before you can continue to run.

Smart readers may have thought that using this method can also implement the functionality of the README. Let's talk about each of the parameters of the paragraph here:

Filename:

This parameter is required to describe the file that needs to be executed, or the folder that needs to be opened. If filename is not an executable file (. exe or. com) or a batch file (. bat or. cmd), you must use the shellexec tag in the entry, as shown in the above code, which can contain constants.

Description:

Valid only in the [Run] segment. This is the description of the entry, which can contain constants, and if not specified, the default description will be used

Parameters:

The optional command-line arguments for the program, which can contain constants such as some console programs that need to pass parameters, can be used at this time, as shown in the following example:

Filename: "{app}\init. EXE ";D escription:" Initialization program "; Parameters: "/t"

Note: If your program does not accept parameters, the passed parameters will be ignored.

Workingdir

The directory in which the program starts. If this parameter is not specified, the directory in the filename parameter is used. If filename does not contain a path, it uses the default directory. This parameter can contain constants.

Statusmsg

Valid only in the [Run] segment. Because some programs are invisible during execution (for security or other reasons) but do not want the user to think that the installer is not responding, you can specify the message that appears on the wizard page when the program executes, and if the parameter is not specified but blank, the default message "Completing the installation ..." will be used. This parameter can contain constants. For example, the following example:

[Run]

Filename: "{app}\init. EXE ";D escription:" Initialization program "; Statusmsg: "Don't worry, just wait a minute."

The effect is as follows:

Flags:

This parameter is an additional option setting. Multiple options can be separated with spaces. The following options are supported:

Options

Description

Hidewizard

If this tag is specified, the wizard will hide it during program run

NoWait

If this flag is specified, it will not wait for the process to complete before processing the next [Run] bar currently or before completing the installation, and cannot be used in combination with Waituntilidle or waituntilterminated

Postinstall

Valid only in the [Run] segment. Tells the installer to create a selection box on the Installation Completion Wizard page, and the user can select or uncheck this box to decide whether to process the entry. This tag was previously called ShowCheckBox. If the installer has restarted the user's computer (a file with the Restartreplace tag is installed or if the [Setup] section's alwaysrestart indicates Yes), the selection box does not appear, so the entries are not processed.

Runhidden

If this tag is specified, it will run the program in a hidden window.

Runmaximized

If this tag is specified, the program or document will be run in the maximized window

Runminimized

If this tag is specified, the program or document is run in a minimized window.

Shellexec

If filename is not a direct executable file (. exe or. com file), this token is required. When this tag is set, filename can be a folder or any registered file type, and when the shellexec tag is used, it will not wait until the resulting process terminates, and if it does, the tag must be added waituntilterminated

Skipifdoesntexist

If the tag is specified in the [Run] segment, the installer does not display an error message if the file name does not exist, and if the tag is specified in the [Uninstallrun] segment, the uninstaller does not display "some elements cannot be deleted" warning if the file name does not exist

Skipifnotsilent

Valid only in the [Run] segment. Tells the installer to skip this entry if the Setup program is not running in the background

Skipifsilent

Tells the installer to skip this entry if the installer is running in the background

Unchecked

Tells the installer to initially uncheck the Select box. If the user wishes to work with this entry, it can be executed by selecting the selection box, which is ignored if the postinstall tag is not specified at the same time.

Waituntilidle

If this flag is specified, it waits until the process waits for the user to enter, rather than waiting for the process to terminate. (Call the WaitForInputIdle Win32 function.) ) cannot be used in combination with nowait or waituntilterminted

waituntilterminated

If this flag is specified, it waits until the process is completely terminated. Note that this is a default action (i.e. you do not need to specify this tag) unless you are using the shellexec tag, in which case you need to specify this tag if you want to wait. cannot be used in combination with nowait or waituntilidle

Inno Setup Primer (11)--Perform certain programs after installation

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.