Installer Command Line

Comments 0

Visual Studio installation actions allow specifying command line parameters.

Recently, I tried using this to get a handle on the target directory where the applicaiton is installed. Unfortunately, the installer fails parsing the [TARGETDIR] property. The installer aborts reporting a failure to find a file or assembly in

C:WindowsSystem32FileISRMyPoductName. The installation log sheds no additional information.

Removing the option ‘/dir=[TARGETDIR]’ (sans quotes) from the command line does away with this error. Using ‘/dir=[programfilesfolder]’ causes the same error message. The failure of the installer action occurs even if the installer class used with this action is empty.

Workarounds:
(a) Place command items within quotes, e.g.,

/refresh=”True” /release=”Alpha” /dir=”[TARGETDIR]”

(b) Use System.Reflection.Assembly.GetExecutingAssembly.Location

Leave a Reply

Your email address will not be published. Required fields are marked *