How to deploy and update ClickOnce applications using MSI?

I am creating a product that will be installed using MSI on the customer's server and want to use ClickOnce so that they can easily deploy the Thin Clients of the system. I have yet to find a tutorial or writeup on how to deploy and update ClickOnce applications using MSI. Does anyone know of a good one?
Thanks,
Adam.
[343 byte] By [KingNerd] at [2007-12-25]
# 1
I came across the same problem as you. I searched for almost all docs in web pages, but did not find any hints. Is it possible to publish winapp in msi using clickonce? If you solve this problem, let me know in time. And Many thanks to you.
email: robossliu@hotmail.com
RobossLiu at 2007-10-8 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 2
So you are using an MSI to install the "server components" of your application, which will include ClickOnce files so client machines can install the client?

I would think that MSIs would treat the ClickOnce files just like... well... files. If you have a directory on the server that will house the ClickOnce files (*.application, *.manifest, your bits, etc.), then deploy then in the MSI like regular old files. Your client accessing them will then need to know the path to them (UNC or URL) to install the client via ClickOnce.

HTH,
Jason

jwyckoff at 2007-10-8 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 3
When you deploy a windows form application with ClickOnce in the project options then it will copy a bunch of files to a directory on your web server. It also packages up all the files that will get deployed to the client's computer in a "setup.exe" file and copies it to the web server.
If I wanted to include the ClickOnce created setup.exe file in my application installer that installs my whole application which includes multiple serverices, database creation scripts, etc then how would I do that. It looks like the deploy process of ClickOnce actually creates that setup.exe file. How would I add this file to my automated build so that it could get added to my main application installer? Is this even possible?
KingNerd at 2007-10-8 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 4

If I understand correctly, you are building a WebSetup to install a web site that will host the ClickOnce apps. And, you want to be able to get the ClickOnce manifests configured properly for that server.

You can do this, but it is a bit complex. Basically, you will need to write a custom action that your web setup project uses to update the ClickOnce files and do a bunch of configuration stuff. Here are the things your code probably needs to do:

  1. Use Mage.exe (in the .NET Fx SDK, so you might need to create a bootstrapper pacakge for the .NET Fx SDK) to update the ClickOnce manifest with the server URL.
  2. Use Mage.exe to re-sign the manfest. What really stinks about this is that you'll need to include the certificate in your setup project, which makes it extractable and insecure. This may just clobber this whole plan. The only workaround I can think of is to use a pre-deployed certificate that is in the certificate store.
  3. Update the bootstrapper's URL by running setup.exe /url
  4. Re-sign the boostrapper (optional) using SignTool
  5. Update the web server's Mime types, at least for that Virtual Directory.

Here's some resources that can help with these steps:

Creating a Custom Action: Passing Data to a Custom Action Walkthrough http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkwalkthroughpassingdatatocustomaction.asp

Properties to use in the WebSetup to Pass to the Custom Action to Know the server URL:

Okay, drat, I can't find this right now, and I can't install a WebSetup on my machine since I don't have IIS on it :-(... so you find the correct property by:

  1. Create a WebSetup project
  2. Install it from the Command line using misexec /i mywebsetup.msi /l*v mylog.txt
  3. Open mylog.txt and go to the bottom and look through the ones marked "Property(S)" or the (C) ones until you find the property name with the right value in it.

Creating a Boostrapper Package: Bootstrapper Manifest Generator

http://gotdotnet.com/Workspaces/Workspace.aspx?id=ddb4f08c-7d7c-4f44-a009-ea19fc812545

Modifying Mime Types:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=11106&SiteID=1

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxgrfappmappingsproperty.asp

Like I said, the tools are there to make it possible, but it's not built-in to make this doable. You could enter a suggestion on the MSDN Product Feedback Center.

Good Luck!

DavidGuyerMS at 2007-10-8 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 5

Nice post David.

Deploying a ClickOnce application on the server via an MSI package (or any install package) is far too complicated like stated above. In my opinion, signing the manifests and upfront knowledge of the URL are show stopper issues when packaging ClickOnce applications.

Creating a build process and deployment process for ClickOnce applications is very painful. The right click / publish is nice, but useless when it comes to creating a real deployment. On top of that, ClickOnce on the client side doesn't even work correctly when launched from Firefox or if Firefox is the default browser. If the URL does not have to be baked into the deployment manifest and bootstrapper, I believe things would be a lot better.

It's a shame because ClickOnce was so close to being awesome.

Is there a suggested strategy where you don't need the URL up front and take all the drastic steps listed in David's post, like deploying a certificate? I can create an "online only" deployment, and maybe a separate package to install the prerequisites. At the end of the day, that would be right back to where I was with no touch deployment though.

Thanks,
Jon

Jon_ProactiveLogic at 2007-10-8 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...
# 6

Hi,

David your post did help us through the server install issues. I posted a little bit of our solution to this issue here:

http://proactivelogic.com/blog/index.php/2006/09/30/packaging-a-clickonce-server-deployment/
http://proactivelogic.com/blog/

A lot of it uses David's advise, with some additional information on tying it all together.

Hope this helps-
Jon

Jon_ProactiveLogic at 2007-10-8 > top of Msdn Tech,Windows Forms,ClickOnce and Setup & Deployment Projects...