How to schedule ClickOnce application

H

hgirma

Hello Gurus,

Is it possible to schedule a task to run an application deployed using
ClickOnce? The executable changes location with each update.. and if i
were to run the executable directly, it's not considered as a network
deployed application and it's not able to use any of the update
features programatically.. any ideas? workarounds?

thank you,
 
D

Dave Sexton

Hi,

Add a task in Windows Task Scheduler that runs the shortcut file installed
in the Start menu. If you've configured the ClickOnce installation to not
place a shortcut in the Start menu, you can give the clients one that is
configured properly and they can place it wherever they'd like. To see what
a valid shortcut should look like, install the application with a shortcut
and open it up to take a peek.
 
H

hgirma

thank you for the Response Dave..
when creating the schedule, i browsed to the folder that contains the
shortcut created during the installation.. it was in
C:\Documents and Settings\UserName\Start
Menu\Programs\CompanyName\ProgramName

ProgramName is of type 'Application Reference' and when i select to add
it in task scheduler, and the time comes to run it, Fox Pro is opened
instead of my application with some invalid command error message.. if
i type the ProgramName from DOS, my application starts.. i tried
creating a shortcut of ProgramName to add that to the task scheduler,
but that did not work iether. the shortcut created is invalid.. the
problem with ClickOnce app is the shortcuts do not point to the
executable.. this is how it looks like

http://www.url.com/ProgramName.application#ProgramName.application,
Culture=neutral, PublicKeyToken=c515623d4a1d07cb,
processorArchitecture=msil
 
D

Dave Sexton

Hi,

It works fine for me (XP SP2). Make sure you browse to the shortcut in the
Schedule Task Wizard by clicking the Browse button.
 
D

Duggi

Hi

I think instead of configuring a shortcut, you should browse for the
installed program.

All that sheduled taks does is Run the exe from a location... exe could
be at a network location, in which case credential of the source should
be provided...

Hope this will solve the issue..

Thanks
-Srinivas.
 
D

Dave Sexton

Hi,

But the OP specifically stated that the "executable changes location with
each update", which I assumed to mean that the deployment manifest location
changes as well, but I could have been wrong.

If the deployment manifest will remain in the same location for subsequent
versions, then pointing to the manifest instead should do the trick.
 
H

hgirma

Like Dave said, the executables change location with each update, so
executing directly the executable will not work, because after a couple
of upgrades, that executable is no longer exist.. i had a work around
where i change the schedule after each update programatically, but that
is also not helpfull if the schedule runs before the application
updates the location.. ALSO if you execute the executable directy, you
can no longer use the ClickOnce feature to upgrade because the
deployment type is no longer Networked. you have to exectute it using
the url method.. unless there is a way to force it that i am not aware
off..

What is wiered is that i have the same config as Dave and still not
able to schedule.. could it be that you don't have FoxPro installed on
your machine.. i will try it on a separate computer where foxpro is not
installed.

thank you,
 
H

hgirma

yes, FoxPro was the problem, i was able to schedule and run it on a
diffrent machine w/o FoxPro on it and worked.. i will just go with
regular deployment and write my own routine to upgrade.. ClickOnce is
not mature enough just yet...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top