Installing GitHub's Atom in an Enterprise Environment

Atom is a modern, hackable text editor developed by GitHub. It's based on modern web technologies like NodeJS and is quite popular in the web developer community. Recently I had to come up with a way to automatically install it on multiple computers at work. Unfortunately that's a use case that probably was overlooked by the Atom development team.

As I've said, Atom uses modern technology, unfortunately that also goes for its installer. Atom uses Squirrel.Windows, a framework for packaging Windows applications. Squirrel's and therefore Atom's philosophy is:

No UAC elevation needed

meaning applications packaged with Squirrel will only ever install in the user context. This is needed for automatic updates and is basically a good idea, the only problem is, it renders those applications almost unusable for enterprises. I don't want my users to install applications on their computers only for themselves, and I'm even less eager to have that happen on semi-public computers, like in a computer lab. In our case we reset the user profiles on those machines once every week.
We use Microsoft System Center Configuration Manager 2012 (SCCM) for our automatic software deployments. The easiest way to deploy software with SCCM is providing a Windows Installer Package (.msi), but other methods like batch scripts are supported too.

After some fiddling with the setup executable the Atom developers provide, I finally realised it wasn't feasible. The installer even provides a machine-wide-installation switch (--machine) – don't use that! Using this switch installs Atom for the current user, and – this is the perfidious thing – creates a key in the Windows registry under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run, causing the installer to be called for every user on every logon. This is an absolute nogo, and also a horrible way to do a machine wide installation. Even worse is that the installer does not provide a switch to get rid of this registry key, so you have to look through the registry yourself to find and delete it. The --machine switch has been deprecated by the Squirrel.Windows team and replaced by an .msi that probably does the same thing, but the Atom developers team didn't update their releases yet, and even if they did, it doesn't do anything to solve the problems the --machine-switch had in the first place.

Thankfully GitHub also provides a ZIP-archive, which does not feature automatic updates and can therefore be used to install Atom in an enterprise context. When I found out about that, I wrote a quick and dirty batch script, which copies the folder to the "Program Files"-folder and creates shortcuts in the Start menu for all users and on the desktop:


@echo off
REM This script installs Atom on a computer and creates shortcuts in the start menu and desktop for all users.
REM Copy program files
if not exist "%programfiles%\Atom\" ( 
  xcopy ".\Atom" "%programfiles%\Atom\" /s /h /q /y
)
REM Create shortcuts
xcopy ".\Atom.lnk" "C:\Users\Public\Desktop\" /q /y
xcopy ".\Atom.lnk" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\" /q /y

With this script I was finally able to deploy atom to our computer labs, and also make it available for installation for the whole department. This script expects to be placed next to the extracted contents of the ZIP-archive, in a folder called "Atom". Next to the folder and the script I placed a shortcut I created pointing to %programfiles%\Atom\Atom.exe, which will be copied by my script. I didn't feel like fiddling around with a script to create the shortcuts, so I chose the cheaty route. Using the ZIP has the additional advantage that we as the IT department have an eye on which version of Atom is installed on our computers, because it won't auto-update. It's unfortunate that the Atom developers didn't really think about this use case, but I'm glad I found a way to do it anyways – even if it's a bit dirty and cheaty.