Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom ClickOnce Installer

Tags:

.net

clickonce

According to Walkthrough: Creating a Custom 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.

like image 809
Ido Ran Avatar asked Jun 29 '11 19:06

Ido Ran


People also ask

Is ClickOnce still supported?

ClickOnce and DirectInvoke in Microsoft Edge | Microsoft Learn. This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

How do I install prerequisites with ClickOnce application?

Select the Publish pane. Click the Prerequisites button to open the Prerequisites dialog box. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components check box is selected. In the Prerequisites list, check the components that you wish to install, and then click OK.

What is ClickOnce installation?

ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction.


2 Answers

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.

like image 147
RLH Avatar answered Oct 12 '22 08:10

RLH


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.

like image 25
RobinDotNet Avatar answered Oct 12 '22 08:10

RobinDotNet