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)