Update existing specs

This commit is contained in:
Paul Betts
2014-07-28 14:28:54 +02:00
parent 3c2ac77c25
commit 684f242130
2 changed files with 18 additions and 40 deletions

View File

@@ -2,40 +2,22 @@
#### Production
I'm a developer with a WPF application. I have *zero* way to distribute my
application at the moment. I go to NuGet and install the Squirrel client library.
I'm a developer with a WPF application. I have *zero* way to distribute my application at the moment. I go to NuGet and install the Squirrel client library.
Now, I want to publish a release. To do so, I pop into the PowerShell Console
and type `New-Release`. What does this do? It:
Now, I want to publish a release. To do so, I pop into the PowerShell Console and type `New-Release`. What does this do? It:
* Creates a NuGet package of my app (i.e. via shelling out to NuGet.exe or w/e)
* It puts the package in a special "Releases" directory of my solution (along
perhaps with a special "delta package" for updates)
* It puts the package in a special "Releases" directory of my solution (along with a delta package for updates)
* It also creates a Setup.exe that I can distribute to people
* Can also transform `changelog.md` to `changelog.html` using the bundled
Markdown library that ships with Squirrel
* Can also transform `changelog.md` to `changelog.html` using the bundled Markdown library that ships with Squirrel
I've created a new release. Now, I want to share it with the world! I upload
the contents of my Releases directory verbatim to the web via S3 / FTP /
whatever.
I've created a new release. Now, I want to share it with the world! I upload the contents of my Releases directory verbatim to the web via S3 / FTP / whatever.
In my app, I call `bool
UpdateManager.CheckForUpdates("http://mycoolsite.com/releases/")` - similar to
ClickOnce API but not awful. The library helps me check for updates, get the
ChangeLog HTML to render, and if I'm really lazy, I can just call
`UpdateManager.ShowUpdateNotification()` and get a stock WPF dialog walking
the user through the upgrade. For production applications, I get the
information I need to create my own update experience (yet I don't have to do
any of the actual heavy lifting).
In my app, I call `bool UpdateManager.CheckForUpdates("http://mycoolsite.com/releases/")` - similar to ClickOnce API but not awful. The library helps me check for updates, get the ChangeLog HTML to render, and if I'm really lazy, I can just call `UpdateManager.ShowUpdateNotification()` and get a stock WPF dialog walking the user through the upgrade. For production applications, I get the information I need to create my own update experience (yet I don't have to do any of the actual heavy lifting).
When I call `UpdateManager.Upgrade()`, the application does the update in the
background, without disturbing the user at all - the next time the app
restarts, it's the new version.
When I call `UpdateManager.Upgrade()`, the application does the update in the background, without disturbing the user at all - the next time the app restarts, it's the new version.
#### Users
I click on a link, and a setup experience starts up. Instead of the usual
"Next >" buttons, I see a single "Install" button (think Visual Studio 2012 installer).
Clicking that installs and immediately opens the application. No UAC prompts,
no long waits.
I click on a link, and within seconds my application starts. No install experience, no dialogs, no UAC.

View File

@@ -3,22 +3,18 @@
At the end of the day, here's how a developer will use Squirrel:
1. Add the **Squirrel** package to your application
1. As part of the install for Squirrel, NuGet Package Build is enabled in the csproj file
1. As part of the install for Squirrel, NuGet Package Build is enabled in the csproj file
1. The user edits the generated `.nuspec` to specify some details about their app
1. From the NuGet package console, run `New-Release` - this builds the
world, and you end up with a `$SolutionDir/Releases` folder that has both a
Squirrel release package as well as a `Setup.exe`
1. From the NuGet package console, run `New-Release` - this builds the world, and you end up with a `$SolutionDir/Releases/ASSEMBLYNAME` folder that has both a Squirrel release package as well as a `Setup.exe`
## How does this work:
As part of adding Squirrel to your application, a `targets` file gets added to your csproj file. This targets file dumps all of the references in your application to the output directory in a simple text file, as well as a list of files marked as content.
Calling `New-Release` results in this process being kicked off:
1. Call `$DTE` to build the current project, including the NuGet packages
1. Look at all of the projects which have references to `Squirrel.Client`
1. Look up the build output directory for those projects, run
`CreateReleasePackage.exe` on all of the .nupkg files
1. Using the generated NuGet package, fill in the `Template.wxs` file
1. Create a temporary directory for the contents of the Setup.exe, copy in the
`Squirrel.WiXUi.dll` as well as any DLL Project that references
`Squirrel.Client.dll`
1. Run `Candle` and `Light` to generate a `Setup.exe`, which contains
Squirrel.WiXUi.dll and friends, any custom UI DLLs, and the latest full
`nupkg` file.
1. For the current project, run `CreateReleasePackage.exe` to build release and delta packages.
1. Create a Zip file consisting of `update.exe` and the latest full release from `Releases`.
1. Using Win32 API Abuse™, put that into `setup.exe`, a C++ bootstrapper application whose sole goal is to download .NET 4.5, install it, then run update.exe
1. Copy that to the Releases folder.