I wanted to deploy my project with ClickOnce deployment. But when I did it like that, it was asking in a dialog box at the end user machine:
A new version of XXXX is available. Do you want to download it now?
But my end users don't have a mouse or keyboard. So my intention is: It must take the updates automatically, but it must NOT ask that dialog box at the client side. How do I achieve this by using ClickOnce deployment?
In follow-up of Ahmed's answer, below is the code in VB.NET with minor enhancements. It might not be as per the best practices yet it is readable and descriptive.
An then in your startup code, you can call like this
Any feedback to further ehance the answer...
Any ClickOnce application based on an .exe file can be silently installed and updated by a custom installer. A custom installer can implement custom user experience during installation, including custom dialog boxes for security and maintenance operations. To perform installation operations, the custom installer uses the InPlaceHostingManager class.
For implementing this solution please refer to this link
Looks like you can do this by changing some properties in the build.
http://blog.jnericks.com/configuring-msbuild-to-auto-update-clickonce
No MSBuild scenario:
Then publish the application and test it. This was worked fine for me on a local test application.
Edit: looks like some people have been getting the minimum required version to update, might want to look into their solutions.
Edit 2: Image showing where versioning is important:
Also, note I have "Automatically increment revision with each publish" checked. Every time you go into the Properties for the project, that version will be up to date. You'll generally just have to change the "Revision" part of the Version in the "Application Updates" window to match the "Revision" in the Publish tab.
I know it's an old Q. but, I will answer anyway. (hope it will help someone):
First, you need to check: Choose when the application should check for updates >> After the application starts.
Secondly, add this method to your code:
Lastly, you just need to call isVersionOK() at the start of your app and in every few loops as needed to check for update. it will return TRUE if you are on your latest version otherwise it will return FALSE and expect the app will restart to a newer version automatically without user interaction.
In addition to Gromer's answer, simply install the AutoUpdateProjectsMinimumRequiredClickOnceVersion nuget package in your project. Once you have your project set to check for updates and to use a minimum required version, this will handle making sure the minimum required version always matches your current version (i.e. user's will always be forced to update to the latest version).
Sure can! As long as it's a network-deployed application, you can easily check for updates using this code. See below:
You can enter this snippet and call it in the startup. It works in console applications, Windows Forms applications, but only if you are network deployed! Where you see all my comments about logging is where I was originally using message boxes with prompts, but this is the version that doesn't require any input!