Primary-Client.exe Commands

The following describes the available commands for primary-client.exe:

Notes:

  • Be sure to wrap all complex passwords like "&()[]{}^=;!'+,`~ my c0mpl3x PW" and paths that include a space in double quotes.
  • Double quotes cannot be used in passwords or AES secrets.
  • /InstallerArgs (if any) must be quoted, be the last parameter, and inner quotes must be escaped with \
  • If /Installer points to a .msi, then /InstallerArgs will automatically be set to /i "<installer.msi>" /qn and /Installer will implicitly become msiexe.exe, but you can still use /InstallerArgs to provide additional args in this scenario.
  • If multiple paths are provided to network shares, multiple credentials are provided, and they are to the same server then either only use one set of credentials, or make the second reference to the server be via ip.
  • If a PackagesFile contains a parameter already set in DefaultsJSON, PackagesFile wins. If parameter also included on CLI, CLI wins.
Command Description

Help

Displays the command line options
Usage: primary-client.exe Help

Add PackagesFile
(omit all params to get an empty template file)

Creates or appends to a PackageFile
Usage: primary-client.exe Add PackagesFile

/PackagesFile <path\packagesfile.json (or .csv)>

[/CryptoKey "<my-aes-secret-key>"]

/Name "<name>"

/Path <path> *SEE BELOW

[/PathUsername <domain\user> /PathPassword "<pass>"]

[/AzureMaximumConcurrency <int>] -Azure download tuning. Default 64.

[/AzureInitialTransferSizeMb <int>] -Azure download tuning. Default 1.

[/AzureMaximumTransferSizeMb <int>] -Azure download tuning. Default 1.

[/CustomStorageUrl <url> (Custom S3 service URL or Azure endpoint suffix)]

[/SizeGb <GBs>] –Defaults to 20GB.

[/Fixed] –Creates a fixed vhdx instead of the default expandable.

[/Test] –Leaves some .bmp files behind to make it easier to see what shortcuts were captured.

[/PuAddress <https://pu.server:8000> /PuUsername "<domain\user>" /PuPassword "<pass>"] –Registers new packages in inventory.

/Installer <path\installer.exe> **SEE BELOW

[/InstallerUsername <domain\user> /InstallerPassword "<pass>"]

[/InstallerArgs <args>]

[/InstallerExitCode <int>] –Expected installer exit code, else error. Default 0.

[/InstallerTimeoutMs <ms>] –How long to wait for the installer to finish, else error. Default 1hr.

[/WaitAfterInstallerExitsMs <ms>] –Wait after installer exits before completing capture. Default 0.

[/DontCopyInstallerLocal] –Will not copy the installer locally before running the installer. Default false; Does copy.

[/CopyInstallerFolderLocal] –Copies the folder containing the installer file locally before executing. Default false except for script installers.

[/InstallerFolder <path>] –Change from the default installer path of the folder containing the installer to a custom path to be copied locally before executing the installer.

[/NoHCCapture] –Do not use high compatibility capture mode. Default false; Use HC Mode.

[/NoSystemRestore] –Do not perform a System Restore rollback at the end of the capture/extend. Default false; use System Restore to rollback.

[/AltRestoreCmd <path\file>] –Instead of using System Restore, use a cmd to rollback, implies /NoSystemRestore.

[/AltRestoreCmdArgs <args>]

[/Installer2 <path\installer.exe> **SEE BELOW

[/InstallerArgs2 <args>]

[/InstallerExitCode2 <int>]]

...

[/Installer10 <path\installer.exe> **SEE BELOW

[/InstallerArgs10 <args>]

[/InstallerExitCode10 <int>]]

[/PreActivationScript <path\file>]

[/PostActivationScript <path\file>]

[/PreDeactivationScript <path\file>]

[/PostDeactivationScript <path\file>]

[/NoCallToHome] –Do not send installer and installer args data to Liquidware.

[/PackageVersion <major.minor.build.revision>] –User specified version to help track package changes.

[/DontCreateFlexAppOne] –Do not automatically create a FlexApp One EXE. Default false; Do create EXE.

[/FlexAppOneCliOverride <args>] –Custom FlexApp One Bundler command line args.

[/DontCaptureUserProfileData] –Do not capture user profile data.

[/DontCaptureUserRegistry] –Don’t capture user registry data from HKCU or HKU.

[/DontCapture] –Do not capture at all, just install.

[/PackagesXml] –Write a copy of package info into the specified packages.xml so it can be inventoried using FlexApp Packaging Console in "Offline Mode".

[/PuConfiguration <configname> /PuFilter <filtername> [/PuDescription <descr>]] –Replaces existing package in specified configuration with created package. /Name and /PuFilter must match existing package assignment, with differing /PackageVersion values.

List PackagesFile
(or view the file by hand)

List package information from an existing PackagesFile
Usage: primary-client.exe –List PackagesFile
/PackagesFile <path\packagesfile.json (or .csv)>

Remove PackagesFile
(or edit the file by hand)

Removes <package name> from an existing PackagesFile
Usage: primary-client.exe –Remove PackagesFile
/PackagesFile <path\packagesfile.json (or .csv)>
/Name <package name>

Clear PackagesFile
(or edit the file by hand)

Removes ALL entries from an existing packages file
Usage: primary-client.exe –Clear PackagesFile
/PackagesFile <path\packagesfile.json (or .csv)>

Create DefaultsJSON
(Optional, omit all params to get an empty template file)

Creates optional DefaultsJSON with default params used by packaging jobs
Usage: primary-client.exe –Create DefaultsJSON
/DefaultsJSON <path\defaults.json>
/CryptoKey "<my-aes-secret-key>"]
[/MailServer <smtp.something.com>
/MailTo <a@b.com>
/MailFrom <x@y.com>
[/MailPort <integer>] [/MailSsl]
[/MailUsername <domain\user> /MailPassword "<pass>"]]
[--All 'Add PackagesFile' parameters are supported here--]

List DefaultsJSON
(or view the file by hand)

List parameters from a DefaultsJSON file
Usage: primary-client.exe –List DefaultsJSON
/DefaultsJSON <path\defaults.json>

Create Packages

Creates the packages listed on the CLI or in the specified file(s)
Usage: primary-client.exe –Create Packages
[/PrimaryAddress <https://server:9075>]
/PrimaryUsername <user> /PrimaryPassword "<pass>"
/PackagesFile <path\packagesfile.json (or .csv)>
[/DefaultsJSON <path\defaults.json>]
[/CryptoKey "<my-aes-secret-key>"]
[/MailServer <smtp.something.com>
/MailTo <a@b.com>
/MailFrom <x@y.com>
[/MailPort <integer>] [/MailSsl]
[/MailUsername <domain\user> /MailPassword "<pass>"]]
[/WaitForDone]
[/JobFilter <JobStatus>]
–Pending, Running, Successful, Failed, or Cancelled.
[/CaptureRetryCount <Int>] -Defaults to number of agents, Zero means no retries.
[--All 'Add PackagesFile' parameters are supported here--]

Status Packages

Retrieves the status of Create Packages batch jobs
Usage: primary-client.exe –Status Packages
[/PrimaryAddress <https://server:9075>]
/PrimaryUsername <user> /PrimaryPassword "<pass>"
[/Id <guid>]
[/DefaultsJson <path\defaults.json>]
[/CryptoKey "<my-aes-secret-key>"]
[/JobFilter <JobStatus>]
–Pending, Running, Successful, Failed, or Cancelled.

Wait Packages

Waits for a currently running create packages batch job to complete
Usage: primary-client.exe –Wait Packages
[/PrimaryAddress <https://server:9075>]
/PrimaryUsername <user> /PrimaryPassword "<pass>"
/Id <guid>
[/DefaultsJson <path\defaults.json>]
[/CryptoKey "<my-aes-secret-key>"]
[/JobFilter <JobStatus>]
–Pending, Running, Successful, Failed, or Cancelled.

Add Agent

Adds a Capture Agent to the Primary Packaging Manager
Usage: primary-client.exe –Add Agent
[/PrimaryAddress <https://server:9075>]
/PrimaryUsername <user> /PrimaryPassword "<pass>"
/AgentAddress <https://server:9074>
/AgentUsername <user> /AgentPassword "<pass>"
[/DefaultsJson <path\defaults.json>]
[/CryptoKey "<my-aes-secret-key>"]

Remove Agent

Removes a Capture Agent from the Primary Packaging Manager
Usage: primary-client.exe –Remove Agent
[/PrimaryAddress <https://server:9075>]
/PrimaryUsername <user> /PrimaryPassword "<pass>"
/AgentAddress <https://server:9074>
[/DefaultsJson <path\defaults.json>]
[/CryptoKey "<my-aes-secret-key>"]

List Agent

Lists all Capture Agents currently added to the Primary Packaging Manager
Usage: primary-client.exe –List Agent
[/PrimaryAddress <https://server:9075>]
/PrimaryUsername <user> /PrimaryPassword "<pass>"
[/DefaultsJson <path\defaults.json>]
[/CryptoKey "<my-aes-secret-key>"]

Clear Agent

Deletes ALL Capture Agents from the Primary Packaging Manager
Usage: primary-client.exe –Clear Agent
[/PrimaryAddress <https://server:9075>]
/PrimaryUsername <user> /PrimaryPassword "<pass>"
[/DefaultsJson <path\defaults.json>]
[/CryptoKey "<my-aes-secret-key>"]

Footnotes:

* /Path –Specifies the folder where the packages will be created

  • Specifying a * /Path ending in a FlexApp package's filename.vhdx will perform an extend of that existing package.

  • Specifying a * /PathUsername of "IAM" will attempt to use the Agent machine's assigned IAM roles to access the S3 bucket.

  • There are several ways to use * /Path, depending on your target storage platform:

    • /Path "<\\server\share\target-path>" [/PathUsername "<domain\user>" /PathPassword "<pass>"]

    • /Path <s3://bucket/folder> /PathUsername <access key> /PathPassword <secret key>

    • /Path <s3://bucket/folder> /PathUsername "IAM"

    • /Path <az://bucket/folder> /PathUsername <account name> /PathPassword <account key>

    • /Path <gs://bucket/folder> /PathPassword "<path\credential.json>"

** /Installer –Specifies what should be installed, or executed and captured

  • /Installer –Supports several file types beyond EXE's and depending on the file extension, are automatically called by the associated interpreter:

    • MSI files will be automatically run via:

      msiexec.exe /i /qn.

      Additional Arguments can be passed in via /InstallerArgs.

    • Batch scripts (bat,cmd) are run via:

      cmd.exe /C “installerscript.bat” "</InstallerArgs>"

    • Windows Script Host files (vbs,vbe,wsf,wsc,js) are run via:

      cscript.exe /b /nologo “installerscript.vbs” "</InstallerArgs>"

    • Powershell (ps1) are run via:

      powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -NonInteractive -File “installerscript.ps1” "</InstallerArgs>"

  • /Installer –Copies the specified file into the local temp folder before executing it unless /DontCopyInstallerLocal is specified.

    • If the file specified is a script, then /CopyInstallerFolderLocal will be enabled so that supporting files are included.

    • The "InstallerFolder" is the folder containing the specified /Installer file unless otherwise specified using /InstallerFolder.

    • /InstallerFolder implies /CopyInstallerFolderLocal.



  • /Installer –Supports local disk paths, CIFS shares and http(s) URLs.