Skip to content

Commit

Permalink
Updating migration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Keboo committed Jan 23, 2025
1 parent 8a2a166 commit ded2195
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions docs/migrating/squirrel.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From Squirrel
<AppliesTo win />
Migrate `Squirrel.Windows` or `Clowd.Squirrel` to Velopack.
Migrate from `Squirrel.Windows` or `Clowd.Squirrel` to Velopack.

Here are the general steps needed:

Expand All @@ -15,7 +15,7 @@ Here are the general steps needed:
Make sure you are using the same version of vpk and the Velopack package, this is the only officially supported configuration.
:::

0. You will need to replace `SquirrelAwareApp` at the beginning of your app to `VelopackApp.Build().Run()`.
0. You will need to replace `Squirrel.SquirrelAwareApp` at the beginning of your app to `Velopack.VelopackApp.Build().Run()`.

Shortcuts [[Read more]](integrating/shortcuts.mdx) and registry entries are managed automatically for you in Velopack, so if you are currently doing this in `SquirrelAwareApp` hooks they should be removed. For example, if your hooks were this before:
```cs
Expand Down Expand Up @@ -54,7 +54,11 @@ Here are the general steps needed:
}
```

0. The concept of `SquirrelAwareApp` no longer exists, so if you've added any attributes, assembly manifest entries, or other files to indicate that your binary is now aware, you can remove that. Every Velopack package has exactly one "VelopackApp" binary, which must implement the above interface at the top of `Main`. By default, Velopack will search for a binary in `{packDir}\{packId}.exe`. If your main VelopackApp exe is named differently, you should provide the name with the `--mainExe yourApp.exe` argument.
0. Velopack hooks no longer support manual creation of shortcuts. Rather these are automatically created/removed for you as part of the installer.

0. Velopack requires the application to be restarted to apply updates. The previous APIs applied the downloaded updates *before* triggering the restart.

0. The concept of `SquirrelAwareApp` no longer exists, so if you've added any attributes, assembly manifest entries, or other files to indicate that your binary is now aware, you can remove that. Every Velopack package has exactly one "VelopackApp" binary, which must implement the above code at the top of `Main`. By default, Velopack will search for a binary in `{packDir}\{packId}.exe`. If your main VelopackApp exe is named differently, you should provide the name with the `--mainExe yourApp.exe` argument.

0. The "RELEASES" file is no longer a format that Velopack uses, but it will produce one when building packages on windows with the default channel (eg. no channel argument provided). Instead, Velopack will produce `releases.{channel}.json` files, which should be treated in the same way. If you are wishing for a legacy windows app to migrate to Velopack, you should publish a release (omitting the `--channel` arg) and upload both the `RELEASES` file and the `releases.win.json` file which is produced by Velopack to your update feed.

Expand All @@ -69,3 +73,17 @@ Here are the general steps needed:
vpk -h
```
0. In your installed app, there are no longer `app-1.0.0` folders, and in a freshly installed app there will not be a `YourApp.exe` in the root of the application. Changing the path of the application (eg. app-1.0.0 and app-1.0.1) like Squirrel does is very bad, it breaks a lot of things in Windows. Firewall rules, antivirus issues, GPU preferences, tray icon pinning, and more. Maintaining the exe location in the same position after each update fixes many issues so velopack will always store your program at `{root}\current\YourApp.exe`. The first time your Squirrel app downloads a Velopack update, the Velopack updater will perform an app migration, it will look for shortcuts in all the usual/default locations and clean them up / repair them to point to the new location. If you previously had file associations or shortcuts outside of default locations pointing to `{root}\YourApp.exe` these will need to be updated since that file will no longer exist in new installs.

## API differences with Clowd.Squirrel
This list is not exhaustive and may change over time. If you have a specific question, please ask in the [Velopack Discord](https://discord.gg/velopack).
For many of these a simple find/replace in your codebase should be sufficient, however, these are merely guidelines and you should review the

0. `ReleaseEntry` class is replaced by `VelopackAsset`
0. `UpdateManager` is no longer disposable. Remove any `using` statements.
0. `UpdateManager.IsInstalledApp` property is renamed to `UpdateManager.IsInstalled`
0. `UpdateManager.CheckForUpdate()` method is renamed to `UpdateManager.CheckForUpdatesAsync()`
0. `UpdateInfo.CurrentlyInstalledVersion` is replaced by checking the `UpdateInfo.BaseRelease`
0. `UpdateInfo.ReleasesToApply` no longer exists, depending on your usage this is replace by either `UpdateInfo.TargetFullRelease` or `UpdateInfo.DeltasToTarget`
0. `UpdateInfo.FutureReleaseEntry` is replaced by `UpdateInfo.TargetFullRelease`
0. `UpdateInfo.Create()` no longer exists, use the constructor directly `new UpdateInfo()`
0. `UpdateManager.DownloadReleases()` is replaced by `UpdateManager.DownloadUpdatesAsync()`

0 comments on commit ded2195

Please sign in to comment.