Squirrel.Windows: Auto Updating doesn't appear to be working for me

I am new to Squirrel for Windows, but have some exposure to ClickOnce.

General Notes I am using the standard “Releases” folder to host my releases. I have a working web site which looks at a “dist” folder.

Initial Release So after a bit of pain I have something almost working here.

  1. I create the nuspec file
  2. I create the nuget package
  3. I do a release of current app version
  4. Copy from releases to dist folder
  5. run setup.exe from browser

App is install all is good.

New Release

  1. I then edit my codebase to contain the following

        var updateManager = new UpdateManager(@"http://localhost:85/", "SqTest2");
        using (updateManager)
        {
            var updateInfo = await updateManager.CheckForUpdate();
            if (updateInfo == null || !updateInfo.ReleasesToApply.Any())
            {
                return;
            }
            else
            {
                var releases = updateInfo.ReleasesToApply;
                await updateManager.DownloadReleases(releases, _ => { });
                await updateManager.ApplyReleases(updateInfo, _ => { });
            }
        } 
    
  2. I then also change the assembly version

  3. I create the nuget package (this generates full/delta nuget packages)

  4. I do a release of current app version

  5. Copy from releases to dist folder

At this point I am expecting to be able to run installed app, and it auto update to latest version. This does NOT happen, it just runs old version.

Strange thing is, if I just run the web site setup,exe again I do get the latest version.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@shiftkey discussion has ended with no further issues - this can be closed.

I agree this post of mine is hard to follow, but so is the NON existent Squirel documentation 😃

I could not see in your example where you even use the suggested “updateManager” code. I watched a video of Paul Betts showing Scott Hansleman how to use Squirrel. And even in that video he put the code in for UpdateManager, and then went on to comment it out before showing it working.

I basically have it all working apart from the Auto update stuff. I need to try that again. I like how you are creating the Nuget in code though they seems good.

Update

So I just tried exactly the same setup again and it all seems to work now. Only thing I did changed was I wrapped UpdateManager stuff in Task.Run(…).

There is one other issue, when I run the NuGet command line (something like)

squirrel --releasify C:\Users\barbers\Desktop\SqTest2\SqTest2\SqTest2.2.6.0.0.nupkg

I get this exception

Squirrel.com : System.Exception: Couldn’t find file for package in .: squirrel.windowsAt line:1 char:1

  • squirrel --releasify C:\Users\barbers\Desktop\SqTest2\SqTest2\SqTest2.2.6.0.0.nu …

    • CategoryInfo : NotSpecified: (System.Exceptio…quirrel.windows:String) [], RemoteException
    • FullyQualifiedErrorId : NativeCommandError

    at Squirrel.ReleasePackage.<>c__DisplayClass1d.<findAllDependentPackages>b__1a(PackageDependency dependency) at System.Linq.Enumerable.<SelectManyIterator>d__1`2.MoveNext()

    at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Squirrel.ReleasePackage.findAllDependentPackages(IPackage package, IPackageRepository packageRepository, HashSet1 packageCache, FrameworkName frameworkName) at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func2 releaseNotesProcessor, Action1 contentsPostProcessHook) at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe, String backgroundGif, String signingOpts, String baseUrl, String setupIcon) at Squirrel.Update.Program.executeCommandLine(String[] args) at Squirrel.Update.Program.main(String[] args) at Squirrel.Update.Program.Main(String[] args)

Squirrel currently seems to not like having packages.config file present and blows up on that, at least it does for me. If I rename the packages.config when I do a release to XXXpackages.config and all is ok with release process. I then rename it back afterwards. Start my UI and close it, and it auto updates on closing.

All cool

If I could get past this last issue I would be happy