Setup.exe piggy-back arguments
InstallMate's Setup.exe recognizes additional command line arguments that are embedded in the distribution package. The extra arguments must come at the very end of the distribution package. They must start with <| and end with |>. Between these delimiters, the normal rules for command line arguments hold. In particular, you must quote any arguments that contain spaces, and use one or more spaces to separate arguments.
Warning: Appending command line arguments to the distribution package will invalidate the digital signature of that package, if you did add a digital signature.
The extra arguments can include any InstallMate command line arguments. Some of the more useful are:
- /q - Run quiet
- /b0 - Don't reboot
- name=value - Assign a new value to symbolic variable name
Some examples:
- <|INSTALLDIR=C:\Temp|>
- <|/q2 "INSTALLDIR=C:\Program Files\MyStuff"|>
Example (b) shows that arguments must be quoted in their entirety, if they are quoted at all.
To append the arguments to your setup package, you can use several methods.
Copy command
Create a text file with the options, then use the MS-DOS COPY command to add them to the end of the package:
copy /b yoursetup.exe+params.txt customsetup.exe
Note: Make sure that the params.txt file (or whatever you use) does NOT end with a CR/LF and does NOT have trailing spaces. If it does, the |> marker no longer comes at the end of the combined file and Setup.exe won't recognize the extra arguments.
PHP or Perl script
Use a PHP or Perl script on your web server:
<? parse_str($QUERY_STRING, $arr); $xargs = "<|"; foreach($arr as $key => $value) { $xargs .= "\"$key=$value\" "; } $xargs .= "|>"; $fh_name = "./yoursetup.exe"; $fh = fopen($fh_name, "rb"); if($fh) { $fh_size = filesize($fh_name)+strlen($xargs); $attachment = "attachment"; $xtype = "application/octet-stream"; if(strstr($HTTP_USER_AGENT, "MSIE")) { $xtype = "application/x-ms-download"; } header("Content-Type: ".$xtype); header("Content-Disposition: $attachment; filename=customsetup.exe"); header("Content-Length: $fh_size"); header("Content-Transfer-Encoding: binary"); while(!feof($fh)) { print fread($fh, 2048); } print $xargs; fclose($fh); exit; } else echo "<br><h1>Error downloading file!</h1>"; ?>