Install-Assembly

Installs a .NET assembly in a target directory or in the Global Assembly Cache (GAC). You must select an appropriate installation file. If not installed into the GAC, the target directory must also be specified.

Install-Assembly automatically detects the required .NET Framework version of the assembly and checks for this version on the computer during installation. If the required version is not present, the command is not executed.

Install-Assembly is similar to the .NET Framework tool InstallUtil.exe.


Settings:

  • Source File
    Specifies the file to be installed including the path. Variables are allowed. Use the "..." button to select an existing file (on the packaging system) or enter the path manually.
  • Install assembly into Global Assembly Cache (GAC)
    Enabling this option causes the selected .NET assembly to be installed in the GAC. This eliminates the need to specify the installation target.
    • Uninstall all available versions in GAC
      If the assembly is to be installed in the GAC, this additional option is available. When enabled, existing versions of the selected .NET assembly are uninstalled from the GAC. Only the newly installed version is then available.
  • Target File
    Specifies the target file(s) including path.
  • Overwrite Options
    • Always overwrite
      This is the default option and specifies that existing files with the same name are always overwritten.
    • Overwrite older versions only
      This option specifies that existing files with the same name are only overwritten if they are older than the file to be copied.
    • Never overwrite
      Specifies that existing files with the same name are never overwritten.
    • Confirm overwriting
      Existing files with the same name are only overwritten if the user confirms this.
  • File Lock
    • Break file lock, if file is locked by server service
      If the existing assembly is currently in use and therefore locked by the server service, existing handles are broken when this option is enabled. This can cause running applications that use the assembly to stop working.
  • Backup
    • Create backup file
      When files are replaced by the installation, a backup copy of the existing files is created.
  • .Net Installer Class
    • Execute installation with following parameters
      If you want to install the .NET assembly with certain parameters, they must be specified here.


Example:

The following example installs the assembly of our product "PowerShell Extensions for Ivanti DSM" into the Global Assembly Cache and at the same time removes any older versions.


Corresponds to DSM eScript command:

  • InstallAssembly


See also: