views:

875

answers:

1

I have an application that uses click once to deploy, and I have managed to get the application starting when a user log's in.

My issues is that I need the application to start up hidden (I don't want a user to have to minimize it until they require it - I want it to sit in the system tray). Prior to using click once I simply checked the args to see if "/silent" was passed in. There appears to be no way to do this in a clickonce application (you can check if a uri query string is passed in, but because this is run from a .appref-ms shortcut there appears to be no way to get the /silent argument)

So my question is can someone either explain how I can get the /silent argument, or can someone suggest how I can tell if the application has started as a result of the user logging on (rather than the user starting the application from a shortcut).

It is important that whatever solution proposed doesn't require admin permissions but Language used isn't as important as I can probably port it to .net

Thanks for your help!

A: 

I don't think there's a very clean way to do this since command args don't work and you can't use query string arguments.

However, what about deploying another small executable with your ClickOnce deployment? It would be responsible for setting a "startup" flag (in a config file, registry, whatever) and then launching your actual application. Your app would check the flag to determine if it should launch silently and then reset the flag. Then you would just have the small executable start with windows rather than your main application.

Of course I didn't prove any of this out. If this works or you find a better way, please post again.

whatknott
This is what Im planning on doing - couldnt find any better way of doing it! (If you are doing this remember to update the shortcut to the helper app after every upgrade).Thanks for confirming this is what has to happen!