### Example Install Directory Structure Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/install-process.md Illustrates the typical folder structure within the user's local application data directory after installation. ```text %LocalAppData%\MyApp \packages MyApp-1.0.0.nupkg MyApp-1.0.1-delta.nupkg MyApp-1.0.1.nupkg \app-1.0.0 MyApp.exe \app-1.0.1 MyApp.exe ``` -------------------------------- ### Simulate Squirrel Install and First Run Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/debugging-installs.md Execute the Squirrel install and first run commands from the command line to simulate the application installation process. This helps in debugging installation issues by observing the behavior of Update.exe. ```powershell C:\user\AppData\Local\MyApp> Update.exe --squirrel-install 1.0.0 C:\user\AppData\Local\MyApp> Update.exe --squirrel-firstrun ``` -------------------------------- ### Example .nuspec File for MyApp Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/visual-studio-packaging.md This is an example .nuspec file used for defining the metadata and files for a NuGet package. The version number in this file will be replaced by MSBuild during the build process. ```xml MyApp 0.0.0.0 title authors description false Copyright 2016 ``` -------------------------------- ### Install Squirrel.Windows NuGet Package Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/getting-started/1-integrating.md Use the Package Manager Console in Visual Studio to install the Squirrel.Windows NuGet package. This is the recommended method for adding Squirrel.Windows to your solution. ```powershell PM> Install-Package Squirrel.Windows ``` -------------------------------- ### Install NuGet CommandLine Package Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/visual-studio-packaging.md To ensure nuget.exe is available for your build process, install the 'NuGet.CommandLine' package in your solution using the Package Manager Console. ```powershell Install-Package NuGet.CommandLine ``` -------------------------------- ### ApplyReleases Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/update-manager.md Installs the downloaded packages and returns the new app version directory path. ```APIDOC ## ApplyReleases ### Description Installs the downloaded packages, and returns the new `app-[version]` directory path. ### Method Not specified (assumed to be a direct invocation). ### Endpoint Not applicable (SDK method). ### Parameters None explicitly documented. ### Request Example Not applicable. ### Response #### Success Response - **string** - The new `app-[version]` directory path. ``` -------------------------------- ### GitHub API Example URL Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/github.md This URL demonstrates how to fetch release information for a specific GitHub repository using the GitHub API. It returns a JSON list of all release information. ```url https://api.github.com/repos/Squirrel/Squirrel.Windows/releases ``` -------------------------------- ### Specify Loading GIF for Squirrel Installer Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/loading-gif.md Use the `-g` parameter with the `Squirrel --releasify` command to specify the path to your loading GIF. This GIF will be displayed as a splash screen during installation if it exceeds a certain time. ```powershell PM> Squirrel --releasify MyApp.1.0.0.nupkg -g .\loading.gif ``` -------------------------------- ### Verify Group Policy Blocking Installation Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/faq.md Execute Update.exe from the command line to confirm if Group Policy is preventing Squirrel installations by disallowing executables from %LocalAppData%. ```powershell C:\>%LocalAppData%\MyApp\Update.exe This program is blocked by group policy. For more information, contact your system administrator. ``` -------------------------------- ### Implementing SquirrelAwareApp Helper Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/custom-squirrel-events.md Use the `SquirrelAwareApp` helper class in your C# application's Main method to handle initial installation, updates, uninstallation, and first-run scenarios. Ensure `HandleEvents` is called as early as possible in the application's startup. ```csharp static bool ShowTheWelcomeWizard; ... static int Main(string[] args) { // NB: Note here that HandleEvents is being called as early in startup // as possible in the app. This is very important! Do _not_ call this // method as part of your app's "check for updates" code. using (var mgr = new UpdateManager(updateUrl)) { // Note, in most of these scenarios, the app exits after this method // completes! SquirrelAwareApp.HandleEvents( onInitialInstall: v => mgr.CreateShortcutForThisExe(), onAppUpdate: v => mgr.CreateShortcutForThisExe(), onAppUninstall: v => mgr.RemoveShortcutForThisExe(), onFirstRun: () => ShowTheWelcomeWizard = true); } } ``` -------------------------------- ### Basic C# Code Example Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/x-doc-template.md A simple C# code snippet. ```cs code ``` -------------------------------- ### Releasify NuGet Package Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/getting-started/2-packaging.md Use the Squirrel.exe tool via the Package Manager Console to prepare your NuGet package for distribution. This command generates setup files and release metadata. ```powershell PM> Squirrel --releasify MyApp.1.0.0.nupkg ``` -------------------------------- ### Check if App is Squirrel Installed (C#) Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/faq.md Use this C# code to check if the current application was installed using Squirrel by verifying the existence of Update.exe in the parent directory. ```csharp var assembly = Assembly.GetEntryAssembly(); var updateDotExe = Path.Combine(Path.GetDirectoryName(assembly.Location), "..", "Update.exe"); var isSquirrelInstall = File.Exists(updateDotExe); ``` -------------------------------- ### Application Shortcut Target and Start in Directory Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/install-process.md Specifies the target executable and the working directory for application shortcuts created by Squirrel.Windows. ```text Target: C:\Users\kbailey\AppData\Local\MyApp\Update.exe --processStart MyApp.exe Start in: C:\Users\kbailey\AppData\Local\MyApp\app-1.0.0 ``` -------------------------------- ### UpdateInfo Class Definition Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/update-manager.md Defines the structure for holding information about available and installed application releases. ```csharp public class UpdateInfo { public ReleaseEntry CurrentlyInstalledVersion; public ReleaseEntry FutureReleaseEntry; public List ReleasesToApply; } ``` -------------------------------- ### Disable MSI Generation with --no-msi Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/machine-wide-installs.md Use the --no-msi flag with the Squirrel releasify command to prevent the generation of MSI files. This is useful when you only want to produce EXE installers. ```powershell PM> Squirrel --releasify MyApp.1.0.0.nupkg --no-msi ``` -------------------------------- ### Basic Squirrel.Windows Update Code Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/getting-started/1-integrating.md Add this C# code to your application's Program.cs to enable background checking, downloading, and installation of updates. Ensure the path provided to UpdateManager points to the directory containing the RELEASES file. ```csharp using Squirrel; using System.Threading.Tasks; // ... using (var mgr = new UpdateManager("C:\\Projects\\MyApp\\Releases")) { await mgr.UpdateApp(); } ``` -------------------------------- ### Build Squirrel.Windows from Source Source: https://github.com/squirrel/squirrel.windows/blob/develop/README.md Clone the repository and run the development build script to build Squirrel.Windows. Ensure the --recursive flag is used during cloning to include submodules. ```shell git clone --recursive https://github.com/squirrel/squirrel.windows cd squirrel.windows devbuild.cmd ``` -------------------------------- ### Squirrel Command Line Help Output Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/squirrel-command-line.md Displays the available commands and options for the Squirrel.exe command-line tool, primarily for creating releases. Use this to understand the parameters for managing release directories and package generation. ```bash Usage: Squirrel.exe command [OPTS] Creates Squirrel packages Commands --releasify=VALUE Update or generate a releases directory with a given NuGet package Options: -h, -?, --help Display Help and exit -r, --releaseDir=VALUE Path to a release directory to use with Releasify -p, --packagesDir=VALUE Path to the NuGet Packages directory for C# apps --bootstrapperExe=VALUE Path to the Setup.exe to use as a template -g, --loadingGif=VALUE Path to an animated GIF to be displayed during installation -n, --signWithParams=VALUE Sign the installer via SignTool.exe with the parameters given --setupIcon=VALUE Path to an ICO file that will be used for the Setup executable's icon -b --baseUrl=VALUE Provides a base URL to prefix the RELEASES file packages with --no-msi Don't generate an MSI package --msi-win64 Mark the MSI as 64-bit, which is useful in Enterprise deployment scenarios --no-delta Don't generate delta packages to save time --framework-version=VALUE Set the required .NET framework version, e.g. net461 ``` -------------------------------- ### Clone Squirrel.Windows and Initialize Submodules Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/contributing/building-squirrel.md Clone the repository and ensure all submodules are updated. This is a critical step often missed. Finally, run the development build script. ```shell git clone https://github.com/squirrel/squirrel.windows cd squirrel.windows git submodule update --init --recursive ## THIS IS THE PART YOU PROBABLY FORGOT devbuild.cmd ``` -------------------------------- ### Sign Application with Squirrel CLI Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/application-signing.md Use this command to sign your application's executables and the final Setup.exe when releasifying a package. Ensure you have a valid code-signing certificate and provide its details via the -n parameter. ```powershell PM> Squirrel --releasify MyApp.1.0.0.nupkg -n "/a /f CodeCert.pfx /p MySecretCertPassword /fd sha256 /tr http://timestamp.digicert.com /td sha256" ``` -------------------------------- ### Initial RELEASES file entry Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/staged-rollouts.md This is the initial entry in the RELEASES file for a specific version of your application. ```text e3f67244e4166a65310c816221a12685c83f8e6f myapp-1.0.0-full.nupkg 600725 ``` -------------------------------- ### Increasing Rollout to 50% of Users Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/staged-rollouts.md Update the RELEASES file to increase the staged rollout to 50% of users. Ensure the `# nn%` syntax is correctly formatted. ```text e3f67244e4166a65310c816221a12685c83f8e6f myapp-1.0.0-full.nupkg 600725 0d777ea94c612e8bf1ea7379164caefba6e24463 myapp-1.0.1-delta.nupkg 6030# 50% 85f4d657f8424dd437d1b33cc4511ea7ad86b1a7 myapp-1.0.1-full.nupkg 600752# 50% ``` -------------------------------- ### Staged Rollout to 10% of Users Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/staged-rollouts.md Manually edit the RELEASES file to distribute a new version to 10% of your userbase. Note the `# 10%` syntax. ```text e3f67244e4166a65310c816221a12685c83f8e6f myapp-1.0.0-full.nupkg 600725 0d777ea94c612e8bf1ea7379164caefba6e24463 myapp-1.0.1-delta.nupkg 6030# 10% 85f4d657f8424dd437d1b33cc4511ea7ad86b1a7 myapp-1.0.1-full.nupkg 600752# 10% ``` -------------------------------- ### GitHub Latest Release Link Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/github.md This is a static link to a GitHub repository's latest release page. It redirects users to the page where they can download the Setup.exe. ```url https://github.com/myuser/MyApp/releases/latest ``` -------------------------------- ### Full Release to 100% of Users Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/staged-rollouts.md Remove the percentage specifiers from the RELEASES file to release the version to 100% of users. This indicates the staged rollout is complete. ```text e3f67244e4166a65310c816221a12685c83f8e6f myapp-1.0.0-full.nupkg 600725 0d777ea94c612e8bf1ea7379164caefba6e24463 myapp-1.0.1-delta.nupkg 6030 85f4d657f8424dd437d1b33cc4511ea7ad86b1a7 myapp-1.0.1-full.nupkg 600752 ``` -------------------------------- ### Enable OctoPack in .csproj Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/octopack.md If you are building with Visual Studio, include this property group in your .csproj file to enable OctoPack. ```xml true ``` -------------------------------- ### Define Visual Studio Build Target Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/visual-studio-packaging.md This XML snippet defines a build target in a .csproj file that runs after the build. It generates a NuGet package and then uses Squirrel to create release files. Ensure your project is configured for a 'Release' configuration. ```xml ``` -------------------------------- ### Add Squirrel Packaging Step to TeamCity Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/teamcity.md Use this command line build process in TeamCity to releasify your NuGet package. Ensure the path to squirrel.exe is correct for your project structure. ```bash %system.teamcity.build.workingDir%\packages\squirrel.windows.1.4.0\tools\squirrel --releasify [BUILD_SERVER_NUPKG_PATH]\%system.build.number%.nupkg -r [OUTPUT_PATH] ``` -------------------------------- ### Integrate Squirrel Signing into Visual Studio Build Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/application-signing.md This XML snippet shows how to integrate Squirrel application signing into your Visual Studio build process. It uses MSBuild targets to pack your application and then sign it using Squirrel, handling certificate paths and passwords, including those with spaces. ```xml ``` -------------------------------- ### DownloadReleases Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/update-manager.md Downloads release files from the server to the local machine. ```APIDOC ## DownloadReleases ### Description Downloads release files (the `nupkg` file deltas) from the server to the local machine. ### Method Not specified (assumed to be a direct invocation). ### Endpoint Not applicable (SDK method). ### Parameters None explicitly documented. ### Request Example Not applicable. ### Response Not explicitly documented. ``` -------------------------------- ### Releasify Application Package Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/getting-started/5-updating.md Use the Squirrel.exe --releasify command in the Package Manager Console to generate release files for a new application version. ```powershell PM> Squirrel --releasify MyApp.1.0.1.nupkg ``` -------------------------------- ### IIS Web.config for .nupkg MIME Type Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/microsoft-iis.md Add this Web.config file to your downloads repository to ensure IIS serves .nupkg files correctly. It maps the .nupkg extension to the application/zip MIME type and a default extension to text/plain. ```xml ``` -------------------------------- ### OctoPack Files Specification Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/octopack.md Add this to your .nuspec file to ensure Squirrel's expected .nupkg structure is matched. It specifies which files to include and exclude. ```xml ``` -------------------------------- ### Add SquirrelAwareVersion to Resource File Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/custom-squirrel-events-non-cs.md Add the 'SquirrelAwareVersion' entry with a value of '1' to your application's resource file (e.g., App.rc) to make it Squirrel-aware. This is typically done within the 'StringFileInfo' block. ```rc BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "Installer for Squirrel-based applications" VALUE "FileVersion", "0.5.0.0" VALUE "InternalName", "Setup.exe" VALUE "LegalCopyright", "Copyright (C) 2014" VALUE "OriginalFilename", "Setup.exe" VALUE "ProductName", "Squirrel-based application" VALUE "ProductVersion", "0.5.0.0" VALUE "SquirrelAwareVersion", "1" END END ``` -------------------------------- ### Set Application Version Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/getting-started/2-packaging.md Specify the application version in the AssemblyInfo.cs file. This version is used when creating the NuGet package. ```csharp [assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0")] ``` -------------------------------- ### RELEASES File Content Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/getting-started/5-updating.md The RELEASES file contains SHA1 hash, filename, and file size for each package. This information is utilized by the application update process. ```text E3F67244E4166A65310C816221A12685C83F8E6F MyApp-1.0.0-full.nupkg 600725 0D777EA94C612E8BF1EA7379164CAEFBA6E24463 MyApp-1.0.1-delta.nupkg 6030 85F4D657F8424DD437D1B33CC4511EA7AD86B1A7 MyApp-1.0.1-full.nupkg 600752 ``` -------------------------------- ### UpdateApp Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/update-manager.md Downloads and updates the app to the latest version using the Easy Mode method. ```APIDOC ## UpdateApp ### Description Downloads and updates the app to the latest version. ### Method Not specified (assumed to be a direct invocation). ### Endpoint Not applicable (SDK method). ### Parameters None explicitly documented. ### Request Example Not applicable. ### Response Not explicitly documented. ``` -------------------------------- ### ReleaseEntry Interface Definition Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/update-manager.md Defines the contract for release entry details, including SHA1 hash, filename, and file size. ```csharp public interface ReleaseEntry { public string SHA1; public string Filename; public long Filesize; public bool IsDelta; } ``` -------------------------------- ### Update Assembly Version Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/getting-started/5-updating.md Update the AssemblyVersion and AssemblyFileVersion in the AssemblyInfo.cs file to reflect the new application version. ```csharp [assembly: AssemblyVersion("1.0.1")] [assembly: AssemblyFileVersion("1.0.1")] ``` -------------------------------- ### CheckForUpdate Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/update-manager.md Checks the server for available updates and returns an UpdateInfo object. ```APIDOC ## CheckForUpdate ### Description Checks on the server if there are updates available. Returns an `UpdateInfo` object that contains information about any pending updates. ### Method Not specified (assumed to be a direct invocation). ### Endpoint Not applicable (SDK method). ### Parameters None explicitly documented. ### Request Example Not applicable. ### Response #### Success Response - **UpdateInfo** (object) - Contains information about available and installed releases. ``` -------------------------------- ### Marking App as Squirrel Aware Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/custom-squirrel-events.md Add this assembly metadata to your app's AssemblyInfo.cs file to indicate that your application is Squirrel-Aware. This is a prerequisite for handling custom Squirrel events. ```csharp [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")] ``` -------------------------------- ### Removed Logging Overloads in Castle.Core Source: https://github.com/squirrel/squirrel.windows/blob/develop/test/Squirrel.Tests/fixtures/packages/Castle.Core.3.2.0/BreakingChanges.txt Overloads of logging methods that did not include 'Format' in their name have been removed to reduce confusion. Use methods with 'Format' in their name, such as ErrorFormat, instead. ```csharp void Error(string format, params object[] args); // was removed ``` ```csharp void ErrorFormat(string format, params object[] args); //use this one instead ``` -------------------------------- ### Catching Update Exceptions with UpdateManager Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/debugging-updates.md Use this snippet to catch exceptions during the application update process. Ensure the correct release path is provided to the UpdateManager. ```csharp using (var mgr = new UpdateManager("C:\\Projects\\MyApp\\Releases")) { await mgr.UpdateApp(); } ``` -------------------------------- ### Using GitHubUpdateManager in C# Source: https://github.com/squirrel/squirrel.windows/blob/develop/docs/using/github.md Replace the default UpdateManager with GitHubUpdateManager when integrating Squirrel into your application to use GitHub release assets for distribution. Ensure the provided URL does not end with a forward slash. ```csharp using Squirrel; using System.Threading.Tasks; using (var mgr = UpdateManager.GitHubUpdateManager("https://github.com/myuser/myapp")) { await mgr.Result.UpdateApp(); } ``` -------------------------------- ### Renamed IProxyGenerationHook Method Source: https://github.com/squirrel/squirrel.windows/blob/develop/test/Squirrel.Tests/fixtures/packages/Castle.Core.3.2.0/BreakingChanges.txt The NonVirtualMemberNotification method on IProxyGenerationHook has been renamed to NonProxyableMemberNotification to more accurately reflect its purpose, which now includes fields and other members that break abstraction for class proxies. Implementors should update their code to accommodate this change and handle MethodInfos appropriately. ```csharp IProxyGenerationHook.NonVirtualMemberNotification method was renamed ``` ```csharp to NonProxyableMemberNotification ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.