Nick Heim

Nick’s comments on Windows Deployment

Archive for May, 2022

Installing AutoPkg on Windows

without comments

Download the actual Windows release. Get the MSI. But first, install all the prequisites!

A packaging machine is exposed to the internet and reaches out to dozens of server on the net every day and should therefore be hardened and downlocked. Recommended installation is per user into the profile, which is used to run AutoPkg. This user profile should have not more than standard user rights. For this to work, the MSI have to be advertised with admin rights and the following command:

msiexec /jm AutoPkgWin.msi

CAUTION: This needs an elevated CMD-shell! PS-console does not work!

After this, the Installer can be run with standard user rights.

AutoPkg for Windows requires Windows 10 / Server 2016 or newer, Windows 32 or 64bit and to have Git installed is highly recommended, so managing recipe repositories is possible. Knowledge of Git itself is not required but helps. Tested only on 64bit!

Easy route: With this script (AutoPkg-PreReq-Installer), you can install everything needed, in one run.

Step by step instruction:

The following software and tools are needed as prequisites to run AutoPkg on Windows:

  • Python 3.8.x: or 3.10.x Download (Caution: pythonnet is still not compatible with Python 3.9/3.10)
    • (Python 3.10.x works with pythonnet v3.0.0-alpha2 with: pip install pythonnet –pre)
    • Needed libraries: pyyaml, appdirs, msl.loadlib, pythonnet, comtypes, pywin32, certify
    •  If Python is present, those libs are automatically installed by the AutoPkg installer.
  • Windows-Installer-SDK: Download, You have to select a version, that fits your OS. This is necessary for some of the MSI-related processors.
    • Download the webinstaller, choose a download directory and select at least: “MSI Tools”, “Windows SDK for Desktop C++ x86 Apps” and on x64 systems also “Windows SDK for Desktop C++ x64 Apps”, (there will be some additional selections).
    • Then install at minimum: “Windows SDK Desktop Tools x86-x86_en-us.msi” and “Windows SDK Desktop Tools x64-x86_en-us.msi” (x64 only).
    • Find the install location (Somewhere under C:\Program Files (x86)\Windows Kits…)
    • Copy the Wi*.vbs and Msi*.exe files over to your MSITools folder.
    • Register the 64bit mergemod DLL: regsvr32 “C:\Program Files (x86)\Windows Kits\10\bin\xxx\x64\mergemod.dll”
    • If the SDK is present, this COM DLL is automatically registered by the AutoPkg installer.
  • Wix-Toolset: Download, version 3.11 should do it. Although, i always use the latest development version.
  • MSBuild: Download, THE Windows Make!
    • Install commandline: vs_buildtools.exe –add Microsoft.VisualStudio.Workload.MSBuildTools –quiet
  • NANT: Download (Deprecated), this is one of the predecessors of MS-Build (which you should use, when starting with a new build-enviroment).
    • Download the ZIP package, extract it and copy the “nant-0.92” folder to the Tools dir.

Written by heim

May 4th, 2022 at 3:04 pm

AutoPkg on Windows

without comments

Quite a long way from very early adventures with AutoPkg on Windows. Nick McSpadden started it on June 2018. See: https://twitter.com/mrnickmcspadden/status/1011422819853324288.
In early 2019, I was talking with my colleagues Max and Graham about automating the provisioning of packages in there deployment system (JAMF). Jealously, I had to admit, that such a framework was the missing thing in our work of provisioning software into our Windows deployment system (baramundi.de).

That talk did its work and did not let me go… And as a complete novice on Python, i began to poke around the code on https://github.com/autopkg. Naively, I downloaded that stuff and tried it on Windows, which instantly told me, that there were Python functions in use, which were OSX only and not available on Windows. Too bad. ☹

But at the end of February 19, light at the end of the tunnel! Max pointed me at the tweet mentioned earlier. And YES, with the modifications from Nick’s fork, it ran on Windows! From there to the system we have today, it was a long way. Almost 100 recipes and more than 2 dozen processors are doing a great way of saving time and creating much more reliable packages, we ever had before.

So, if you want to try it out for yourself, in about half an hour, you can build a machine, that is ready for AutoPkg.

Written by heim

May 4th, 2022 at 12:12 pm