-
Notifications
You must be signed in to change notification settings - Fork 1k
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
SquirrelAwareApp events not getting called #435
Comments
Same problem here with SquirrelAwareApps. I followed exactly as in the docs, but nothing happens. In Squirrel log says that it detects that my exe is SquirrelAware, but when executed it times out after 15s, whether in install, uninstall or updated event, and nothing is executed. |
I had similar problems. The app was detected as squirrel aware but the installer timeout after 15 sec. In my case the problem was caused by the .exe startup time(the executable needed more than 15 seconds to start because of a problem in our build process). So to troubleshot this I would recommend:
You could also try to start your .exe manually with "--squirrel-install" args. For example %localAppData%\app-\YouApp.exe --squirrel-install and see what is happening. |
This is the easiest way to debug Squirrel hooks for sure - just run them! |
I don't know if you have solved it by now, here are my 2¢: I was also having problems getting the events, even after I noticed that I somehow forgot to add the SquirrelAwareVersion meta-data to my assembly. Than I noticed that most events actually would come, e.g. the first run, just that my application wasn't updating. After adding the UpdateApp code:
and doing another setup, as the application didn't update, future updates finally started working. Maybe I overlooked something, but in the article on Squirrel Events I couldn't find anything on still needing the UpdateApp() call. This threw me off, I thought that adding the assembly information and handling the events was all I needed. It does make sense though, I am not complaining about the functionality, just that I also had difficulties making it work. |
You don't need the UpdateApp call - you do need to handle Squirrel events as early as possible in your app though, which many folx mess up, they try to handle it in their update code. Like, you should be running |
The HandleEvents, in my test application, was called in the startup event of the Application (the Startup="MyStartupHandler" in App.xml). The startup handler was async, might this have an influence that the update didn't work? As I no longer am at work, I created a new WPF application and called the following in the constructor of App.xaml.cs:
The events are working fine as before, but updates still don't work. I know you wrote the thing :), but which part makes the update if an application is Squirrel-Aware? P.S. |
Hi Ani, I had a quick look at https://github.com/Squirrel/Squirrel.Windows/blob/master/src/Squirrel/SquirrelAwareApp.cs, at least in HandleEvents there is no update being called (which doesn't surprise me). Is the update for Squirrel-Aware applications done in the update.exe? As I said before, the event handling in general works fine. Except that there is no update even, or rather no update at all, when I don't call the update code myself. And this too is fine, just that it is not clearly documented. Best wishes, |
I think you're misunderstanding how this works - HandleEvents is a mechanism for Squirrel to tell you when things happen. Squirrel never automatically updates, because it's the developer's job to decide when updates happen. Sorry if that wasn't clear in the docs! Squirrel is much more a library, than an automated "framework" like Clickonce et al |
Thanks Ani, your answer "You don't need the UpdateApp call" just threw me off. So I guess the squirrel-events documentation here should be enhanced with a hint that an update check and the update itself needs to be added. For me, placing the following as soon as possible in the application worked:
|
The above code works for me for updating but the initial instance does not close after update so 2 versions of my app end up being open. |
Running Squirrel 1.5.2 I'm having trouble getting anything but the onFirstRun event to fire. The main issue right now is the onUninstall event, as this is causing the desktop shortcut to be left behind and the Splash screen is displayed when the app is uninstalled. AssemblyInfo.cs - line appended: Main.cs excerpt:
Can anyone point out what I'm doing wrong? Passing the version variable into the function or not doesn't appear to make any difference. |
OK, I worked it down to a problem with HandleEvents() - if the application is pre-release, eg 2.5.0-beta, then it fails. Given this is a valid SemVer, I'm feeling like this is a bug. I've subsequently come across issue #892 and a comment that also need to strip the pre-release detail. For the moment, my workaround is:
|
Any solution for this? Im learn Squirrel but onInitialInstall is never called, but onFirstRun works |
I am having issues getting any of the SquirrelAwareApp events to execute. I have tried code very similar to the documentation and none of the shortcuts are getting created. I also have
[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
in the last line of my AssemblyInfo.cs.I also tried creating my own event handlers however none of the methods are getting called. I my wpf app, configuring squirrel is the second thing to happen, just after starting logging.
The text was updated successfully, but these errors were encountered: