Skip to content

Conversation

rzhw
Copy link
Contributor

@rzhw rzhw commented Dec 12, 2013

Having a go at #186, though the PR right now is incomplete. Biggest issue is that I haven't worked out how to confirm whether my setup.exe is using my local build of Squirrel or the one in packages, so I'm not sure if the code I put in uninstall actually runs. Need to have tools dir updated Otherwise, the code needs tidying up. Also tests

I've dropped this into a clone of Shimmer.Samples and so far can get it to compile, and tell it to close with a separate command line app (source), as well as with this in AppBootstrapper.cs:

InstallManager.ListenForClose("SquirrelDesktopDemo").Subscribe(
    _ => Application.Current.Dispatcher.Invoke(new Action(() => Application.Current.Shutdown())));

or

InstallManager.ListenForClose("SquirrelDesktopDemo")
    .ObserveOn(RxApp.DeferredScheduler)
    .Subscribe(_ => Application.Current.Shutdown());

This PR description needs cleaning up. List:

  • Basic code in uninstaller (named pipe client)
  • Basic code in app (named pipe server, needs to be set up to listen for exit request)
  • [ ] Uninstaller should ask retry/continue/cancel if exit request times out
  • [ ] What if the app is running but doesn't receive exit request in time? (Does the named pipe client instantly know if the server is running - maybe assume if it's up then the app is running)
  • Clean up
  • Tests

@anaisbetts
Copy link
Contributor

This is rad!

@peters
Copy link
Contributor

peters commented Dec 12, 2013

👍

@rzhw
Copy link
Contributor Author

rzhw commented Dec 18, 2013

Realised some issues with this:

  • What if the application needs to prompt the user for something before closing?
  • How to detect the application has shut down?

@rzhw
Copy link
Contributor Author

rzhw commented Dec 19, 2013

InstallManager.ListenForExitRequest("SquirrelDesktopDemo")
    .ObserveOn(RxApp.DeferredScheduler)
    .Subscribe(_ => MessageBox.Show("You can't tell me what to do!"));

untitled

@peters
Copy link
Contributor

peters commented Mar 26, 2014

@rzhw Any further progress on this ? :)

@rzhw
Copy link
Contributor Author

rzhw commented Mar 27, 2014

@peters I haven't had much time recently, but I was previously thinking about how to best deal with a timeout e.g. whether to create a new view, how to present the UI, etc etc. Thanks for the reminder, I'm thinking now it might be better to get this PR up to something working and ready to be merged in first

@rzhw
Copy link
Contributor Author

rzhw commented Mar 27, 2014

I'll pare this PR's scope down to providing the listen for exit method + the uninstaller making use of it. If the app doesn't listen for exit, or the request to exit times out, it'll just fall back onto the current behaviour of delete on restart; anything more could be added later if this is merged

akrisiun pushed a commit to akrisiun/Squirrel.Windows that referenced this pull request Dec 2, 2015
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

Successfully merging this pull request may close these issues.

3 participants