Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Windows 7 notification area behavior
 

Windows 7 notification area behavior

We have an app published via ClickOnce that has a system tray presence and we are now experiencing an unfortunate behavior on Windows 7 systems. The Win7 notification area hides most items by default, but allows the end-user to customize what appears. So I customize my app to have the behaviors "Show Icon and Notifications" and all is well. That is, until the next time I publish the app, at which point a new entry is created in the Notification Area Icons customization dialog, with the default behavior set to "Only show notifications". As this app is updated quite frequently right now this is definitely a non-starter for Win7 users. We are expecting to upgrade a set of users in late October so we have some time to solve this, but solve it we must.

What I wish to know is if there is something I can set in the app so that it does not appear as a new application in the Windows 7 notification area sub-system and retains the settings for the application across updates.

K Russo  Tuesday, August 25, 2009 3:02 PM

....

Have you got any progress on this issue? If there is anything else we can help, welcome to post here.
....

No progress, the behavior is out of my control. Thought that was clear =).
K Russo  Saturday, September 12, 2009 9:00 PM
Hello Russo,

Thanks for your post on MSDN forum.

Based on my understanding, when updating a ClickOnce applicaiton, it will be treated as a new application, thus there will a new tray icon on the system tray. I will talk this to product team and keep you updated on this issue. Thanks for your patience.

Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Rong-Chun Zhang  Wednesday, August 26, 2009 9:47 AM
Thank you for the follow up. Without a solution to this I feel that I am likely to be forced to roll my own solution, something that I was able to move away from with the advent of ClickOnce.
K Russo  Thursday, August 27, 2009 7:34 PM
I have a question about this. Don't XP and Vista also hide icons in the system tray by default?

I'm running Windows 7 and when minimized, our application shows up in the system tray. I have "always show icons and notifications on the taskbar" checked in the properties (it's at the bottom of hte page), and haven't had any problems with the icon disappearing.

Have you tried checking that property?

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Monday, August 31, 2009 3:00 AM
Hi Robin,

IIRC in Vista and XP the icons had an aging property in that they started off visible, and after a period of inactivity (measured in days/weeks best I could tell) they would disappear. We would then tell the user to re-activate it by setting it to always visible and that was that regardless of the number of updates delivered via ClickOnce.

In Windows 7, however, the default is to place the icon in the new notification area, so the icon doesn't appear in the old system tray area at all. This, of course, can be overridden, but as soon as an update is delivered the settings are reset. As noted by Rong-Chung Zhang Win 7 is treating the updatedapp asa new application. I don't know if that's "correct" behavior, but it certainly isn't desirable in our situation. I understand that MS feels we should move more towards Jump Lists and other new features and while I appreciate that, those changes are non-trivial, our users are trained to right-click when appropriate, and it's not a change I'm interested in addressing in the next three weeks.

I honestly think that I'll be better off in the long run to discontinue use of ClickOnce and go towards a more enterprise friendly delivery mechanism that will allow IT to push the apps out in an automated fashion and I'll resurrect code to deliver updates that I used prior to ClickOnce. ClickOnce has a number of other manifest issues (32 vs 64 bit) that are annoying when dealing with large numbers of users. It's a decent technology for the average developer, but it's limitations can be very painful.
K Russo  Monday, August 31, 2009 9:31 PM

I'm confused. I don't see the difference between the notification area and the old system tray.

http://msdn.microsoft.com/en-us/library/aa511448.aspx

Do you want your icon to show up all the time, even when your application isn't running, so you want to use it to launch your application? In the aforemented article, MSFT says they are trying to discourage that, and that's why you can't change it programmatically.

I seem to have a bunch of stuff in my "notification area" that is "system tray" stuff and not stuff that would notify me, but I guess it depends on how you define "notify".

When our customers minimize our application, it shows in that area, and then they can right-click on it and exit or restore it. I've tried it, and I don't seem to be having any problems with it displaying.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Tuesday, September 01, 2009 3:05 AM
Hi Robin,

The Notification Area is a new feature with Windows 7 that displays a popup dialog containing a number of icons that would have displayed in the system tray area prior to Windows 7, just to be clear on what the Notification Area is. I don't want my app to minimize to the new Notification Area, but instead always have the icon displayed in the system tray area of the task bar. Vista and XP didn't have the Notification Area, so the settings determined whether or not the app displayed on the task bar. Win 7 has the new Notification Area feature, which I generally love, but for my corporate app it will not help the users to have it tucked away. We have a long history of having the users go there to activate commands. I don't want to turn the Notification Area off for the users, it's nice to get most of that stuff out of the way, just not my app. As for the rest of it please refer to my original post.

I understand that I can do new things, which I don't really feel like doing, or I can just ditch ClickOnce, which has some other limitations anyway. In an ideal world MS would provide me some code, hotfix, whatever that would allow me to say that "this icon" is always shown (it's probably just a registry setting, maybe I should google for that). Then I could continue using ClickOnce and get the behaviors I want and continue putting off a switch until I absolutely need to do so (e.g. I get 64-bit database drivers, or ditch remoting for WCF and move my database code there, at which point I won't have to down-compile to 32-bit, because as I am down-compiling to 32-bit, once I publish 64-bit I'll get a mismatch and have to reinstall anyway).
K Russo  Tuesday, September 01, 2009 6:31 PM
How are you putting the icon in the system tray? Does it only appear when your application runs, or is it used to launch your application?

I'm trying to figure out what's different between mine and yours, because mine shows up in the system tray just fine. And yes, it's deployed with ClickOnce.

You're going to have the problem with the 64-bit thing no matter what, until the database drivers are available. Using setup & deployment isn't going to fix that problem. Not sure what other problems you're having with ClickOnce (other than this one).

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Wednesday, September 02, 2009 12:16 AM
How are you putting the icon in the system tray? Does it only appear when your application runs, or is it used to launch your application?

I'm trying to figure out what's different between mine and yours, because mine shows up in the system tray just fine. And yes, it's deployed with ClickOnce.

You're going to have the problem with the 64-bit thing no matter what, until the database drivers are available. Using setup & deployment isn't going to fix that problem. Not sure what other problems you're having with ClickOnce (other than this one).

RobinDotNet
Click here to visit my ClickOnce blog!

-> I start the app and it closes the main window and just has the presence in the system tray. The main purpose of this app is to receive socket connections from another application and activate dialogs when called. It performs other tasks (it can resurrect the main window), but the primary purpose is to interact with another app via socket connections.

-> And as I pointed out in the OP my app shows uphidden by default, and I canforce it to display as expected, until I republish, at which point the new version of the app is hidden again. It's a Win 7 thing as best as I can tell. Oh, I could check "Always show all icons and notifications on the taskbar," but that isn't an ideal solution. Just to be clear, I don't want the users to have to click the pyramid to access the hidden icons, I want it on the taskbar.

-> I "might" be able to accomplish something similar using custom tasks off the new Jump List feature for Windows 7, but assuming I can safely reference that API while also having the app run on XP, it still doesn't look like quite what I need. Those tasks appear to be meant for use regardless of whether your app is running, and my app is a single-instance only app (see the socket listener requirement above). I could probably figure out ways around that, but I feel that this is not taking me down the path of least effort.

-> As to 32-bit/64-bit I fully understand the issue with the drivers, and setup & deployment "might" not help, but if I go X-Copy I have it licked. Then I could resurrect some other things we lost with ClickOnce such as automatic desktop icon creation (I don't like it on the desktop, but users do), automatic start menu addition (again, see users), and the ability to switch between debug/release/32-bit/64-bit/.Net 2/3/3.5/4 without a re-install. So while I can understand perhaps why MS made some of the decisions they did, there are a lot of deployment limitations with ClickOnce. Oh, and that annoying certficate issue goes away (yea, I have the work around to update the certficate for 5 years, but it's still annoying).

K Russo  Thursday, September 03, 2009 3:59 PM

Interesting. As I said, I'm not having any problems with our icon, but then, I have set mine to show all of the icons, so maybe that's why. Why do you care if the user can see it if all it does is interact with another app via socket connections? I assume you're using a NotifyIcon to show that icon in the notification area, right?

You can create a desktop shortcut with ClickOnce, as explained in this article:
http://robindotnet.wordpress.com/2009/04/07/creating-a-desktop-shortcut-for-a-click-once-application/

The certificate issue is no longer a problem if you have .Net 3.5 as a prerequisite. (Did you know Microsoft is now pushing .Net 3.5 out via Windows Updates as a critical update?)

As for the other limitations,I understand your frustration. ClickOnce wasn't designed to have the functionality of the setup & deployment package with all of the options therein. It was designed to be a fairly basic deployment that (most importantly) would install in the user's profile and the user couldrun without privileges.

Anyway, good luck.

RobinDotNet


Click here to visit my ClickOnce blog!
RobinDotNet  Saturday, September 05, 2009 4:49 PM

... As I said, I'm not having any problems with our icon, but then, I have set mine to show all of the icons, so maybe that's why. Why do you care if the user can see it if all it does is interact with another app via socket connections? I assume you're using a NotifyIcon to show that icon in the notification area, right?....

Exactly the problem =). I don't have mine set to show all the icons and I don't want to set that, the new behavior is actually quite nice, but ClickOnce doesn't interact well with it. And while the main purpose is to interact via sockets, that's not all it does, there is other functionality exposed via right-clicking the icon (yes, via a NotifyIcon).

Pushing out 3.5 is nice, but this means I'll have to uninstall the ClickOnce app and manually re-install. I just figured I'd wait until 4.0 came out and pay the price once =). In the meantime I know the certficiate workaround.

Anyway thanks for caring =).
K Russo  Saturday, September 05, 2009 6:48 PM
I COMPLETELY understand about the certificate problem, as I am about to do the programmatic uninstall/reinstall for my company next week for the second time. You could use the same code for changing the prerequisite to .Net 3.5 by the way. If you're interested, it's contained in the blog post and additional material:

http://robindotnet.wordpress.com/2009/03/30/clickonce-and-expiring-certificates/

You could even consider pushing the .Net Client Framework, which is a subset of 3.5. If the user has no version of .Net on the machine, it will only install the Client Framework. (Then Windows updates will come around and push the rest). If they have ANY version of .Net, it will upgrade them to .Net 3.5 SP-1.

http://robindotnet.wordpress.com/2009/05/18/microsoft-automatic-updates-and-net-3-5/

Do note that 4.0 is a separate CLR from 2.0/3.0/3.5, and it WON'T be pushed by Microsoft like the .Net 3.5 Framework. It resides side-by-side with 2.0/3.0/3.5. So you will have virtually no chance that any of your customers are running it. I added some code to gather the customer's .Net framework version and store it, and I found (much to my surprise) that 80% of our customers have .Net 3.5 installed. I'm trying to talk my company into upgrading to 3.5, I would have no chance of going all the way to 4.0. :-P

Good luck, and feel free to post back if you have any more questions.

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Sunday, September 06, 2009 2:52 AM

Hello Russo,

Have you got any progress on this issue? If there is anything else we can help, welcome to post here.

Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Rong-Chun Zhang  Thursday, September 10, 2009 9:22 AM

....

Have you got any progress on this issue? If there is anything else we can help, welcome to post here.
....

No progress, the behavior is out of my control. Thought that was clear =).
K Russo  Saturday, September 12, 2009 9:00 PM
Hi Friends,

I've application to show the system tray icon but
it is hidden on windows 7 by default. Otherwise it 
is working fine on other OS.

Is there any other solution if possible using registry, manifest, API etc.?

Thanks,
Sunil.
sunil pagare  Friday, October 02, 2009 8:47 AM
As noted above, there is apparently no way to change this, other than have the user set Win7 to not hide the icons.

RobinDotNet
Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev
RobinDotNet  Sunday, October 04, 2009 6:38 PM
Hi.

Look at this page:

There look at the screenshot of taskbar. There are area called "Deskband". And description written there:

Deskbands. Minimized functional, long-running programs, such as the Language Bar. Programs that minimize to deskbands don't display taskbar buttons when minimized. Deskbands are not recommended for Windows 7.

Try to search for SDK for Win7 (google, etc.). Maybe there are some controls/components, that can do what you want, besides the NotifyIcon.

I mean, icons are always shown on the Deskband, just like the keyboard indicator.

And remember that is is not recommended.
kpa6uk  20 hours 31 minutes ago
It also says this:

Deskbands. Minimized functional, long-running programs, such as the Language Bar. Programs that minimize to deskbands don't display taskbar buttons when minimized. Deskbands are not recommended for Windows 7.

RobinDotNet
Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev
RobinDotNet  13 hours 5 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• Grant login and database access to end user
• How to access auto updater in code?
• Web document from intranet through terminal server
• HUGE PROBLEM! ClickOnce install "stalled" and left in a state that can't be uninstalled nor upgraded.
• Possible to call a script from ClickOnce Deployment?
• setup and deployment output files
• How to run application after setup is completed ?
• Mage.exe and asking for users to trust me. FullTrust
• How to change DataBase path in Project ?
• Attach Database in visual studio ; Windows Application