Service & GUI updates together

I am having a hard time figuring out the best update approach for my scenario.

I have two applications. A service that runs as 'LocalSystem' (installed in %ProgramFiles%) and a WPF GUI system tray app that is installed to the all users %AppData% directory for UAC update reasons. Both applications are deployed with the same MSI. Both applications must be running all of the time on the user's machine (except when updating, of course). Both applications must silently update, as most of the user machines are unattended.

I am not sure how best to leverage the wyBuild tools to make both updates happen as one step. From what I can gather, the only approach might be to have two separate wyBuild projects. One for each application. This would mean they update independently of one another, which isn't a huge deal, but I'd like to lessen the overhead by having only one wyBuild project for my entire installation. My versioning would also be a challenge to manage with having two wyBuild projects related to the same MSI.

If this is the only solution, should I also have two different download sites? Or can multiple projects' updates be stored in the same http download directory?

Thanks for any help anyone can offer.

Hey Doug,

I think the best approach is to install the GUI part of the app into the %ProgramFiles% sub-directory along with your windows service. Then, if you're making a .NET Windows Service stop the tray app just before you're about to update (e.g. in the ReadyToBeInstalled event). If you're making a non-.NET Windows Service, then stop the tray app before you call wyUpdate.exe /fromservice.

After the update has completed you can start the tray app from your Windows Service.

Does this help?

After the update has completed you can either start the tray app from your Windows Service or as part of the update.

I would love to be able to do that, but I see one major problem. The .NET windows service cannot start a process and make it run under another user account. Since my service is running as LocalSystem, it could not launch a process on the user's desktop instance.

Am I confusing your recommendation, perhaps?

I was wrong about my suggestion to execute the tray app as part of your update. But you can execute the tray app from your service. You can do it a couple of ways.

  1. How can a Windows service execute a GUI application?
  2. Have a simple exe that starts with every user session that's sole purpose is to listen for IPC requests to start your app. For instance, this "dummy" app listens on a named pipe for commands from your service.

The first suggestion is the "correct" way to do it. The second suggestion is easier.

But then how do I update the dummy app?

I'm just kidding. I'll have a look at your first suggestion. The ironic part is that the main purpose for our systray app is to launch other GUI's for the user.

Thanks again for your help.

FYI, I can't get the quotes to work on this forum for some reason.

Thanks again for your help.

My pleasure.

FYI, I can't get the quotes to work on this forum for some reason.

Unfortunately we had to disable BBCode on all accounts except for us here at wyDay. The reason is that we get an excessive amount of spam. ReCaptcha doesn't do a good job of stopping the spam, so our only recourse was to disable all BBCode.

We're working on replacing this phpBB forum with our custom creation that uses bayesian spam filtering. This is a backburner project, though (our paying customers take precedence 😉 ).