Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Squirrel' could not be found on WPF .Net Core #1646

Closed
Macaret opened this issue Aug 12, 2020 · 26 comments
Closed

'Squirrel' could not be found on WPF .Net Core #1646

Macaret opened this issue Aug 12, 2020 · 26 comments

Comments

@Macaret
Copy link

Macaret commented Aug 12, 2020

I'm trying yo integrate Squirrel to a WPF project build with .Net Core 3.1. I'm using Visual Studio 2019.

The installation process works successfully with Package Console and Nuget, but when I'm trying to add the reference:

"using Squirrel;"

I'm getting The type or namespace "Squirrel" could not be found.

I tried reinstalling, restarting, etc. Nothing seems to fix the issue.

@lars-29palms
Copy link

Hi, I was dealing with the same issue an hour ago :)
Using version 1.9.0 fixed the issue for me, see: https://github.com/Squirrel/Squirrel.Windows/issues/1374#issuecomment-552361287

@Macaret
Copy link
Author

Macaret commented Aug 12, 2020

You are right. Thanks!

@Macaret Macaret closed this as completed Aug 12, 2020
@legistek
Copy link

legistek commented Oct 8, 2021

Hey if anyone is still following this issue I'm confused - when I add Squirrel to my .NET 5 project it says it's being restored using .NET Framework and probably won't work. And yet it does seem to work. So does Squirrel support .NET Core/5 WPF apps?

@lars-29palms
Copy link

@legistek I think it is using the existing installation of .NET Framework in that case. So if the project (in this case Squirrel) does not support .NET 5 or .NET Core it can still be used and deployed but relies on the target Framework being installed on the end user's computer

@legistek
Copy link

Oh I see. Thanks for that info. Unfortunately Releasify won't work properly with .NET5 assemblies though, so it doesn't appear I can use Squirrel at all. I'm moving onto MSIX. Shame, this was such a good installer.

@robmen
Copy link
Contributor

robmen commented Oct 10, 2021

That's actually a big question I have. How much more investment should we do in Squirrel (say, a v3) if people are going to start moving to MSIX. What was keeping you on Squirrel if you can simply choose to switch to MSIX? Why should we keep investing in Squirrel (and I mean that honestly, not snarkily)?

PS: I have ideas but I'm very interested in understanding what users are thinking.

@legistek
Copy link

Well, I really like Squirrel and have used it for 4 years for my wpf app. I'd prefer to keep using it over msix but have been forced to upgrade to .net5 at long last. Since I can't seem to get Squirrel working with it and it doesn't sound like there are any plans to make it work with .Net 5/6+ it doesn't seem like I have another option.

But there are definitely things about MSIX I don't like. The sandbox thing makes me nervous. Will people have installation problems if they don't have developer mode? Seems like a remnant of Metro that won't die. Microsoft keeps changing its app ecosystem almost yearly so who knows if MSIX will even be a thing in a year or two. Also Squirrel is truly one click; MSIX is not. I can't add a desktop icon. Etc etc etc.

I could go on, but I'd really love if you guys just updated Squirrel to work with .net5+. But I realize you're not making money off this so I cant blame you for moving on. I can just say thanks for what you did.

@robmen
Copy link
Contributor

robmen commented Oct 10, 2021

First, @anaisbetts did all the work and she deserves nearly all the credit (the rest of the credit goes to all that submitted features/fixes 👍🏻). I've barely gotten started.

I share many of your concerns about MSIX and while I fully support it and MSI (via my work on the @wixtoolset), I wonder if there is a need for an independent installation engine that advances with the needs of developers. I've just started conversations with @anaisbetts about "Squirrel v3" and one very big question is: Do developers care enough about the installation engine to support its development... or is something like MSIX good enough?

There are some fixes around Squirrel v2 to better handle .NET 5 but it's slow going, a lot because there isn't an answer to the question above. I'm trying to build confidence before jumping into a Squirrel v3.

@nickhodge
Copy link

I love @anaisbetts work. When you look at Squirrel there are many moving parts that work together to make a superb auto-updating installation engine.

It have used it in a variety of products with great success -- once you get your head around the "devops" process.

These products are WPF / .NET Framework 4.7 related due to technical debt, use of lower-level Windows features.

There are downsides and technical "cliffs" that do concern me about the future of Squirrel and auto-updaters in general

  • increasing security concerns: especially related to anti-virus tools thumbprinting Squirrel's entry .exe (possibility related to bad actors using Squirrel to do nefarious things?)
  • Microsoft hardening and changing the operating system to stop background installers

I, like other commenters here, am confused about the desktop app installer strategy from Microsoft.

The core use-case for Squirrel is easy auto-update from an internet source.

What Microsoft endorsed product/service/format/standard is correct? Is it MSIX? Is it Winget? Is it the Store?

Or is the future PWAs?

Unsurprisingly in the Microsoft world, it is all very opaque and noone knows nor can give a clear answer.

@robmen
Copy link
Contributor

robmen commented Oct 10, 2021

Thanks, @nickhodge. I'm less concerned about the two bullet points you raise because we build larger installation systems for very large customers that use the same techniques that Squirrel uses. If those techniques were banned, I'm confident there would be much breakage in the "World of Windows". Of course, you do still need to sign binaries and (sometimes) submit false positives to anti-virus companies.

I guess I'm curious what do people want? Or does not really matter... i.e. whatever exists for free and basically works will do.

I really should find a place to put this question that isn't on a closed issue :)

@lars-29palms
Copy link

@robmen Other solutions existed for free as well when I chose Squirrel, I really like its simplicity and although it's "convention over configuration" (so to speak) its still relatively flexible.
I still remember looking for installation / update methods back in the day, they all had drawbacks which I didn't like. May it be no auto-update, installation dialogs or a complicated deployment process.
So although I was forced to use Squirrel v1.9.0 with my .NET Core 3.1 WPF project due to compatibility issues, and still can't use features like the "SquirrelAwareApp", I would choose it again anytime.

Boiling it down, the core advantages are:

  • The philosophy "as little user interaction as possible"
  • The easy, command line Releasify/build process with code signing of all assemblies and the installer
  • Very easy update process which can be initiated by simply calling the Update.exe or even in code with the UpdateManager
  • Using nupkg as the basis/source feels natural
  • Desktop shortcut, entry in the Add/Remove programs menu - don't have to worry about anything

When displaying an image during installation similar to the Splashscreen of the app, installing it feels like launching the app, it just takes a bit longer. This is just how it should be! If you don't have to deploy a complicated app where the user HAS to configure it during installation, the installation process should be as silent as possible. And that's precisely what Squirrel does.

Many years ago, I remember choosing portable applications anytime I could since I was afraid that conventional installations could litter my PC - installing with Squirrel feels like launching a portable app :)

@legistek
Copy link

@lars-29palms how did you get it working (even 1.9.0) with a .net core wpf app? I couldn't get Releasify to work on the assemblies.

@lars-29palms
Copy link

@legistek Which error did you get? I don't remember any problems, I think it worked right from the start. Happy to share some code if you like

@mikhail-khalizev
Copy link

mikhail-khalizev commented Oct 17, 2021

Just note. When I add these lines to the .csproj the project builds successfully.

  <ItemGroup>
    <Reference Include="Squirrel">
      <HintPath>$(UserProfile)\.nuget\packages\squirrel.windows\2.0.1\lib\Net45\Squirrel.dll</HintPath>
    </Reference>
  </ItemGroup>

@legistek
Copy link

Sorry to drop off for awhile, got sidetracked.

Perhaps I'm doing something wrong but I'd really love to still be able to use Squirrel with my WPF .NET5 app, even if it's not the newest version of Squirrel. Can anyone confirm whether this is actually possible and if so provide step by step instructions? There seems to be a bit of confusion on this - at least on my part. :) Thanks!

@anaisbetts
Copy link
Contributor

@legistek afaik @AArnott fixed this, it'll come out in the next release whenever I stop being lazy and make a release 🤣

@legistek
Copy link

Oh, is that right? Then I anxiously await that release. :D Appreciate your efforts, I know this is a free project.

@legistek
Copy link

@anaisbetts hey I hate to be that guy but realistically do you have any sense when that might be? I'm looking to release the .net5 version of my app to user testing within the next couple weeks and am just trying to decide if I should go with MSIX or holdout for Squirrel. Still prefer the latter, but hard to go back if I have to switch to msix since all users will have to reinstall.

No worries either way I just need to plan. Thank you!

@AArnott
Copy link
Contributor

AArnott commented Oct 23, 2021

@legistek If you want you can use my private build from this feed.
It includes my fixes that have already merged upstream plus #1692 which I found to be necessary for .NET 5 support.

@legistek
Copy link

Hi @AArnott thank you so much for publishing that! It looks like it's working great.

Have you tried it with .NET6 by chance?

@AArnott
Copy link
Contributor

AArnott commented Oct 25, 2021

No. Only tested with .NET 5.

@legistek
Copy link

legistek commented Nov 8, 2021

@AArnott thank you so much. After several weeks of having this in our dev environment everything is working fine and we'll be able to stick with Squirrel for the time being. Would love to see this in the official release. Thanks again!

@legistek
Copy link

Thought I should mention @AArnott's solution works great with .NET6 as well. Thanks again!

@user16307
Copy link

Hi all I try @AArnott's solution but when I run PM> Install-Package squirrel.windows -version 2.0.2-netcore , I get the error:

Restoring packages for C:\Users\h2so4\OneDrive\Documents\Visual Studio 2022\Projects\Extras\WpfTestGitSqu\WpfTestGitSqu\WpfTestGitSqu.csproj...
GET https://api.nuget.org/v3-flatcontainer/squirrel.windows/index.json
OK https://api.nuget.org/v3-flatcontainer/squirrel.windows/index.json 2829ms
Install-Package : NU1102: Unable to find package squirrel.windows with version (>= 2.0.2-netcore)

  • Found 76 version(s) in nuget.org [ Nearest version: 2.0.1 ]
  • Found 0 version(s) in Microsoft Visual Studio Offline Packages
    At line:1 char:1
  • Install-Package squirrel.windows -version 2.0.2-netcore
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
    
    

Install-Package : Package restore failed. Rolling back package changes for 'WpfTestGitSqu'.
At line:1 char:1

  • Install-Package squirrel.windows -version 2.0.2-netcore
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
    

@AArnott
Copy link
Contributor

AArnott commented May 21, 2023

@user16307 Per my comment above, you need to install the package from my feed -- not nuget.org, since it's not an official version.

@caesay
Copy link

caesay commented May 28, 2023

My fork is also fairly popular and supports .net 6/7 etc. Works both with self contained or framework dependent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants