Skip to content

Instantly share code, notes, and snippets.

@phaufe
Forked from anaisbetts/instructions.md
Last active August 29, 2015 14:06
Show Gist options
  • Save phaufe/1341f3608ef1545559ff to your computer and use it in GitHub Desktop.
Save phaufe/1341f3608ef1545559ff to your computer and use it in GitHub Desktop.

Getting Started

Here's how to take any EXE and create an installer for it:

  1. Install-Package squirrel.windows
  2. Use NuGet Package Explorer (or any other way) to create a NuGet package for your app.
  3. Open the NuGet Package Console, and type Squirrel --releasify path/to/the/nuget/package.nupkg

You should have a folder called Releases with three files in it. Publish those all to S3 in the same folder and you've now got an installer

Handling Squirrel events

Squirrel events are optional, but they can be super useful, as it gives you a chance to do "custom install actions" on install / uninstall / update.

In your app's AssemblyInfo.cs, add the following line:

[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]

This means that your app will be executed by the installer, in a number of different scenarios, with special flags - you should handle them correctly:

  • --squirrel-install x.y.z.m - called when your app is installed. Exit as soon as you're finished setting up the app
  • --squirrel-firstrun - called after everything is set up. You should treat this like a normal app run (maybe show the "Welcome" screen)
  • --squirrel-updated x.y.z.m - called when your app is updated to the given version. Exit as soon as you're finished.
  • --squirrel-uninstall - called when your app is uninstalled. Exit as soon as you're finished.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment