Command Line Options

Visual Patch's design time and run time support various command line options that can be passed, thus providing developers and network administrators more control over the patching process.

Tip: The global variable _CommandLineArgs can be used to determine what arguments were passed to the patch executable.

The available command line options are grouped into the following two categories:

 

Patch Command Line Options

The following command line options are supported by patches created with Visual Patch:

/NOINIT

This command line option hides the "initializing..." dialog that appears when extracting primer files at the beginning of the patch.

/S:<<optional ini file>>

Allow a patch to be run in silent mode. As a result, no screens or dialogs will be shown. If /S is passed on the command line it will set the global variable _SilentPatch to true if the enable silent mode option is selected in project settings.

This command line option also has an optional INI file that can be passed containing session variable values. For example:

 

"C:\output\patch.exe" "/S:C:\patchvars.ini"

This will cause the session variables in the INI file to be used for the patch. The INI file should be in the format:

[Variables]
%AppFolder%=C:\Program Files\Your Product 2
%UserName%=Joe Blow
%Whatever%=Who knows

/T:<<file path>>

Every patch executable requires some temporary space on the user's hard drive during the patching process. By default, Visual Patch uses the user's TEMP directory for extracting temporary files and other miscellaneous operations. You can force the patch executable to use an alternate directory by using the /T command line option.

The syntax for the /T option is:

/T:<<file path>>

Replace "<<file path>>" with the path to the folder you want the patch executable to use for its temporary files. (Be sure to put quotes around the entire argument if the path includes any spaces.) If the folder doesn't already exist on the user's system, it will be created automatically.

For example:

 "C:\Downloads\patch.exe" "/T:C:\My Temp Dir"

(forces the patch to use "C:\My Temp Dir" for temporary files)

/NOTB

Turns off the taskbar icon when executing the patch. This is the same as selecting the Hide taskbar icon option on the Advanced tab of Project Settings. This command line option is useful when running the patch in silent mode when you want it completely silent.

For example:

"C:\output\patch.exe" /S /NOTB

 

Unattended Build Options

The following command line options are supported by Visual Patch's design environment for an unattended build process:

Note: The unattended build returns 0 as a process return code if successful, or non-zero if not. You can use this return code to make your batch files respond to the success or failure of the Visual Patch build process.

/BUILD

Tells Visual Patch to build the project file passed in on the cmd line or from a batch file. For example:
"C:\Program Files\Visual Patch 3.0\Visual Patch.exe" /BUILD "C:\TestProj.vp2"

/CONFIG:<<ConfigName>>

Specifies the build configuration to use in the build. If not specified, the first build configuration found in the project is used.  For example:

"C:\Program Files\Visual Patch 3.0\Visual Patch.exe" /BUILD "C:\TestProj.vp2" "/CONFIG:DebugConfig"

/LOG:<<log file path>>

Specifies the location of a log file to output the build status to. If the file exists, it will be overwritten. If the file does not exist, it will be created. For example:

"C:\Program Files\Visual Patch 3.0\Visual Patch.exe" /BUILD "C:\TestProj.vp2" "/LOG:C:\output\Log.txt"

If no log file path is specified, it will be created by default in the output directory.

/STDOUT

Makes the build status go to the standard output device (console). For example:

"C:\Program Files\Visual Patch 3.0\Visual Patch.exe" /BUILD "C:\TestProj.vp2" "/STDOUT"

/CONST:<<ini file path>>

Lets you specify an INI file that contains design-time constants to override the ones in the project. You can define as many design-time constants as you want in the INI file, with each constant on a separate line beneath the [Constants] section. Each constant that is defined in the INI file must already be defined in the project file. For example:

 

[Constants]
#OUTPUTDIR#=C:\Output\Foobar 2002\Release
#PATCHNAME#=foobar2002patch.exe
#BUILD#=release

When you use the /CONST option along with /BUILD, the specified project file is loaded into Visual Patch, the constants described in the specified unattended-build INI file are set, and the patch executable is generated-all without any interaction.

 

For example:
"C:\Program Files\Visual Patch 3.0\Visual Patch.exe" /BUILD "C:\TestProj.vp2" "/CONST:C:\MyProj\Config.ini"