Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Click Once Deployment options - Help Needed
 

Click Once Deployment options - Help Needed

I have a Windows Forms Application that is a continual "work in progress" - It is set up for click Once deployment from an intranet web server and that part works great.

Where I am having a problem (and maybe I dreamed this up so feel free to set me straight if need be)

Previously when I published an updated version, the end user would get prompted at application start-up that an updated version was available and they had the choice to Install or Cancel. If they chose to cancel then the existing version of the application already on their PC would start.

Somehow - the ClickOnce settings got screwed up (I honestly don't remember changing anything but I must have)

First it went to not prompting at all - it just installed the new version on application start up.

I have somehow managed to get it back to prompting to install updates but if the User cancels the update - the application fails to start.

It was nice to be able to publish a new version with a "fix" or new feature and have one end user update & test it while the rest could cancel & continue using the existing version and I REALLY want to get back to that.

If anyone can give me any ideas on what I may have done & how I need to fix it - I would greatly appreciate it.
S Crook  Wednesday, February 06, 2008 4:19 PM

S. Cook - the options/settings that you have at your disposal for controlling this "upgrade" experience for your users is available within the Visual Studio's Project Designer --> Publish page --> Updates.

Please review the help topic for this “Updates�dialog at http://msdn2.microsoft.com/en-us/library/axw1fa38(VS.80).aspx

From what you are saying �it sounds like you want users to “Update�before the application starts…so be sure to enable the radial button option that says �/span>Before the application starts�/span>

For the issue regarding the user “canceling�the “install update�and the app just ends…I think this is due to checking the option on this same dialog for “Specify minimum required version for this application� If you have this option set with a version “Higher�than what is on your users machine, if they “cancel�the update the application will behave in the manner you have described I believe. So you may want to “uncheck�that option if the behavior is not what you want.

Hope this helps.

Robert Schoen (Microsoft Visual Studio for BizApps Team)

RSchoe-MSFT  Wednesday, February 06, 2008 10:35 PM

Robert,

Here is a screen shot of the Automatic Update settings as I published this morning

http://i181.photobucket.com/albums/x193/n2dfire/WorkStuff/AU_Screenshot.jpg

You can see that

1) "The application should check for updates" checkbox is checked

2) The "Before the application starts" radio button is selected

3) The minimum required version is NOT checked (also I enabled the check box and set the Revision to Zero then Un-checked the box again) - Note last published revision was 37

When one of my users restarted the application today - it simply downloaded the update (r37)without any notice & only the option to cancel (if you can click it fast enough).

Previous to this I had Unchecked the "The application should check for updates" checkbox and then the user was prompted to install or cancel but if they canceled then the application wouldn't start (the minimum required version was also unchecked but I had not yet set the revision box to zero)

S Crook  Friday, February 08, 2008 9:03 PM

Very strange...

I will see if I can get some of our runtime folks to check in on this thread and help out. What you are seeing seem very strange. I will check back on this thread to see if there has been more traction.

BTW - If you are able to repro this with a "New" app and have very specific repro steps on how it occured that would also bereallyhelpful.

RSchoe-MSFT  Friday, February 08, 2008 10:08 PM

I think you still might have r37 somewhere in the server with minimum version requirement and some of you clients have that r37 location as their update location. Delete stale deployments from server and see if you can still repro it.

Munirul Abedin  Friday, February 08, 2008 10:29 PM

O.K. - I am now at least in an acceptable situation.

I did the following:

- Removed all previous revisions from the deployment location

-Published a new version 1.0.1.40 (aka r40)

- Then on my test user I went and (via Control Panel) uninstalled the previous version of my application

- Installed r40 via the web site on the test users platform

- Published r41

- Had test user start application. He was then prompted to Update or "Skip" (new button for me)

- I selected "Skip" and the application started r40 with no problems.

Here is where things get less than Ideal but livable

When I shut down & restarted the application (r40) - I was not prompted any further for updates. I have not tried publishing a r42 yet to see if it picks up that revision.

I assume I will have to code in a "Check for updates" to allow any end user who skips the update to go back and get it once it has been tested & verified.

Thanks to all for your help. Any further tweaks or words of encouragement are always welcome.

Stephen

S Crook  Monday, February 11, 2008 4:18 PM

Great news!

Yes,the behavior of "Skipping" the upgrade - the next time you re-launch the app you will NOT see the prompt. This is thebehavior that you have observed.

If the user at some later time "wants" to upgradethey can do this by goingto your "publish.htm" and clicking the "install" button...this works aswell.

If you publish yet again a newer revision, the user will again be displayed the prompt to upgrade when they launch the application - just as you alluded to in your comments above.

-Robert Schoen (Microsoft Visual Studio for BizApps Team)

RSchoe-MSFT  Tuesday, February 12, 2008 2:59 AM
Not as great news as it first appears -- or at least a mixed review. I've seen this advice for forcing an update in several places (Brian Noyes' book is another), and what everyone who dispenses this advice seems to miss is that forcing the update in this fashion clears any saved user settings that were being stored in the Settings repository (VS 2005, .NET 2.0). This is a problem if the Settings contain elements that are non-trivial for the user to reconstruct.

More precisely, the forced update creates a new ClickOnce application cache without moving the contents of user.config from the old application cache, in contrast to the usual behavior of a non-forced ClickOnce update. It is possible to manually copy the user.config file across from the old cache -- if you can succesfully navigate a remote user down the pathway to the ClickOnce cache, and assuming the structure of the Settings repository did not change during the update.

This can be worked around pretty simply by not using the Settings repository; the problem, however, is discovering this *after* having deployed a ClickOnce application to hundreds of users. While the problem is still solvable at that point, it's less than pleasant.

There are several ClickOnce gotchas (this is one, and the expiring code-signing certificate problem is another one) that should be made known to technologists up front before they choose ClickOnce as a deployment strategy. Question: has Microsoft assembled a single web page of these known issues, with their resolution status as of VS 2008, .NET 3.0 and .NET 3.5? If not, why not? If so, might I suggest a link to it be placed in a sticky note at the top of this forum? (Trying to set a firmly constructive tone here, not accusatory.)
Richard Dunlap  Monday, February 18, 2008 7:28 PM

Your suggestions are very good. We are currently getting some additional documentation together for SP1 that will hopefully clarify info around some of the "pain" points. I think also - once that info is out and available - getting a sticky as you pointed out posted here would be valuable. I will send a link over to our CO PM and see about making this all happen.

Thanks

Robert Schoen (Microsoft Visual Studio for BizApps Team)

RSchoe-MSFT  Saturday, February 23, 2008 1:39 AM

You can use google to search for other answers

Custom Search

More Threads

• How to update a deployed C# Windows Application VS2005
• Ms Project AddIn not works at Vista (and at xp works fine)
• Beta 2 Click Once Deployment & Helpfiles
• Get User who started the Proccess
• change application name and icon on installation
• ClickOnce Deployment Issue with .Net framework 3.5 sp1
• How Do I Put a Program Group into the All Programs Menu
• do not Uninstall when application is running
• Need to rollback a Installation?
• Application Updater Question