views:

195

answers:

3

Hi, I am deploying an application, where I need to add two prerequisites. My problme is that I need someway to provide version to the prerequisites so that in the future may be I could only update the prerequisites without updating the entire application.

Thank You Sunil Chaudhary

+1  A: 

Installing prerequisites is not part of ClickOnce. ClickOnce is about deploying a .NET application to a user's profile. It cannot run msi files, edit the registry, etc.

There is a lot of confusion about this because of how the deploy process works in Visual Studio. In VS you can choose your prerequisites and it will build a bootstrapper install for you. However, this whole feature really has nothing to do with ClickOnce, it's just a quick way to bundle your prerequisites. It doesn't even do anything intelligent with versioning. All it does is say, "Please install this before running our ClickOnce install for the .NET application." It's completely up to the user at that point.

One option would be to write custom code to get the behavior you want. I did this with a third-party reporting tool that needed to run an msi file. After my app started, I checked the registry to see if the application was installed, prompted the user, downloaded the necessary files in the background, and ran the install. A major pain, but doable as long as your app can initially start with out the prereqs. However, keep in mind security restrictions. A lot of installs require users to be admins. One of the big advantages of ClickOnce is that users don't have to be admins.

whatknott
A: 

Hi, Thanks for your reply, I too thought about the idea somewhat like your but the main problem arises how would one know that the update is new one not the old one. Is there any method so that we can distingush between two updates?

The update to what? Your application or the prereq?
whatknott
ClickOnce handles updates to your application. Updates to the prereq would be completely manual. You would have to programmtically determine what version of the prereq was installed and if it needed updating. How that would be done is probably different depending on the specific prereq.
whatknott
A: 

Can you please explain in detail about custom code are you talking about. I have same problem.

There's no magic to it and it would be different for every individual scenario. The basic steps would be to determine if the prereq was installed (check the registry, check Program Files folder...depends on what you're installing). If not, download the installer, probably via ftp, and run it.
whatknott
PS. Rather than starting a new post, this probably would have been better as a comment on my post. Not trying to be a jerk, just trying to help out SO newcomers :)
whatknott