Closed sachabarber closed 5 years ago
The HTTP URL is obscuring what's going on a bit, can you just use a path instead to illustrate where you're pulling updates from?
So I have a web site which is http://localhost (port 85) which is set up to point to the folder C:\Users\barbers\Desktop\SqTest2\dist. The new releases are built to C:\Users\barbers\Desktop\SqTest2\Releases which for me right now contains the following list of files
I then copy all of these to the "dist" folder C:\Users\barbers\Desktop\SqTest2\dist (which acts as the folder for the IIS web site).
Do you need more information than that? Are you saying the autoupdater stuff in the app should be pointing to an actual path? That doesn't make too much sense to me, I would think this should be a url of well known web site.
Like I say though, I a completely new to Squirrel for Windows, and just want to get it working as I loath Mage.exe (lost more hours to that EXE than I care to mention)
Are you saying the autoupdater stuff in the app should be pointing to an actual path? That doesn't make too much sense to me, I would think this should be a url of well known web site.
In production, the autoupdater stuff will point to an HTTPS URL, just like you've set it up. However, when you're testing updates locally, you can instead just point it to a local folder, because that's way easier to set up / debug, than spinning up a dummy HTTP server
What happens to your local installed app folder when you run the code (i.e. C:\Users\NAME\AppData\Local\SqTest2
? Do you see a new app-VERSION
folder?)
Yes I see a folder called this
C:\Users\barbers\AppData\Local\SqTest2
Which contains the following files
@sachabarber Ok - what does your app's shortcut point to?
I am not at work now (where I am trying this all out). I suspect I just need to change the auto updater to use a folder. The web site I setup is not HTTPS, it is standard HTTP.
I'll try and get it working with directory auto updater, and if that works I plan to write this all up in a semi-useful guide.
It looks very promising, but could be documented a bit better (sorry dude). It is good work no doubt there, just a bit hard to piece the bits together so far.
Paul
So I check out where the app shortcut was pointing to. It points to the folder
C:\Users\barbers\AppData\Local\SqTest2
So I tried using that for the UpdateManager path instead of web Url. So I then made a new release, and copied the auto generated release folder items to the path
C:\Users\barbers\Desktop\SqTest2\dist
I then ran the setup.exe from that path. This installed everything fine. I then tried to run the installed app. When I start the app, it crashed saying the following
System.Exception: The file C:\Users\barbers\AppData\Local\SqTest2\RELEASES does not exist, something is probably broken with your application
at Squirrel.UpdateManager.CheckForUpdateImpl.
At this point the installed app is configured to have its update path set to C:\Users\barbers\AppData\Local\SqTest2, and the shortcut also points to this folder.
I then checked the C:\Users\barbers\AppData\Local\SqTest2, and it does not contains a folder for the current release, or even a file called "RELEASES". The auto generated "RELEASES" folder (which for me is this path) C:\Users\barbers\Desktop\SqTest2\Releases does contain that file. In fact here is everthing is contains for current release
RELEASES
Setup.exe
SqTest2-1.8.0.0-full.nupkg
SqTest2-1.9.0.0-delta.nupkg
SqTest2-1.9.0.0-full.nupkg
SqTest2-2.0.0.0-delta.nupkg
SqTest2-2.0.0.0-full.nupkg
SqTest2-2.1.0.0-delta.nupkg
SqTest2-2.1.0.0-full.nupkg
As the error message seems to be complaining about the lack of a "RELEASES" file, my assumption was that this C:\Users\barbers\AppData\Local\SqTest2 path, can't be the one that is used for the UpdateManager path, as it only seems to get a new version of the app copied there after a successful run, and it is also missing the "RELEASES" file. Which seems very strange as this is the folder with the actual update.exe in it.
So I uninstalled the app.
Then created a new release where I changed the UpdateManager to be the C:\Users\barbers\Desktop\SqTest2\dist folder (which does have the RELEASES file in it (but there is not Update.exe in this folder). Did a new release, copied the files to C:\Users\barbers\Desktop\SqTest2\dist (from autogenerated Squirel releases folder), ran setup.exe from C:\Users\barbers\Desktop\SqTest2\dist. This installed a new app which is runable, and also ends up creating a new version of the app in the C:\Users\barbers\AppData\Local\SqTest2.
I then thought ok it did not crash, perhaps all I need to do now is create yet another new release and copy the files to the C:\Users\barbers\Desktop\SqTest2\dist (which is where setup.exe was run from), and it will auto update.
It didn't. Which does not suprise me, as the app shortcut is setup to point to the C:\Users\barbers\AppData\Local\SqTest2, which is also where update.exe is. The C:\Users\barbers\Desktop\SqTest2\dist doesnt contain a update.exe
What does confuse the buggery out of me, is how I a meant to configure this UpdateManager path to point to the C:\Users\barbers\AppData\Local\SqTest2 directory when this seems to crash as soon as I do a new release, due to the required app-x.x.x.x not being present and also the lack of a "RELEASES" file there
Seems a catch 22 situation. whatever I do seems to result in either crash or no update occurring
Could you be a sport and just tell me how this is meant to work.
To risk stating the obvious, it looks like you have a pathing problem: you aren't telling the UpdateManager
the right path to your RELEASES
file. I found it a bit hard to follow your previous comment, but it looks like you just need to tell the UpdateManager
to use the dist
folder path. And I'd stick with folder path over a URL until you get it working locally.
If it helps to see a working example (and I'm not saying this is best practice), I half-assed-automated the packaging of our app and documented the release process here:
https://github.com/lic-nz/Malone/wiki/Release
I made the update URL a config setting, so you can modify the installed versions config to test against a local path. HTH
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
at Squirrel.ReleasePackage.<>cDisplayClass1d.
at System.Linq.Buffer1..ctor(IEnumerable
1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Squirrel.ReleasePackage.findAllDependentPackages(IPackage package, IPackageRepository packageRepository, HashSet
1 packageCache, FrameworkName frameworkName)
at Squirrel.ReleasePackage.CreateReleasePackage(String outputFile, String packagesRootDir, Func2 releaseNotesProcessor, Action
1 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
For reference, this is where I check for updates:
I use a slightly expanded version of that "suggested" code from your initial comment. You'll see that the method is marked async
in order to allow the await
's. Without seeing what modifiers you have on your containing method, it's possible adding the Task.Run()
ended up being another way to do the same thing.
As for your update, I'm not sure what is happening there. With Squirrel built on nuget concepts you may be right that having a packages.config
just kills it. But why do you need one? All your dependencies should be explicitly included...? Anyway, I'd suggest creating a separate issue to avoid mixing these bug threads and also properly formatting that stack trace. ATM, I can't tell if GitHubs auto-formatting has decided to truncate or mangle some important information in there.
I am not sure what you mean about why would I need a package.config. I do this
I agree I should move some of this to new thread though. Ill try that, thanks for trying to help me here
Sorry, I think I misunderstood you. I thought you might have been including a packages.config
inside your nupkg
.
What version of Squirrel are you on? I'm using 0.99.0 and can't repro that issue. A few things:
csproj
. And my layout is the same as yours: csproj
, packages.config
and nuspec
all in the same folder.
packages.config
in the folder where I build, and it worked fine:
nupkg
. I assume that is just an oversight and you actually do have one. And by "suitable" I mean the dependencies are explicitly included, you aren't doing anything weird with recursively nuget'ing things... I dunno just chucking ideas out there. It might be worth showing the contents of your nupkg
to check.The releasify process AFAIK will only operate on that single nupkg
, so I don't see how having a packages.config
sitting next to it matters. And it doesn't make a difference from my testing. It could be worth you forking my project and try releasifying that, because if it that doesn't work for you it might point to something being borked with your environment.
@shiftkey discussion has ended with no further issues - this can be closed.
The HTTP URL is obscuring what's going on a bit, can you just use a path instead to illustrate where you're pulling updates from?
can you please tell me how to generate Update.exe after issuing the command squirrel --releasify "updated nuget package name".nupkg because I am not able to generate that.
The command Squirrel --releasify
generate "Setup.exe". This executable install the app and deploy the "Update.exe" in %localappdata%\<AppName>\Update.exe
.
But the "Update.exe" is "Squirrel.exe" (used in the command Squirrel --releasify
) that is duplicated, renamed and integrated in the "Setup.exe". You can :
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.
App is install all is good.
New Release
I then edit my codebase to contain the following
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.