These are chat archives for WildGums/Orc.Squirrel

8th
Jun 2017
samirem
@samirem
Jun 08 2017 14:21
@GeertvanHorrik I want to restart my application after it has been updated by Orc.Squirrel (and preferably keep any command-line args), do you have any sample code of this? Since catel/orchestra is so extensive, I'm assuming that there already exists some neat service for this, which I haven't found :)
Geert van Horrik
@GeertvanHorrik
Jun 08 2017 14:22
Unfortunately we don't have such behavior. We show a squirrel icon in the app and let the user restart the app in a convenient time. They can double click the squirrel and we'll ask them whether they want to restart. We could simple pass in the same command line again there, but nothing out of the box.
samirem
@samirem
Jun 08 2017 14:33

Oh ok, so my best bet is something like this?

updateService.HandleUpdatesAsync();
if (updateService.IsUpdatedInstalled)
{
    System.Diagnostics.Process.Start(System.Windows.Application.ResourceAssembly.Location, Environment.GetCommandLineArgs());
    System.Windows.Application.Current.Shutdown();
}

I would also like a yes/no dialog to pop up with a message like "The application was just updated. Would you like to restart it now?", sorry for my newbish question but which way is easiest to do this?

Nevermind my question about the Yes/No-dialog, I found it here in the docs:
if (await messageService.Show("Are you sure you want to do this?", "Are you sure?", MessageButton.YesNo) == MessageResult.Yes)
{
    // Do it!
}
Geert van Horrik
@GeertvanHorrik
Jun 08 2017 15:01
correct, something like that
but then use the IProcessService
we show a less intrusive icon in the status bar, then it's up to the user to either restart now or just do it on the next run
samirem
@samirem
Jun 08 2017 15:13
That sounds like a very good idea. It's not nice to throw "annoying" messages in the end-users face
IProcessService instead of System.Diagnostics.Process.Start?
Orc.Notifications to show the status bar icon?
Geert van Horrik
@GeertvanHorrik
Jun 08 2017 15:59
Orc.Notifications shows a desktop notification
we have a separate statusbar that simply watches this service as well and toggle visibility on an icon