2

First of all, when I start the application normally (double-clicking on the exe), it works perfectly: the notify icon is always appearing in the system tray. It also works well when the application is launched at the end of an msi Setup (Run exe after msi installation?).

However, when the application is launched from an msi running in quiet mode, my notify icon isn’t always appearing, but the application is functional: I can access the contextual menu with a keyboard shortcut. I tested on three computers running under Windows XP and the success rate is around 50%. I also tested on Windows7: it works perfectly.

I know that there are some issues with the notify icons during the startup in Windows XP, but I don’t know if it is related (http://www.google.ca/search?hl=fr&q=notify+icon+not+appearing+Windows+XP&aq=f&aqi=&aql=&oq=&gs_rfai=

So, I was wondering if any of you guys ever experienced this problem. Do you think it’s a Windows XP bug? Or is it related to who is launching the application (msiexec vs .exe)? I don’t think it could be an error in my code, since it’s working well when I start it directly.

Community
  • 1
  • 1
Jeff Caron
  • 413
  • 6
  • 15
  • I've never heard of "quiet mode". – Hans Passant Aug 26 '10 at 20:36
  • @Hans, I *think* the OP means the "quiet mode" you can use when running an MSI, i.e. `msiexec /quiet` =) – Rob Aug 26 '10 at 20:52
  • @Rob, why would an installer need a tray icon? – Hans Passant Aug 26 '10 at 21:06
  • @Hans, my feeling from reading the question is that the user means "when the application is launched **from an msi running in quiet mode**, my notify icon isn't always appearing, but the application is functional", not the installer needing a tray icon – Rob Aug 26 '10 at 21:19
  • @Rob, why would an installer start a program when it supposed to be quiet? You don't really have to answer that :) – Hans Passant Aug 26 '10 at 21:24
  • @Hans, that's the £64,000 question... although if the installer's run as part of a logon script I could see the sense in it, *just* about =) – Rob Aug 26 '10 at 21:45
  • It's fairly normal to do this. As an SMS Admin I would push out packages silently that would shut down a tray app, uninstall the old version, install the new version and put the try app back. All this without the agent barely notice it was ever missing. – Christopher Painter Aug 26 '10 at 21:49
  • @Rob, you know this stuff! Do you think it might be a problem when the installer does not in fact do what it was asked to do? – Hans Passant Aug 26 '10 at 22:15
  • @Hans, `/quiet` means "Quiet mode, no user interaction" (as per `msiexec /?`), i.e. present no UI during installation, **not** "don't launch anything afterwards". That said, I suspect we're going to have to agree to disagree on this one =) – Rob Aug 26 '10 at 22:21
  • @Rob, I fully agree to disagree most agreeable. Thanks for talking back :) – Hans Passant Aug 26 '10 at 22:27

1 Answers1

1

You must realize that when you run silent ( /quiet /qn UILevel=3 ) that the InstallUISequence doesn't run, only the InstallExecuteSequence does. Therefore you need to schedule your custom action to run at the end of the InstallExecuteSequence when running silently so that your C# program will run and place itself in the tray.

For those that question this requirement, it's fairly normal to do this. As an SMS Admin I would push out packages silently that would shut down a tray app, uninstall the old version, install the new version and put the try app back. All this without the agent barely notice it was ever missing.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • +1 from me - the scenario you describe in your second paragraph was the one I was struggling to (and failing badly!) describe in my comments on the OPs question =) – Rob Aug 26 '10 at 22:22
  • No prob. I once worked for an major airline that had green screen terminals that were basically stateless. We once pushed out a software update that wiped and reloaded and even started the program back up if had been running. Finally we sent a text command to the mainframe that repainted the screen. They never knew what hit them. :-) – Christopher Painter Aug 26 '10 at 22:44
  • Thanks for your answer Christopher. Actually, I have a post build script which modify my MSI and add a row in InstallExecuteSequence to launch my application on certain condition (CLIENTUILEVEL=2 OR CLIENTUILEVEL=3). I set the sequence to -1 (). As I said, the application is launched, but my notify icon isn't always visible. – Jeff Caron Aug 27 '10 at 14:11
  • -1 is a wierd suggestion. That's the reserved sequence number for the dialog that gets displayed on successful completion and I don't think it would get called in a silent install but alas it must be since your application is launched. Still, I'd sequence after InstallFinalize as an immeadiate execution CA so we know it's running in the users context. Hmmm, since your application is launched and the problem is intermittent, I'm wondering if there is a problem with the application itself. – Christopher Painter Aug 27 '10 at 14:47
  • Well, I really suspect a Windows bug. I made the simplest application possible with a notify icon just for test purpose and the problem was still appearing randomly. Is there a way to close this thread (I'm new here) – Jeff Caron Aug 30 '10 at 12:24