Files
velopack/docs/2.1-Integrating-Custom-Events-Non-CS.md
Ken Bailey 49b6b866bb Reformatting of docs with a Getting Started and Advanced topics section.
Removed /specs help files to avoid confusion.
2015-12-23 22:54:50 -07:00

2.0 KiB

Squirrel.Windows / 2. Advanced Usage / 2.1 More Integrating

2.1 Integrating: Custom Squirrel Events (Non-C# Apps)

Squirrel events allow you to handle custom events around the installation and updating process.

Making Your App Squirrel Aware

Add an entry to the English Version Block info called "SquirrelAwareVersion" with a value of "1". Typically this is done via the "App.rc" resource file. Here's a typical entry:

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

Application Startup Commands

This means that this EXE will be executed by the installer in a number of different scenarios, with special flags - you should handle them correctly:

  • --squirrel-install x.y.z.m - called when your app is installed. Exit as soon as you're finished setting up the app
  • --squirrel-firstrun - called after everything is set up. You should treat this like a normal app run (maybe show the "Welcome" screen)
  • --squirrel-updated x.y.z.m - called when your app is updated to the given version. Exit as soon as you're finished.
  • --squirrel-obsolete x.y.z.m - called when your out-of-date app is no longer the newest version. Exit as soon as you're finished.
  • --squirrel-uninstall x.y.z.m - called when your app is uninstalled. Exit as soon as you're finished.

See Also


Return: 2.1 More Integrating