views:

70

answers:

1

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 (http://stackoverflow.com/questions/1668274/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.

+1  A: 

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
@Christopher, +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
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
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 (<http://msdn.microsoft.com/en-us/library/aa369500(VS.85).aspx>). As I said, the application is launched, but my notify icon isn't always visible.
Jeff Caron
-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
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