4.6 KiB
| Squirrel.Windows / 1. Getting Started |
|---|
1.5 Updating
The update process uses the update files generated by the Squirrel --releasify process. This includes the RELEASES file as well as versioned full and delta packages as required. The location of where to look for the distributed update files is provided to the UpdateManager in the MyApp code (see code in 1.1 Basic Updating).
Updating MyApp to a new version is the culmination of Integrating, packaging, and distributing after installing MyApp. The process will cause you to revisit the packaging and distributing steps.
New Release Packaging
To release a new update, you must first build, pack, and releasify your updated application.
Building
-
Update MyApp Version - update the application version.
Properties\AssemblyInfo.cs[assembly: AssemblyVersion("1.0.1")] [assembly: AssemblyFileVersion("1.0.1")] -
Switch to Release - switch your build configuration to
Release. -
Build MyApp - build your application to ensure the latest changes are included in the package we will be creating.
Packing
Using NuGet Package Explorer complete the following:
- Open Previous NuGet Package - open the previous NuGet package you created for MyApp version 1.0.0.
- Update Version - update the version in the metadata.
- Replace Release Files - replace the changed files under
lib\net45. You can simply drag and drop any program specific files that have changed (i.e., theMyApp.exefile is the only one that has updated in the example). - Save the NuGet Package File as New Version - use the "Save As..." feature to save the new version of the package
MyApp.1.0.1.nupkg.
Releasifying
Use the Package Manager Console to execute Squirrel.exe --releasify command using the new MyApp.1.0.1.nupkg package.
PM> Squirrel --releasify MyApp.1.0.1.nupkg
Tip: If you get an error stating that ...'Squirrel' is not recognized... then you may simply need to restart Visual Studio so the Package Manager Console will have loaded all the package tools. This behavior has been seen on the Community Edition of VS 2013.
Releasify Output
After packaging the new MyApp version 1.0.1, the Releases directory has been updated as follows:
- Updated Setup Application - the
Setup.exeapplication has been updated to include the latest MyApp version 1.0.1 package. - Updated Files - the
RELEASESfile has been appended to include the newly created full and delta packages.
Distributing the New Release
The Releases directory now includes the updated files to distribute to your users.
Releases Directory
The RELEASES file contains SHA1 hash, filename, and file size for each package. This information is utilized by the application update process.
RELEASES File
E3F67244E4166A65310C816221A12685C83F8E6F MyApp-1.0.0-full.nupkg 600725
0D777EA94C612E8BF1EA7379164CAEFBA6E24463 MyApp-1.0.1-delta.nupkg 6030
85F4D657F8424DD437D1B33CC4511EA7AD86B1A7 MyApp-1.0.1-full.nupkg 600752
Application Updating
In Section 1.1, we configured MyApp to look for and install any updates in the background each time MyApp is executed. In the MyApp example, a path to the Releases directory on the file system was specified.
Updating Process Overview
The following steps are performed by the UpdateManager each time MyApp is executed (see 2.5 More Updating for details):
- The
UpdateManagerchecks theRELEASESfile at the distribution location for any updates. - Any update packages are downloaded and the new MyApp is prepared for execution.
- App shortcuts are updated and old versions of MyApp are cleaned up.
MyApp Example
The first time I run MyApp after providing the update the application is executed like normal.
In the background, MyApp has obtained and applied the updates in the installation directory.
The next time MyApp is executed, it will be the newly installed version.
Additional Update Options
Section 2.5 More Updating will provide additional information about the Squirrel update process.
| Next: 2. Advanced Usage |
|---|



