Clickonce Windows Installer
- The ClickOnce Bootstrapper package for the.NET Framework 4.5.2 enables the.NET Framework 4.5.2 entry in the list of available prerequisites in Visual Studio 2013.
- AFAIK you can't really use ClickOnce end-to-end to deploy a service; there are issues with both the file locations (ClickOnce installs into a user's profile) and installation (ClickOnce is largely side-effect free).
I need to use Click Once with the Windows Installer but I can't even find Windows Installer on my system. Can someone give me (or point me to a link) on using Windows Installer. It would be great if I can get instructions on using Windows Installer with Click Once. We are running Windows 7 and I need to install an application with some shared dlls.
Any ClickOnce application based on an .exe file can be silently installed and updated by a custom installer. A custom installer can implement custom user experience during installation, including custom dialog boxes for security and maintenance operations. To perform installation operations, the custom installer uses the InPlaceHostingManager class. This walkthrough demonstrates how to create a custom installer that silently installs a ClickOnce application.
Prerequisites
To create a custom ClickOnce application installer
In your ClickOnce application, add references to System.Deployment and System.Windows.Forms.
Add a new class to your application and specify any name. This walkthrough uses the name
MyInstaller
.Add the following
Imports
orusing
statements to the top of your new class.Add the following methods to your class.
These methods call InPlaceHostingManager methods to download the deployment manifest, assert appropriate permissions, ask the user for permission to install, and then download and install the application into the ClickOnce cache. A custom installer can specify that a ClickOnce application is pre-trusted, or can defer the trust decision to the AssertApplicationRequirements method call. This code pre-trusts the application.
Note
Permissions assigned by pre-trusting cannot exceed the permissions of the custom installer code.
To attempt installation from your code, call the
InstallApplication
method. For example, if you named your classMyInstaller
, you might callInstallApplication
in the following way.
Next steps
A ClickOnce application can also add custom update logic, including a custom user interface to show during the update process. For more information, see UpdateCheckInfo. A ClickOnce application can also suppress the standard Start menu entry, shortcut, and Add or Remove Programs entry by using a <customUX>
element. For more information, see <entryPoint> element and ShortcutAppId.
See also
Introduction
This article presents quick and clear steps for the click once deployment techniques for the Infrastructure and Developer/Deployment Team. It covers the web server setup, directory structure, file share and permission tips on the deployment server and basic steps for the developers to deploy and general troubleshooting.
ClickOnce is simple to configure and use without leaving the Visual Studio environment. It is easy to deploy the windows based client application using the interactive tool. The application can be distributed to install and to receive updates in the forms of URL, URI and CD media.
ClickOnce is definitely an advantage over the previous generation of Install and Updater tools provided by Microsoft. There is no need to add a setup/MSI project or struggle with the manifest tool by Application Updater Block anymore.
Upon the install, it creates a shortcut under Programs-->CompanyName-->Product directory. The user should also be able to Remove or Repair the application using Windows 'Add or Remove Program' utility.
Deployment Web Server Setup
In this example, the deployment server is 'MyAppUpdater
'. It has limited access to all the users but it has shared directory with permissions to the developers as, MyAppUpdaterApplicationUpdater to host the deployment files.
There is no need to create the subdirectory or browse to the directory. ClickOnce from the VS2005 IDE creates them automatically for us. Follow the steps below for a quick guide to the deployment.
Publish from Visual Studio 2005
When ready to deploy the application, browse to the property of the StartUp Project, choose Publish tab.
- Publishing Location can be a file path to the MyAppUpdaterApplicationUpdaterMyDeploymentDirectory
- Install URL is the published URL used by the installer.
- 'Application is available offline as well' is the most used option.
Now click on 'Application Files' button to setup the application you would like this publish version to include.
Make appropriate selection for the DLLs if they are needed to copy (Include) or Prerequisite.
Click on 'Prerequisites' button next:
Clickonce Install Location
.NET Framework is a prerequisite for .NET application to run on client machine which does not have .NET Framework installed. When installing this application, ClickOnce checks to see if DOTNETFX2.0 is not installed and installs it. Eliminate the extra steps needed otherwise to download and install the DOTNETFX to the client machines.
Click on 'Updates' button to setup the download option.
You can choose either Before or After application starts option to control the user experience. The application should check for updates to control if this deployment would receive any updates to the products when published to the Publishing Location.
Now click on 'Options' button to setup additional information for the install and update like Support URL, Product and Publisher name, etc.
Most commonly used options are selected in the image below.
'Deployment web page', by default it is always publish.htm, *** a tip is to configure the deployment web server such that the default page is publish.htm, it would save extra keystrokes each time there is an attempt to install from the server or deploy to the server.***
Click on 'Publish Now' button. It should start deploying the application on the deployment server. When finished, it would then launch the Installation URL.
You are ready to distribute the Installation URL to the user or if CD Installation is selected, it would publish in the CD and it is ready to be distributed.
Clickonce Windows Installer Download
Troubleshooting
This application has failed to start because the application configuration is incorrect.
This is the most commonly seen error. Fix to this is, change the app.config file encoding to 'utf-8' instead of default 'Windows-1252' as displayed below:
For other kinds of error, you might need to open the Event Viewer.
Another most common error is when trying to deploy IIS does not allow the files to be downloaded.
The reason being, IIS does not allow to downloading file with .config, .deploy, .application extension for security reasons. Modify the MIME Types for this website to allow these extensions by registering the MIME types for the file extension type as displayed below:
Clickonce Windows 10
Give away the Installation URL, http://applicationUpdater.UltimateProductComapny.com/ProductLaunchKit/ to the users to install for the first time, after that each time the user opens the app, it would check for the auto update and download if a new one is available.
Happy installing, updating and distributing the smart Windows based client application you write. :)