views:

687

answers:

5

Hi,

I'm currently facing a problem with my single instance clickonce deployed app, and maybe someone has a good idea about it.

My app is called by a web application, which passes parameters to this exe. Now the problem is, if the application is already running, it takes quite a long time, until the new instance is started, the parameters are handed over to the running instance, and closed (with opening the url, checking for updates,...).

So is there a way to detect that there is a running instance, without introducing a new small app, which does this detection?

The goal is to descrease the time, which the second, third, ... call needs to get the parameters to the running instance.

tia Martin

+1  A: 

When you setup the deployment setting, you can tell VS to only let the application update every x amount of time (once a day, week, etc). You can also tell it to launch the application and update in the background. Both these would solve your problems on their own I think.

The settings are in the Projects settings, on the Publish tab. Click the "Update" button in the "Install mode and settings" section and set appropriate settings.

Matthew Scharley
A: 

I think I made it not clear, what I'm trying to achieve.

What I'm trying to do is, if there is an instance running, accessing this one directly, without starting the clickonce url. I searching for a solution, where I don't have to write a little program (which has to be deployed as well, ...), which checks if the app is running, if yes hand over the params, if not starting the clickonce url.

The background update is not really an option, because this "connecting to app" screen is still there and consuming time, and it's a must, that every user is running at every time the most recent version of the app.

Martin Moser
Then there's no solution. It must bring up the updating window before running the application. You don't have to defer checking for updates if you don't want to, you can still have it check in the background everytime the program executes, and that way it skips straight to opening the program.
Matthew Scharley
Basically, you're asking for an application to stay up to date, but you don't want it to update itself. Sadly, this still isn't possible, much as I wish it was with our Australian internet connections :(
Matthew Scharley
A: 

This seems an interesting use of Click-Once technology. I was under the impression that Click-Once is ideal for for distributing a client application to a multiple end-user machines within an enterprise.

In the situation described here, this is a background application used by a web-server application - which I would expect to be only installed on a few servers in the enterprise.

Questions I have are:

  • How would your web application pass the parameters to the running instance if the web application could detect it? (eg .NET remoting?)
  • What's your reason for distributing this background application via Click-Once (as opposed to a windows installer)?

Knowing this might help to resolve your issue.

Andrew Shepherd
+1  A: 

No it's not a background app. The Web app and the Winforms app are working with a similar subset of the database. I'm trying not to go into details, because it's not important for the question, but to make it more clear: With the Web-app the users are creating the meta data for our business case, and with the Winforms app the users doing their concrete work.

So with this link, it is possible to create a new set of meta data, and cross-check the result in the "working-app".

So there are 2 concrete scenarios:

  1. The Winforms-App is not running on the client: When users clicks on the click-once start menu entry, or the link in the web app, everything should be done in the way it is now (with update check, ....). So this scenario works for me.

  2. The Winforms-App is running on the client: The running instance should display the new set of meta data as quickly as possible, without any click-once update check, or whatever. I'm trying to bypass in this scenario, that the "click-once starting app" dialog is poping up, the new app instance is starting, the new instance is passing the parameters to the running instance and closing itself. So I searching for a solution, where I achieve that, without creating a new small exe, which is known by the web app, which does the work.

Martin Moser