0% found this document useful (0 votes)
176 views4 pages

Squirrel Installation

This document outlines the steps to create an application setup and manage updates using Squirrel. It involves installing Squirrel, adding update checking code, building and packaging the application into a NuGet package, releasifying the package to generate installation files, and following similar steps for updates. The process automates application distribution and updating.

Uploaded by

Aravind Bs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
176 views4 pages

Squirrel Installation

This document outlines the steps to create an application setup and manage updates using Squirrel. It involves installing Squirrel, adding update checking code, building and packaging the application into a NuGet package, releasifying the package to generate installation files, and following similar steps for updates. The process automates application distribution and updating.

Uploaded by

Aravind Bs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Creating Application Setup with Squirrel

Step 1: Integrating
1.1.Install required packages in the project
PM> Install-Package Squirrel.Windows

1.2. Basic Squirrel.Windows Update Code


Use the below code for checking updates in squirrel. We can use it in the App start of the
project or anywhere which call the update function in a regular interval so our project will have
the latest update. After updating restart the application.
using Squirrel;
using System.Threading.Tasks;

using (var mgr = new UpdateManager("C:\\Projects\\MyApp\\Releases"))


{
await mgr.UpdateApp();
}

Here C:\\Projects\\MyApp\\Releases will be the path which squirrel will check for the update.

Step 2: Packaging
2.1.Building
2.1.1. Set Version - Set the initial application version in
Properties\AssemblyInfo.cs
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]

2.1.2. Switch to Release - switch your build configuration to Release.


2.1.3. Build MyApp - build your application to ensure the latest
changes are included in the package we will be creating.
2.2 Packing
2.2.1 Install NuGet Package explorer in your system.
https://npenightly.blob.core.windows.net/nightly/install.html
2.2.2 Open NuGet Package explorer and create a new NuGet package.
2.2.3 Edit Metadata

• Id - name of the application (no spaces)


• Version - version specified in Properties\Assembly.cs
2.2.4 Add lib & net45 - add the lib folder and the net45 folder to the
project. Squirrel is expecting a single lib / net45 directory provided
regardless of whether your app is a net45 application.

2.2.5 Add Release Files - add all the files from bin\Release (You can
drag and drop also).
a. Exclude: *.vshost.*, *.pdb files
2.2.6 Save the NuGet Package File - save the NuGet package file to
your solution folder. Follow the given naming format (e.g.,
MyApp.1.0.0.nupkg).

2.3 Releasifying

Releasifying is the process of preparing the MyApp.1.0.0.nupkg for


distribution. Use the following command in Nuget console.
PM> Squirrel --releasify MyApp.1.0.0.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.

IMP: After running the above command squirrel will create a new
“Release” folder in solution containing directory.

2.3.1. The realease folder now contains the setup file to install the
application. Simply open setup.msi to install the application.
2.3.2. Distribute the setup.msi to install the application in various
systems.
2.3.3. Creates a %LocalAppData%\MyApp directory for the “MyApp” to be
installed.
3.Updating
If you have a new version to be published(update), follow the below
step. It is similar to creating the installation package.
1. Update MyApp Version - update the application version.
Properties\AssemblyInfo.cs
[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
2. Switch to Release - switch your build configuration to Release.
3. Build - build your application to ensure the latest changes are
included in the package we will be creating.
4. Open Previous NuGet Package - open the previous NuGet package you
created for “MyApp” version 1.0.0.
5. Update Version - update the version in the metadata.
6. Replace Release Files - replace the changed files under
lib\net45. You can simply drag and drop any program specific
files that have changed.
7. 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.
8. Run the following command to releasify the package.
PM> Squirrel --releasify MyApp.1.0.1.nupkg
9. The Releases directory under solution directory now includes the updated files to
distribute to your users.

10. Copy all files from this release folder to the update location
which you are mentioned in the update function in your application.

You might also like