Background information installation modes

As described in the Execution of packages section, you execute a package by calling the "Deploy-Application.exe" executable that is located in the package directory.

You can specify which installation mode is used by using the command line parameter "InstallMode" to specify how the installation should be performed. If you do not specify the "InstallMode" parameter, the default value is "Install". You call the package in the format "Deploy-Application.exe -InstallMode <Mode>".

Possible values for InstallMode are:

  • Install
    Either only the computer part (for non-interactive execution) or both computer and user part (for interactive execution) is installed.
  • InstallComputerPart
    Only the computer part is installed.
  • InstallUserPart
    Only the user part is installed (typically via Active Setup).
  • Modify
    A modification execution takes place. In its current status, this corresponds to a normal installation.
  • Reinstall
    A reinstallation takes place and the script is executed again.
  • Repair
    A repair installation takes place. In the current status this corresponds to a normal installation.
  • Uninstall
    Either only the computer portion (for non-interactive execution) or both the computer and user portions (for interactive execution) are uninstalled.
  • Update
    An update installation takes place. In the current status this corresponds to a normal installation.


Starting with version 2.0, an additional command line parameter can be passed to "Deploy-Application.exe", which ensures that a copy is automatically created from the package directory. This parameter was introduced because after successful execution of a package, the Microsoft Intune Management Extension clears the package cache itself and therefore for packages with a user part this could not be executed.

  • PersistCache
    The package copies itself to the "%ProgramData%\CANCOM\PackageDeployment\PackageCache" directory. The Active Setup registry values then point to this directory instead of the native package directory.


In version 3.0, two additional command line parameters that can be passed to "Deploy-Application.exe" have been introduced. These ensure that an installation running in the service context is "redirected" to an interactive Windows session by restarting it there.

  • RestartInteractive
    Switch parameter which - if set - ensures that the value of the RunInInteractiveSession parameter is used to determine the active Windows session.
  • RunInInteractiveSession
    Alias: RunInSession 
    Default value: $null
    Possible values: 
    • $null
    • <empty String>
    • -1 = determine the first active Windows session
    • <Number> = use this Windows session
    • <Process-Name> = detect the first active Windows session of this process, where "*" becomes "explorer", and an appended "?" alternatively also searches for explorer processes.
    • <Number>:<Process-Name> or <Process-Name>:<Number> = detect the specified process in the specified Windows session.


Examples:

  • Deploy-Application.exe                                                                                The installation is run in the current Windows session.
  • Deploy-Application.exe -RestartInteractive                                                        The installation is restarted in the first active Windows session (the default value of "RunInInteractiveSession" is effective). This is the usual call form.
  • Deploy-Application.exe -RunInInteractiveSession $null                                        The installation is restarted in the first active Windows session ("RestartInteractive" is not required).
  • Deploy-Application.exe -RestartInteractive -RunInInteractiveSession notepad?        The installation is restarted in the first active Windows session of a Notepad or Explorer process ("RestartInteractive" is actually superfluous, but does not interfere).
  • Deploy-Application.exe -RunInInteractiveSession                                                An error occurs because a value must be specified for "RunInInteractiveSession" ("RestartInteractive" is the switch parameter without a value).