Inno Setup entry (11) -- execute some programs after installation

Source: Internet
Author: User

sometimes, although our Program can be installed well, however, the configuration of a program may need to be completed by other programs. If you do not execute these programs, the main program will not be able to complete the work well, or even complete the work, an obvious example is that many programs are currently using net developed by technology, this requires that be installed on the computer.. NET Framework . Otherwise, the main program cannot run. Only the Net Framework before the main program can run. In this case, you can use RUN specifies the program to be executed after the program is installed and before the installation program displays the final dialog box.

Suppose there is a main programIpmsg.exe, The initialization program isInit.exe, The main program must be inInit.exeThis can be done well only after one operation (hereInit.exeIs a file that I randomly find, andIpmsgThere is no necessary link, just for demonstration ):

Defaultdirname = "E: \ test"

Appversion = 1.0

Compression = lzma2/MAX

Showemediagedialog = Yes

 

[Components]

Name: Main; Description :"Main Program(Required) "; Types: Full compact custom; flags: fixed

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

Name: help; Description :"Help File"; Types: Full compact

 

[Files]

;Files 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 aboveCodeGenerated package file, run to the endFinishPreviously, the following screen will appear, and the subsequent installer will be suspended, waitingRunYou can continue to run the program after it is executed.

Smart readers may have thought that this method can also be usedReadme. Here we will talk about the parameters of this section:

Filename:

This parameter is required to indicate the file to be executed or the folder to be opened. IfFilenameNot an executable file(.ExeOr. Com)Or batch files(. BatOr. Cmd), You must useShellexecMark. The code above shows that this parameter can contain constants.

Description:

Only in[Run]. This is the description of the entry and can contain constants. If not specified, the default description will be used.

Parameters:

Optional command line parameters of the program, which can contain constants. For example, some console programs need to pass parameters. This parameter can be used at this time, for example:

Filename: "{app} \ init. EXE"; Description :"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 is started. If this parameter is not specified, useFilenameDirectory in the parameter. IfFilenameThe path is not included. The default directory is used. This parameter can contain constants.

Statusmsg

Only in[Run]. Some programs are invisible during execution (for security or other reasons), but do not want users to think that the installation program has no response, you can use this parameter to specify the messages displayed on the Wizard Page during program execution. If this parameter is not specified but is blank, the default message "the installation is being completed" is used....". This parameter can contain constants. For example:

[Run]

Filename: "{app} \ init. EXE"; Description :"Initialization program"; Statusmsg :"Don't worry. Just wait."

The effect is as follows:

Flags:

This parameter is set as an additional option. Multiple options can be separated by spaces. The following options are supported::

Option

Description

Hidewizard

If this flag is specified, the wizard will hide it during the program running.

Nowait

If this flag is specified, it will process the next[Run]Note: currently or before the installation is completed, you cannotWaituntilidleOrWaituntilterminatedCombined Use

Postinstall

only [run] is valid. Tells the installer to create a selection box on the installation completion Wizard Page. You can select or not to select the selection box to determine whether to process the entry. Previously this tag was called showcheckbox . If the installer has restarted your computer ( A tape restartreplace indicates a file or if [setup] alwaysrestart indicates Yes ) . The Selection box does not appear, so these entries are not processed.

Runhidden

If this flag is specified, it runs the program in a hidden window.

Runmaximized

If this flag is specified, the program or document will be run in the maximum window.

Runminimized

If this flag is specified, the program or document will be run in the minimal window.

Shellexec

If filename is not a direct Executable File (.exe or . com file ) , which is required. When this flag is set, filename can be a folder or any registered file type, when shellexec is not waiting until the Generated Process is terminated. If necessary, you must add the tag waituntilterminated

Skipifdoesntexist

If the tag is[Run]If the file name does not exist, the installer does not display the error message.[Uninstallrun]If the file name does not exist, the uninstaller does not display the warning that "some elements cannot be deleted ".

Skipifnotsilent

Only in[Run]. Tells the installer to skip this entry if the installer is not running in the background.

Skipifsilent

Tells the installer to skip this entry if the installer runs in the background.

Unchecked

 

Tells the installer that the selection box is not selected initially. If you want to process this entry, you can run it in the select box. IfPostinstallFlag is not specified at the same time, this flag is ignored

waituntisponle

if this flag is specified, it waits until the process waits for user input, instead of waiting for Process Termination. ( call waitforinputidle Win32 function. ) cannot match Nowait or waituntilterminted combination

Waituntilterminated

If this flag is specified, it will wait until the process is completely terminated. Note that this is a default action(That is, you do not need to specify this tag.)Unless you useShellexecMark. In this case, if you want to wait, you need to specify this mark. Cannot matchNowaitOrWaituntilidleCombined Use

 

 

From: http://www.360doc.com/content/13/0327/14/4221543_274247804.shtml

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.