diff --git a/docs-v3/building.md b/docs-v3/building.md new file mode 100644 index 000000000..f162f66b3 --- /dev/null +++ b/docs-v3/building.md @@ -0,0 +1,68 @@ +# Building Squirrel + +You can compile Squirrel on the command line, or via an alternative IDE like VSC or Rider, but you will need VS2022 installed, or you will need to install all of Squirrel's VS requirements separately. + +## Prerequisites +- Be on Windows 10/11 +- [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) + - **Workload**: Desktop development with C++ + - **Individual**: MSVC v143 x86 / x64 + - **Individual**: C++ MFC for v143 (x86 & x64) + - **Workload**: .NET desktop development + - **Individual**: .NET Framework 4.6.1 SDK + - **Individual**: .NET Framework 4.6.1 targeting pack +- [dotnet 5.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/5.0) +- [dotnet 6.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) + +## Components +- `/vendor` - third party binaries +- `/src/Squirrel` - core Squirrel.Core.dll library, used by installed applications to update. Packaged as .nupkg +- `/src/Squirrel.Tool` - csq locator tool, for building releases. Packaged as .nupkg (dotnet tool) +- `/src/Squirrel.CommandLine` - used by csq +- `/src/Setup` - windows Setup.exe. This is a small self-extractor that runs Update.Windows. +- `/src/StubExecutable` - windows stubs (for running installed apps) +- `/src/Update.Windows` - windows Update.exe, used by installed apps to install updates. Published as single-file exe. +- `/src/Update.OSX` - UpdateMac, used by apps on macOS to install updates. Published as single-file exe. + +## Compiling on the command line + +There is a one-command build script. Use this to test if you are unable to build with Visual Studio, or when distributing squirrel. +> ./build.cmd + +This script will compile the whole solution, package the single-file projects (Update.Windows & Update.OSX) and bundle all the required files into two nupkg's. The two complete nupkg's will be placed in `/build/Release`. + +## Compiling in your favorite IDE + +This should be fairly straight forward. Open the solution file, run the build-all command (usually F6). This will compile all the Squirrel binaries, and will create nupkg's in `/build/Debug`. + +Note that these packages generated on build are incomplete, as they will not contain `Update.exe` or `UpdateMac`. You will need to run the build script if you wish to create a package intended for release. + +## Debugging Squirrel + +You can run any of the Squirrel projects in your debugger with the appropriate command line arguments to find issues or test how Squirrel works. Below is examples on how you might debug various features of squirrel. + +[If you are looking for help troubleshooting an installed application, that is available here.](troubleshooting.md) + +### Package Creation +- Debug csq (src/Squirrel.Tool) with the argument `--csq-embedded` and any other arguments required to create your package. Example: + > `csq --csq-embedded pack -u MyTestApp -v 1.0.1 -p "path-to/files"` + +### Debug Windows Extractor (Setup.exe) +- Compile Setup.exe (src/Setup) in Debug mode +- Attach a package to this binary with csq and the `--debugSetupExe` argument. Example: + > `csq --csq-embedded pack -u MyTestApp -v 1.0.1 -p "path-to/files" --debugSetupExe "path-to/Setup.exe"` +- Run debugger for Setup.exe (without re-compiling) + +### Windows Install (Partial) + +- Create a update package (-full.nupkg) using csq (src/Squirrel.Tool). +- Debug Update.exe (src/Update.Windows) with the arguments `"--install {directoryContainingNupkg}"` + +### Windows Install (Full) + +- Create a Setup bundle using csq (src/Squirrel.Tool). Note the path to generaged Setup.exe, and the `setupBundleOffset` which is printed to the console. +- Debug Update.exe (src/Update.Windows) with the arguments `"--setup {setupExePath} --setupOffset {setupBundleOffset}"` + +## Distributing + +Before distributing a nupkg to end users, it is necessary to code-sign `UpdateMac` with a valid Apple developer certificate, and send it to Apple for notarization. This will need to be performed on a computer running macOS after the nupkg's has been created. \ No newline at end of file diff --git a/docs-v3/readme.md b/docs-v3/readme.md new file mode 100644 index 000000000..035840a03 --- /dev/null +++ b/docs-v3/readme.md @@ -0,0 +1,59 @@ +[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Clowd.Squirrel?style=flat-square)](https://www.nuget.org/packages/Clowd.Squirrel/) + +# Clowd.Squirrel + +Squirrel is both a set of tools and a library, to completely manage both installation and updating your desktop application. + +Feel free to join our discord to recieve updates or to ask questions: + +[![discordimg2](https://user-images.githubusercontent.com/1287295/150318745-cbfcf5d0-3697-4bef-ac1a-b0d751f53b48.png)](https://discord.gg/CjrCrNzd3F) + +## What Do We Want? + +Apps should be as fast easy to install. Update should be seamless like Google Chrome. From a developer's side, it should be really straightforward to create an installer for my app, and publish updates to it, without having to jump through insane hoops. + +* **Integrating** an app to use Squirrel should be extremely easy, provide a client API, and be developer friendly. +* **Packaging** is really easy, can be automated, and supports delta update packages. +* **Distributing** should be straightforward, use simple HTTP updates, and provide multiple "channels" (a-la Chrome Dev/Beta/Release). +* **Installing** is Wizard-Freeā„¢, with no UAC dialogs, does not require reboot, and is .NET Framework friendly. +* **Updating** is in the background, doesn't interrupt the user, and does not require a reboot. + + +## Clowd.Squirrel is now cross-platform + + +## Quick Start Guide! +*This guide contains everything you need to know to publish your first app. I know, it's short and sweet. Squirrel can do lots more than what you see here, so once you've tried the instructions here, check out some of our other docs!* + +### Prerequisites +These are required to build packages with Squirrel, but are not required for applications using Squirrel. +- [Install dotnet 6.0 runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) +- [Install Squirrel Tool (csq)](https://www.nuget.org/packages/csq/) + > dotnet tool install -g csq + +### Adding Squirrel to your App +- Install the [Clowd.Squirrel](https://www.nuget.org/packages/Clowd.Squirrel/) NuGet package +- **IMPORTANT:** Add `SquirrelAwareApp.HandleEvents();` to the beginning of `Main()` + + +### Building a package / installer +Instructions may vary by OS. Consult `csq -h` on your target platform for more info. +```txt +> dotnet publish YourApp.csproj -o ./publish +> csq pack -u YourApp -v 1.0.1 -p ./publish -e YourApp.exe +``` + +### Updating your App +You can host releases in a directory/file share, online on any static web/file server, [Amazon S3](docs/using/amazon-s3.md), BackBlaze B2, or even via [GitHub Releases](docs/using/github.md). + +```cs +private static async Task UpdateMyApp() +{ + using var mgr = new UpdateManager("https://the.place/you-host/releases"); + var newVersion = await mgr.UpdateApp(); + + // You must restart to complete the update. + // This can be done later / at any time. + if (newVersion != null) UpdateManager.RestartApp(); +} +``` \ No newline at end of file diff --git a/docs-v3/troubleshooting.md b/docs-v3/troubleshooting.md new file mode 100644 index 000000000..e69de29bb