clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
426 stars 39 forks source link

Create dotnet 'tool' to help with running Squirrel #57

Closed caesay closed 2 years ago

caesay commented 2 years ago

A few people have asked for this, but I was not sure how to implement it initially.

The main difficulty is that we want to use the same version of Squirrel.exe that you have installed via a nuget package in your project, so I did not want to ship Squirrel.exe separately.

I can't believe I missed the most obvious solution - which is that the dotnet tool can just be a "stub" which reads the solution/project dependencies in the current working dir, determines what version(s) of Squirrel is installed in the project, locate it in %userprofile% and then just forward all of it's arguments to the correct version of Squirrel.exe.

mungojam commented 2 years ago

Neat idea

By the way, I made our own internal wrapper of squirrel (the original for now) that handles this a different way and does bundle a separate version of the squirrel tool. The benefit is that we can use it as part of our non .net builds by simply adding it as a .net local tool. It's probably a bit niche so not worth worrying about.

I plan to port our wrapper to your great fork and try and contribute some things back assuming I get approval to do so 🙂

caesay commented 2 years ago

@mungojam Neat idea. the dotnet tool can ship a version of Squirrel.exe - in the case that the current directory is not a dotnet solution/project, or the correct version of Squirrel can't be found in %userprofile%, the embedded version can be used.

Definitely happy to accept any contributions back. There have been a great many improvements and architectural changes in this fork (over 300 commits) so feel free to hop in my Discord channel (link on main readme) if you'd like to chat about any changes made, or any ideas you have for future improvement!

caesay commented 2 years ago

This has been delivered in a 3.0.0 unstable release. There is a new dotnet tool csq which is cross platform and is capable of creating Squirrel releases.

A unstable package is published to nuget, to reserve the package ID. It should be fine to use with an older Squirrel version (eg. 2.x) but I would advise against 3.x being used in any production applications.