Innosetup distinguish between normal and silent installation states (by passing parameters)

Source: Internet
Author: User

The command line runs the program, such as:

MYPROGRAM.EXE/ABC/BCD

If we want to get the parameters, "/abc", "/bcd"

1. Direct use of the Innosetup method, Getcmdtail ()

Returns all parameters as a string, both for installation and for uninstallation

Note : If you intend to use this method, it is recommended to first look at the format of the returned string, as in the example above,

The return is more than just:/ABC/BCD

2. Use the Innosetup ParamCount () and PARAMSTR () 2.1. ParamCount (), gets the number of arguments 2.2. PARAMSTR (), returns a parameter according to the index of the parameter

Example: test.exe/name abc/age

1 {returns the parameter value according to the parameter name}2 functionGetmyparam (pname:string): String;3 var4 cmdline:string;5cmdlinelen:integer;//Number of parameters6 I:integer;7 begin8cmdlinelen:=ParamCount ();9      fori:=0  toCmdlinelen DoTen     begin Onecmdline:=paramstr (i); A     ifCmdline= PName Then -       begin -Cmdline:=paramstr (i+1); theResult: =CmdLine; - Exit; -       End; -     End; +  - End;
View Code

The Getmyparam (' name ') result is: ABC

Summary : Because Innosetup is silently installed, you need to pass parameters behind the program, so you can determine whether to install silently by getting the parameters

Innosetup Silent installation Parameters Please refer to: http://www.cnblogs.com/tommy-huang/p/4580424.html

Innosetup distinguish between normal and silent installation states (by passing parameters)

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.