Tutorial Tuesday - Atom Installer

Hi there everyone,

Today we are launching a new series called Tutorial Tuesday. In this series, we'll be showing you what you can do with Koupi.


We built Koupi because we wanted a tool that was both actively useful and educational. Our mantra at Koupi is Automation for Everyone. In that spirit, we'll be releasing Koupi Tutorials every Tuesday. Those tutorials can be interesting problems solved with Koupi, new features, or public workflows.

Above all, we would love for you to let us know what you use or want to use Koupi for, so we can create the tutorials you want to see.

Without further ado, let's get right into today's tutorial: Creating a workflow to install Atom.

Introduction

Atom is a text and code editor created by the GitHub Team (Microsoft). It is fully customizable using HTML, CSS, and Javascript.

Since Atom is a desktop software, we will be going through a software installation workflow to install and uninstall it.


Creating the Workflow


Since this is a software installation, the workflow to choose here is the Software Installation Workflow

A software installation workflow allows us to create 4 types of sub-workflows:


  1. Installation: Which is intended for software installations.

  2. Uninstall: To uninstall a piece of software

  3. Update: To update the software to a minor version

  4. Upgrade: To upgrade the software to a new major release.

Once the workflow is created, open it to edit it.


Editing the Workflow

Clicking on the workflow will bring you to the editor where you can edit the workflow.


Install

Let's start with the installer. First thing, let's take a look at what our workflow would look like f we did it manually so we can more easily translate it to a Koupi workflow:

1. Download the installer
2. Execute the downloaded installer
3. Cleanup the installer from the computer

The great thing with Koupi is that those are exactly the steps we need to add to install the software. This is what the skeleton looks like:


Of course, it's missing all the parameters, but so far it look like what we're looking for.


Download


For the Download step, we can get the link to the installers from here. For version 1.52.0, our download links are as follows:

32-bit: https://github.com/atom/atom/releases/download/v1.52.0/AtomSetup.exe

64-bit: https://github.com/atom/atom/releases/download/v1.52.0/AtomSetup-x64.exe


Now, we could put the links in the step parameters directly, as show below, but this is not the cleanest way, though it does make it easier to see what is being downloaded.

I personally, prefer using variables. For this we'll add two variables:

32-bit:

Variable Friendly Name: 32-bit Installer URL

Variable Name: x86_InstallerURL

Variable Default Value: https://github.com/atom/atom/releases/download/v1.52.0/AtomSetup.exe

64-bit:

Variable Friendly Name: 64-bit Installer URL

Variable Name: x64_InstallerURL

Variable Default Value: https://github.com/atom/atom/releases/download/v1.52.0/AtomSetup-x64.exe


One nice things with variables is that we can right click in the parameter field and directly insert them, without typing anything. They also appear more cleanly in the step description

Since we are going to cleanup the file downloaded, we should set the cleanup dropdown to Yes.



Execute

Based on the discussion on this thread we know that the --silent argument is the one we should be using for our execute step. Note: if you right click in the first parameter of the Execute step, you can select the result of the download step.



Cleanup

The cleanup step is the easiest one to use, just add it and it will work on its own as long as there are artifacts labeled to be cleaned up.


Let's Run it!


Now that it looks like we're done making the installer, let's run it to see how it goes.

Note: the GIF below demonstrates the process, it takes 4 minutes though.

As you can probably notice, the workflow downloaded the proper version of Atom, installed it, and deleted the installer afterwards.


Uninstall

New that we've installed the software, let's take a look at what an uninstall process would look like.


It would be very easy if there was an uninstaller we could just run, but there isn't. That being said, it's not that hard either.


Let's take a look at the files that we have to see what we can work with. Usually, the uninstaller is in the same folder as the location where the software is running. To figure out where that is, you can go in the start menu, and click on Open File Location until you get to the location where it is installed.

As you can see, this folder has an update.exe executable but no uninstaller. Let's take a look at that update.exe. In order to do that, open a PowerShell or command line window, drag the file in there, once you have the path in the window, add a /? at the end (don't forget the space between .exe and /?).

Now that we have done that, we can see that there is a --uninstall option, which will uninstall the version of Atom in the directory of update.exe. Let's use that!


Now the skeleton for the uninstaller looks like this:

1. Test is %LOCALAPPDATA%\Atom\update.exe exists
    1. Execute %LOCALAPPDATA%\Atom\update.exe --uninstall


That's it! Let's run it and take a look at how it performs.




As you can see, there is a remaining Atom folder in there. Let's update our uninstall workflow to remove that folder.



It's that time again! Let's Run it!


Conclusion


There you have it! This is how you would make the installer and uninstaller workflows for Atom using Koupi! As you can see, this was fairly simple to do.


Stay tuned for the next Tutorial Tuesday! And let me know in the comments what you would like me to create a tutorial for next.

©2019-2020 by Bulles Technologies. Proudly created with Wix.com