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.
There's a great QuickStart on the Squirrel wiki; be sure to read that first.
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.
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...
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.
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
.
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.
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).
Thanks for taking the time to write this up, Bradley.