Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF and ClickOnce

Tags:

wpf

clickonce

MSDN does not list a WPF .exe as a supported type of application for ClickOnce

A ClickOnce application is any Windows Presentation Foundation (.xbap), Windows Forms (.exe), console application (.exe), or Office solution (.dll) published using ClickOnce technology.

http://msdn.microsoft.com/en-us/library/t71a733d.aspx

I do find evidence around the web that non-XBAP WPF apps work with ClickOnce, but are they officially supported?

like image 593
Eric J. Avatar asked Jan 22 '12 17:01

Eric J.


2 Answers

Yes, ClickOnce does support WPF applications compiled to executables. ClickOnce is nothing more than an installation distribution method. The primary difference between creating an installation package and ClickOnce (other than being web-based) is that ClickOnce applications are installed within obfuscated folders within the end user's Windows directory.

The means that ClickOnce applications can be installed with a non-administrator account. The caveat to this method is that an application can not be installed on a PC and shared across other user accounts on the PC-- each user must re-install the application.

WPF requires the .NET 3.0+ framework. When you publish your ClickOnce application, you will need to include the .NET 3.0 (or 4.0) framework. Once you add the prerequisite to your project, ClickOnce will check the user's PC to see if the framework is installed. If not, it will pre-install it before installing and running your application. If it already exists, it will skip the download and installation of the framework.

If you need to install a third-party library or application, custom pre-requisites can be created and added to your projects. It is worth noting, prerequisites may need to be installed by an administrator, depending on the rights of the end user. This may seem a bit counter-intuitive, but it's just the nature of the installation process.

ClickOnce is a very simple, but robust installation mechanism, and I've used it extensively. It's not appropriate for every circumstance, but it can certainly accomplish what you are asking.

like image 58
RLH Avatar answered Sep 20 '22 10:09

RLH


For ClickOnce, there is no difference between a Windows Forms executable and a WPF executable. Both are .NET executables and as such fully supported by ClickOnce...

I have personally deployed several WPF desktop applications using ClickOnce, and it worked exactly the same as with my Windows Forms applications...

like image 21
Dean Kuga Avatar answered Sep 19 '22 10:09

Dean Kuga