docs / getting-started / 5-updating.md |
---|
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 Integrating: 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. HH
To release a new update, you must first build, pack, and releasify your updated application.
-
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.
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.exe
file 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
.
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 and 2015.
After packaging the new MyApp version 1.0.1, the Releases
directory has been updated as follows:
- Updated Setup Application - the
Setup.exe
application has been updated to include the latest MyApp version 1.0.1 package. - Updated Files - the
RELEASES
file has been appended to include the newly created full and delta packages.
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
In Step 1. Integrating, 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.
The following steps are performed by the UpdateManager
each time MyApp is executed (see Update Process for details):
- The
UpdateManager
checks theRELEASES
file 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.
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.
Previous: 4. Installing | Return: Table of Contents |
---|