Question

I am not sure what title to provide for my following queries, but I really need help to understanding.

As of now I have following 2 questions to clarify myself.

Query 1:

Background of my application.

We have a concept of "FIRSTRUN = True" where we set parameters for our application in settings.settings and then set the "FIRSTRUN = False". So from next time the application start normally. The application and deployment using click once works fine - NO issues.

Query

Now, back to drawing board and we do some modification to the application for new version build. During packing, in the Settings.settings file, we set the "FIRSTRUN = True" and pack the application for client to deploy.

When the client deploy the latest version of the application ClickOnce is notified there is a new version and that latest version is installed at the clients end - So far its fine.

But when the application is starts once again, the "FIRSTRUN" check is not executed but continues to start normally.

While researching as to why it is happening like this, i noticed that in %appdata%/local/apps/2.0/ and its respective folder and also under %appdata%/local/apps/2.0/Data folder has multiple folder entries for the same application. Even if we package a new version and send to client, it take the old settings.settings data and then executes.

Why does it happen like this? How to avoid this?

Is it that every time the user should always uninstall and then install the latest build manually? If yes, then what is the use of the auto update feature? In my personal opinion the current way of working is also good, but sometimes the client may not accept this.

Question 2

In case if the user skip the update for the new build how to re-initialize this feature? Because, what we have seen is many time the user clicks on skip button instead of accepting the the new build.

Is there any way to disable the "SKIP" button and always force the user to accept the new build?

Hope to get response for this. I still have few queries regarding this technology but these are my priority topics.

Was it helpful?

Solution 2

Question 1
This is built into ClickOnce. Don't save your own setting. Use ApplicationDeployment.IsFirstRun instead. That value behaves as expected and will be reset when the user upgrades to a newer version.

Question 2
Look at the 'Making Updates Required' section of this article. By setting the minimum required version to the current version, users don't have the option of skipping an update.

OTHER TIPS

Question 1: Yes, Click-Once always creates a new folder if an update is installed. You may have recogniced that if you go to programm and features and uninstall the Click-Once Application, you will have the option to roll back to an older version. Thats why ClickOnce keeps some old files. It would be better to safe the settings to a different place. For example: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)+"\\Application-name"

Second option would be to safe those settings to the registry.

Question 2: Sure there is way to do that. You have to disabl autoupdate and write an own update class or function. Here is an example, just disable the Message-Box for asking to install the update: How to: Check for Application Updates Programmatically Using the ClickOnce Deployment API

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top