Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Install Prerequisites On Demand Using ClickOnce
 

Install Prerequisites On Demand Using ClickOnce

Hi,

I have a question regarding how to on-demand install additional prerequisites using ClickOnce. (I think this can be done by using the default publish.htm page from web browser).

For example, my version 1.0 application do not need reporting feature. So, in this version, I do not configue it download the reporting runtime as prerequisite. But when come version 2.0, my application comes with the reporting feature which require the reporting runtime to install before the user can view the report. So, how can I enable the user to install the reporting runtime through my application as prerequisite to update their application to version 2.0 (on-demand)?

Regards,
Chosie  Monday, October 31, 2005 4:30 AM

The scenario where pre-requisites change during the lifecycle of an application is not explicitly supported. However, with ClickOnce, if a customer re-runs the Bootstrapper, then any missing pre-requisites will be installed and then the application launched after it's run, so it can be done. The trick, however, is to alert your users who have already installed your app that they need to re-run the bootstrapper. There are a couple ways I can think of to do that.

1) Release an update to your Ver-1 application that uses the System.Deployment API's to determine if there's an update. If there is, it displays some UI to tell (or provide a link) the user to go to the web page, and then run the bootstrapper. Then, you wait until that has propagated, and then release your next update.  As you can see, there are probably some issues with this approach.

2) Figure out where your application will break, i.e. throw an exception, if the prerequisites aren't there. In your new version of the app, catch those exceptions and then show UI that directs the user to re-running the bootstrapper to fixup the problem.  I'm really starting to think that applications that can detect these kinds of installation problems are a good practice because they will also detect, and direct to repairing, problems that can occur after the application has been succesfully installed and used, like if someone goes to the AddRemove programs utility and removes something they didn't realise your app depended on.

 

Hope this helps...

 

David Guyer MSFT  Monday, October 31, 2005 4:59 PM

The scenario where pre-requisites change during the lifecycle of an application is not explicitly supported. However, with ClickOnce, if a customer re-runs the Bootstrapper, then any missing pre-requisites will be installed and then the application launched after it's run, so it can be done. The trick, however, is to alert your users who have already installed your app that they need to re-run the bootstrapper. There are a couple ways I can think of to do that.

1) Release an update to your Ver-1 application that uses the System.Deployment API's to determine if there's an update. If there is, it displays some UI to tell (or provide a link) the user to go to the web page, and then run the bootstrapper. Then, you wait until that has propagated, and then release your next update.  As you can see, there are probably some issues with this approach.

2) Figure out where your application will break, i.e. throw an exception, if the prerequisites aren't there. In your new version of the app, catch those exceptions and then show UI that directs the user to re-running the bootstrapper to fixup the problem.  I'm really starting to think that applications that can detect these kinds of installation problems are a good practice because they will also detect, and direct to repairing, problems that can occur after the application has been succesfully installed and used, like if someone goes to the AddRemove programs utility and removes something they didn't realise your app depended on.

 

Hope this helps...

 

David Guyer MSFT  Monday, October 31, 2005 4:59 PM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce deployment at Orcsweb
• Can't modify assembly properties in deployment project
• Application error logged in event log
• Visual Studio Setup Project and Windows Installer Issues under Vista
• "Destination File" problem
• Why doesn't deployed application install into Program Files Directory?
• Setup dont upgrades previous installation
• Changing the target of an existing shortcut on the desktop, query EXE file version
• Language localization
• Unable to run click-once application every once in awhile.