Custom ClickOnce Installer
According to Walkthrough: Creating a Cu开发者_开发百科stom Installer for a ClickOnce Application MSDN Article it is possible to create a custom ClickOnce installer. The thing I can't understand is how to override the default installer? They say at the end call your custom installer class but where?
Thank you, Ido.
This is because the Microsoft article is a bit misleading. What this article is explaining is how to create a custom installer application. It is not describing how to change your application so that it has a custom installer dialog, instead of the standard one that is part of the system.
To create a customer installer, create a separate application similar to the one outlined in the code from the MSDN article. You will want to add to this application's Main method the code in step #5, however, modify the code to look for the application manifest from your install point. Compile the application and distribute it to your users however you see fit.
Although you will have to manage the distribution of an initial installer application, you can implement this process into your application for updates. In that case, follow the instructions in the article. As I mentioned previously, you will want to check for your updates when and however you desire. Once an update is necessary, your application can call the code in step #5 from within your ClickOnce application.
I had a whole conversation with the ClickOnce guy at Microsoft about this. To be honest, I was irked because they don't really provide enough guidance on it. He said this: You have to create an exe file, but you have to put in checks to make sure the .NET Framework is installed before the exe is run. So create your own executable and run it as setup.exe -- this is where the custom code for installing the application is.
I think ultimately he meant you have to write some kind of bootstrapper in non-.NET code (like C) that checks for the .NET Framework and installs it if needed. Then it would fire off another exe that is managed code that has your calls to the InPlaceHostingManager and the custom UI in it.
精彩评论