|docs / getting-started / 2-packaging.md|
Step 2. Packaging
Packaging is the process of building, packing, and preparing MyApp release packages for distribution.
The first step in preparing the application for distribution is to build the application.
Set MyApp Version - set the initial application version.
[assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0")]
Switch to Release - switch your build configuration to
Build MyApp - build your application to ensure the latest changes are included in the package we will be creating.
Squirrel uses NuGet for bundling application files and various application properties (e.g., application name, version, description) in a single release package.
Section NuGet Package Metadata provides additional details on using NuGet and
.nuspec files to automate the packing of your application. We will be going through the process using the NuGet Package Explorer to manually create a NuGet package.
- Creating a New NuGet Package - the first step is to create a new NuGet package.
- Edit Metadata - update package metadata for MyApp.
- Id - name of the application (no spaces)
- Version - version specified in
- Dependencies - Squirrel expects no dependencies in the package (all files should be explicitly added to the package)
- Add lib & net45 - add the
libfolder and the
net45folder to the project. Squirrel is expecting a single
lib / net45directory provided regardless of whether your app is a
- Add Release Files - add all the files from
bin\Releaseneeded by MyApp to execute (including the various files required by Squirrel).
- Include MyApp Files: MyApp.exe, MyApp.exe.config, any non-standard .NET dll's needed by MyApp.exe.
- Include Squirrel Files: Squirrel.dll, Splat.dll, NuGet.Squirrel.dll, Mono.Cecil.*, DeltaCompressonDotNet.*, ICSharpCode.SharpZipLib.*
- Exclude: *.vshost.*, *.pdb files
- Save the NuGet Package File - save the NuGet package file to where you can easily access later (e.g.,
MyApp.slndirectory). Follow the given naming format (e.g.,
Releasifying is the process of preparing the
MyApp.1.0.0.nupkg for distribution.
You use the
Squirrel.exe tool that was included in the Squirrel.Windows package you installed in the
Use the Package Manager Console to execute
Squirrel.exe --releasify command.
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.
Squirrel --releasify command completes the following:
ReleasesDirectory - creates a Releases directory (in the
MyApp.slndirectory by default).
Setup.exe- creates a
Setup.exefile which includes the latest version of the application to be installed.
RELEASESFile - creates a file that provides a list of all release files for MyApp to be used during the update process
MyApp.1.0.0-full.nupkg- copies the package you created to the
MyApp.*.*.*-delta.nupkg- if you are releasing an update, releasify creates a delta file package to reduce the update package size (see Updating for details).
- Visual Studio Build Packaging - integrating NuGet packaging into your visual studio build process to include packing and releasifying.
|Previous: 1. Integrating||Next: 3. Distributing|