ClickOnce Ignoring Prerequisites When Installing
-
Wednesday, April 25, 2012 10:14 PM
Hello,
I've created a simple WinForms sample project (Windows 7, .NET 4.0) and in my publish settings I chose that it is only installed locally (not available online) and gave it a prerequisite of SQL Server 2005 Express Edition x86. When I publish it generates 3 items (Application Files (dir), setup.exe, TestApp.applicaiton). If I run the install by double clicking TestApp.application, then I see it doing some sort of downloading (probably copying the install files even though they are local) and after about two seconds my application pops up. It appears that it did not even try to install any of the prerequisites.
If I double click on the setup.exe than I get the message:
Prerequisite check for system component SQL Server 2005 Express Edition SP2 (x86) failed with the following error message:
"This version of SQL Server 2005 Express Edition (x86) is not supported for the current processor architecture."So this is more what I was looking for because it looks like it actually tries installing the prerequisites.
Can someone possibly explain how I can get the TestApp.application to install prerequisites? The reason I am trying to avoid directly executing setup.exe is because I am trying to create my own custom installer (http://msdn.microsoft.com/en-us/library/dd997001(v=VS.100).aspx) so I am only able to directly access the *.applicaiton file.
Any insight would help immensely.
Thank you!
All Replies
-
Friday, April 27, 2012 3:14 PM
installation of the main application will be done by clickonce deployment.
And installation of the prerequisite is done by windows installer based technology.
So it would be better if you create seperate package for both the things.
So just downloaded the pre-requiste separately and install it on the machine before installing the clickonce application.
-
Friday, April 27, 2012 5:45 PM
Thank you for the reply Keshav. What you said makes good sense, but won't I run into same problem?
For instance let's say I have two projects "MainProj" and "PrereqProj".
From what you said, the MainProj won't have any prerequisites. I will need to install the PrereqProj first. When I double click on PrereqProj.application... it still installs without trying to install the prerequisites. Do you know why executing PrerequProj.application doesn't install prerequisites? it seems like it should.
Thanks!
-
Saturday, April 28, 2012 11:01 PM.application does not install prerequisites. it just checks for prerequisites and if they are not present, application fails to install. If you are looking to install prerequisites first and then install you clickonce application, you need to run clickonce bootstrapper package (setup.exe) that is generated via visual studia publish page. This make sure that it install prerequisite as necessary and than lauch clickonce application.
- Proposed As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Tuesday, May 01, 2012 6:20 AM
- Unproposed As Answer by RobinDotNetMVP, Moderator Wednesday, May 02, 2012 6:35 AM
-
Wednesday, May 02, 2012 6:37 AMModerator
The bootstrapper, setup.exe, is what checks to see if the prerequisites are installed. If they aren't, it installs them. After the prerequisites are installed, it invokes the deployment manifest (the .application file) to install the ClickOne application itself.
This way, it doesn't try to install the prerequisites every time you run the application. But it does invoke the deployment URL to check for updates (if you have set it to do so).
RobinDotNet
Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev- Proposed As Answer by RobinDotNetMVP, Moderator Wednesday, May 02, 2012 6:37 AM
-
Wednesday, May 02, 2012 3:54 PM
Thank you for that great feedback gentlemen. I have a greater understanding now how these different files interact and what their main purpose. From what it sounds like, here is what I need to do is run setup.exe as this will install any prerequisites as well as call the deployment manifest to install the application. In regards to (http://msdn.microsoft.com/en-us/library/dd997001(v=VS.100).aspx) it only shows how to install via calling and streaming the *.application. Does anyone have any insight on how this can be achieved so prerequisites are checked? I assume one way is to call the setup.exe directly... however if it is on a web server this might not be ideal. Also, I like how the streaming architecture is setup with a progress and complete callback. Any suggestions I can look into?
Thank you!
-
Wednesday, May 02, 2012 6:10 PM
Hello,
I wanted to add one more reply to this post as I was re-reading and my last post was not entirely clear.
Looking at the example in (http://msdn.microsoft.com/en-us/library/system.deployment.application.inplacehostingmanager.aspx) for the InPlaceHostingManager. It allows you to provide a URI, so I can only provide the *.application path. When this gets streamed and executed it does not execute the bootstrapper and fail if the bootstrapper failed.
Any ideas how I can use this InPlaceHostingManager class in such a way that it will also run the bootstrapper?
Thank you all!
-
Friday, May 04, 2012 4:10 AMModerator
You can't. The InPlaceHosting manager runs the ClickOnce deployment; it's just a way to customize the UI. So you can write your own version (in unmanaged code, because you may not have the .NET Framework installed) of setup.exe that checks for the prerequisites and installs them, and then use the InPlaceHosting manager to run the C/O deployment, OR you can use the setup.exe provided by the ClickOnce publishing.
RobinDotNet
Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev- Marked As Answer by bushman_IL16 Saturday, May 05, 2012 1:05 PM
-
Friday, May 04, 2012 4:49 PM
Hi RobinDotNet,
So it sounds like what you are saying that in my scenario if I want a custom installer to also check prerequisites (calling the bootstrapper). I would need to have the bootstrapper streamed to the user's computer and executed locally and once that has successfully completed, than I can supply the URI to the *.application? Is there an easier way that would not require me to write custom code for downloading the setup.exe?
It seems not entirely useful since every single install would potentially want to check for prerequisites and since the bootstrapper would need to be called seperately, it somewhat takes away from the simplicity and elegance of calling ClickOnce from a web server. Sorry, not ranting, just hoping I understand all this correctly.
Thanks!
-
Saturday, May 05, 2012 5:02 AMModerator
You can't check for the prerequisites with a ClickOnce application, because presumably the .NET Framework would be one of your prerequisites, and you can't use the ClickOnce technology until that is installed. You can't use the InPlaceHosting manager to install prerequisites. You have to create your own.
I'm not sure what you are trying to accomplish here. Are you wanting to check the prerequisites for updates every time the user runs the application? You would have to run the bootstrapper over and over again. Do you really expect your prerequisites to change that often?
RobinDotNet
Click here to visit my ClickOnce blog!
Microsoft MVP, Client App Dev- Proposed As Answer by RobinDotNetMVP, Moderator Saturday, May 05, 2012 6:03 PM
-
Saturday, May 05, 2012 1:04 PM
Thanks for your reply RobinDotNet,
I have been doing more research since I was still fuzzy on the subject. You are absolutely correct, I wouldn't want to have the bootstrapper run everytime the application updates but what I was trying to accomplish was not having them run the bootstrapper directly at all. I've figured out a way to work this into my requirements.
Thanks for clearing things up!


