Choco Sync Command (C4B)

Choco Sync Command (C4B)

Sync Command

Starting in 1.9.0 of the licensed extension, sync has been added as a preview feature for organizations to try out. Currently Business edition only, but expected to be in Pro+ at some point - check https://chocolatey.org/compare#compare for availability.

Sync looks at all software that is in Programs and Features that is not being managed with Chocolatey packages and brings them under management. This means you can run one command and suddenly, all of the software installed on a machine is under management by Chocolatey!

Usage

To synchronize your system, Simply call choco sync and Chocolatey will ensure that all software in Programs and Features comes under Chocolatey management and provides you the packages/package sources so you can add them to source control for managing those packages over time.

Setup

At 1.9.0, sync is in preview. You need to turn it on by enabling the feature allowPreviewFeatures:

  • choco feature enable -n allowPreviewFeatures

See it in action

We've prepared a short video to show sync in action:

Chocolatey's Package Synchronizer - Sync Command

📝 NOTE To see all feature videos for Chocolatey for Business, please visit https://chocolatey.org/resources/features#c4b.

In the following image, sync is run on a system that has 18 applications installed and a base Chocolatey for Business install. Note after running sync, all software on the machine is now being managed by Chocolatey.

Chocolatey's Package Synchronizer Sync Command - if you are on https://docs.chocolatey.org/en-us/features/package-synchronization, see commented html below for detailed description of image

Options and Switches

The following are available in the choco sync command.

     --id=VALUE
     Id - The Display Name from Programs and Features

     --out, --outdir, --outputdirectory, --output-directory=VALUE
     OutputDirectory - Specifies the directory for the generated Chocolatey
       package file(s). If not specified, uses a subdirectory of the current
       directory.

FAQ

How do I take advantage of this feature?

You must have the business edition of Chocolatey. Business editions are great for organizations that need to manage the total software management lifecycle.

I'm a business customer, now what?

You would periodically run choco sync.

How does it work?

Chocolatey takes a look at all software in Programs and Features that is not under Chocolatey management, generates packages on the fly and baselines them under the Chocolatey install, ensuring all of the links are tracked.

Do I get the packages to add to source?

Yes! Chocolatey will tell you the location of the sync files so you can put them into source control.

Some packages have a TODO list

Generating packages on the fly from Programs and Features for non-MSI installers doesn't provide everything necessary to ensure an actual install. So when you take those packages back to source, you will need to finish out the packaging for those so that later when you upgrade, things will work appropriately.

How do I get machine parseable output?

Use -r. choco sync -r. Requires Chocolatey v0.10.4+.

What if I have an existing package that is just not tracking to Programs and Features?

Synchronize can recognize existing packages and sync to those as long as the name of the package is a close match to the software name (e.g. Google Chrome becomes either google-chrome or googlechrome).

Sync Command Known issues

  • Any packages you've installed side by side (-m) will show up every time during sync.
  • If you have both a 64-bit and 32-bit version of some software installed, sync will track to one on the first run and the other on the next run. This is not a normal scenario.