none
Wanting to skip clickonce update check under certain circumstances

    Question

  • I use clickonce to install my client application.  I also let the user create a scheduled task that launches this clickonce application.  My product is a sync product which likes to be run unattended at night.  I use the application pointer in the start program group to launch it and that works great. 

    However, my problem is that since the CO app checks every week for an update, the scheduled task does this also and blocks the scheduled task from running with an interactive dialog asking the user if they want to update.

    Is there a commandline param or something I can set from inside my app's main method to say "don't check for update in this case"?

    Thanks.


    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider
    Friday, April 01, 2011 4:18 PM

Answers

All replies

  • Hi pjellner,

    I have not found any document mentioned we can just use the command to skip a update check.

    But I think you can update the application using clickonce API.

    http://msdn.microsoft.com/en-us/library/1zyc39fb(v=VS.100).aspx

     

    Then you can pass the args to the application update method through command line to control if the application need to update at one moment.

     

    If there's any concern, please feel free to let me know.

     

    Have a nice day!


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 04, 2011 4:22 PM
    Moderator
  • Hi Mike,

    this article seems to talk about the published app, not what I can do from the actual client.  What I need to do is have a way to run the app on the client and have it specifically not check when it is running as a scheduled task.  Other times, when it is launched normally, I do want it to check.

    Can you give some specifics how to do this? (or someone else who might know)

    thanks,


    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider
    Monday, April 04, 2011 4:36 PM
  • Look into "On-Demand Updates" for click once.

    http://www.softinsight.com/bnoyes/2005/06/16/ClickOnceOnDemandUpdateBugInBeta2.aspx

    There are many more samples if you search including microsoft tutorials.

    The idea is you set to NEVER update. And then your program checks for update as needed. You will have to be creative as far as find a way to check if update should be allowed or it is a sheduled task.

    Monday, April 04, 2011 4:53 PM
  • Hi pkellner,

    I mean you will need to use the clickonce api write the custom update code, so that you can dynamic control the update at user side.

    I'm afraid there's no document mentioned if we can pass arguments to the clickonce deployed application.

    You can check the last section "To check for updates programmatically" in the link: http://msdn.microsoft.com/en-us/library/1zyc39fb(v=VS.100).aspx

     

    If there's any concern, please feel free to let me know.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 06, 2011 8:36 AM
    Moderator
  • Hi pkellner,
    I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?
    If there's any concern, please feel free to let me know.
    Best wishes,

    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 08, 2011 10:28 AM
    Moderator
  • I'm still confused with so many answers.  Most if not all talk about something that has nothing to with my problem.  that is, turning updates off from the server.  I am not interested in turning them off from the server. It is the client I need to supress the check on.
    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider
    Monday, April 11, 2011 2:26 AM
  • Hi Peter,

    Sorry, but as far as I know, you can not use automatic updates and have it not run sometimes.

    You can, however, use the API to do programmatic updates instead of doing automatic updates, and decide whether or not you want to run them. Here is a link to a couple of articles showing how to do that:

    http://msdn2.microsoft.com/en-us/library/ms404263.aspx
    http://msdn.microsoft.com/en-us/library/ff699336.aspx

    You could put the update code at the beginning of your program, and then use a query paramter to designate whether or not to [programmatically] perform the update. Query parameters can be passed to the application whether it is online or online&offline.

    http://robindotnet.wordpress.com/2010/03/21/how-to-pass-arguments-to-an-offline-clickonce-application/

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Monday, April 11, 2011 6:00 AM
    Moderator
  • Thanks Robin.  I'll try the path you suggest.
    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider
    Monday, April 11, 2011 5:10 PM
  • Hi Robin,

    Thanks for your additional explanation for how to pass parameters to this application, which I have mentioned but has not given more explanation.

     

    @pkellner,

    Now, I think the suitable solution is using clickonce api check and update your application instead of let it auto update.

     

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 12, 2011 3:40 AM
    Moderator
  • I've now done most of the programming to do my own update (though much to go to make the dialog box showing progress sadly) and now the problem I'm having is this.

     I've set my UpdateEnabled to false as shown below and these are the steps I do.

    0.  ClickOnce Application Already Installed From Previous installation

    1.  Make new build for clickonce deploy on server (new version number)

    2.  Run Local App (we have it now checking everytime for a new version)

    3.  Our forced clickonce install happens

    4.  Exit our app

    5.  Re-Run App. (get the update available message which I think should only be showing when UpdateEnabled is true.  Am I wrong?

     

     

     

      <IsWebBootstrapper>true</IsWebBootstrapper>
      <PublishUrl>c:\CRScratch\1004\PublishLocation\</PublishUrl>
      <Install>true</Install>
      <InstallFrom>Web</InstallFrom>
      <UpdateEnabled>false</UpdateEnabled>
      <UpdateMode>Background</UpdateMode>
      <UpdateInterval>7</UpdateInterval>
      <UpdateIntervalUnits>Days</UpdateIntervalUnits>
      <UpdatePeriodically>true</UpdatePeriodically>
      <UpdateRequired>false</UpdateRequired>
    

    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider
    Monday, April 25, 2011 10:42 PM
  • I have a question -- if you do NOT already have the application installed, and you install it, does it work correctly?

    The other thing I would check is if you get through the NEXT update with the change to not auto-update, does the update after that one work?

    I'm assuming your app is online&offline -- is that right? It's not online-only, right? If it is, then it will always auto-update.

    I seem to remember there being a problem with going from auto-updates to not auto-updates. You might have to have current customers uninstall and reinstall (you can do this programmatically if you want to)

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Tuesday, April 26, 2011 6:34 AM
    Moderator
  • I've actually got the update flag behind me now.  The problem I'm now facing is that it is undpredicable (to me) when the clickonce client will bring up it's progress dialog on an install (when I give it the .update() command) and when it does not.

    That is, the dialog that shows the app is installing with the progress.  Even though I am supposedly in control of that, sometimes it comes up and sometimes it does not.  It feels like it is a timing thing but I don't know what the timing issue is.


    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider
    Tuesday, April 26, 2011 7:31 PM
  • Hi pkellner,

    Can you provide the update code, if possible?

    If you can, can you provide the test project and the repro steps? I think I would like to trace the process to see if there's anything unexpected.

     

    If there's any concern, please feel free to let us know.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, April 27, 2011 3:55 AM
    Moderator