Skip to content

Instantly share code, notes, and snippets.

@bgrainger
Last active December 27, 2015 07:19
Show Gist options
  • Save bgrainger/7287703 to your computer and use it in GitHub Desktop.
Save bgrainger/7287703 to your computer and use it in GitHub Desktop.
What I had to do to get Squirrel working

Squirrel is the latest name for GitHub's "It's like ClickOnce but Works™" installer. I've been working on a Windows GUI for git blame, and setting up automatic updates with Squirrel seemed like a must-have feature before an initial public release.

However, I had a few problems when trying to add Squirrel to my project, so I thought I'd document what I had to do to get it actually working.

1. Read the Documentation

There's a great QuickStart on the Squirrel wiki; be sure to read that first.

2. Install Shimmer

The documentation says to Install-Package Squirrel. Unfortunately, that package doesn't actually appear to be published. I think this is already covered by outstanding tasks in PR 211 so I didn't file a bug. Instead, I just installed Shimmer, even though it's the older version.

3. Update NuGet.exe

I had an old version of NuGet.exe in my .nuget folder (from when I first added NuGet Package Restore to the solution). This was causing build failures (I don't remember what, exactly) because it was older than the minimum version recommended in the documentation. I downloaded the latest version of NuGet.exe and placed it in my .nuget folder. Unfortunately, this didn't update my NuGet.Targets file. Instead, I should have followed this SO answer, deleted the .nuget folder, and re-enabled NuGet Package Restore. That would have avoided needing to...

4. Fix NuGet.Targets

The "nuget pack" post build step was failing with a strange error. Eventually I tracked it down to the Platform not being specified in the -Properties passed to nuget pack, and fixed it by editing NuGet.Targets. Correctly updating to the latest version of NuGet would have fixed it much more quickly.

5. Add assembly binding redirect for NuGet.Core

When testing the apply releases step, my app was crashing with a FileLoadException: Could not load file or assembly 'NuGet.Core, Version=2.7.40808.167, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040): NuGet.Core, Version=2.7.40808.167, Culture=neutral, PublicKeyToken=31bf3856ad364e35 I fixed this by adding an assembly bindingRedirect in app.config.

6. Add app.config to nuspec

Once I did that, I found that the app.config wasn't actually being installed, so the installed app would crash with the same problem (even though it worked fine under the debugger). The solution was to manually add <files> to the project's nuspec.

7. Update from Shimmer to Squirrel

Once everything was working, I removed the Shimmer.Core and Shimmer.Client nupkgs, and replaced them with Squirrel.Core and Squirrel.Client. This works around the lack of a Squirrel NuGet package (see step 2).

@hatton
Copy link

hatton commented Nov 14, 2013

Thanks for taking the time to write this up, Bradley.

@christianrondeau
Copy link

Same here, thanks for the help; I didn't have any trouble with NuGet itself, but the instructions with Shimmer and the App.config file helped a lot!

@iamthefaker
Copy link

Just to eliminate a bit of possible confusion, it could be useful to note that this page refers to a version of the Shimmer/Squirrel that has now be renamed to "OldSquirrelForWindows" , and yet the links above (because of the renaming) are pointing to a newer version which this information was not written for. :-S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment