ClickOnce

This is a deployment technique that allows for a self-updating Windows based application that can be installed and then run with minimal user interaction
This method of deployment supports offline, automatic updating and rollback
Unlike the Setup / Windows Installer technique nothing is added to the Program Files directory, the registry or to the desktop
Deploying using ClickOnce only supports creating keys under HKEY_CURRENT_USER
link - https://robindotnet.wordpress.com/2010/05/31/enhanced-logging-in-clickonce-deployment/


ClickOnce Facts

ClickOnce does not support writing keys to the registry.
Cannot be used to install and add-in in HKEY_LOCAL_MACHINE
ClickOnce is not capable of deploying additional components such as registry keys.
ClickOnce does not support having the same add-in installed from 2 different locations.
ClickOnce supports digital signing security features.
ClickOnce security relies on a code-signing certificate. You can use the certificate generated by Visual Studio which will give the user a pop-up asking if they trust the source
ClickOnce deployment will grant full trust to Office solutions automatically ??


In Visual Studio 2008 a user can press the Cancel button which disables the add-in
This was fixed in Visual Studio 2008 SP1 so pressing cancel just leaves the old version working


You can make a Visual Studio 2008 add-in for Office 2003 available to all users by creating the registry entries under HKLM instead of HKCU.



Project Properties, Signing Tab

SS
The test certificate is configured to automatically sign the deployment manifest every time you publish


SIgn the ClickOnce Manifest -
Select from store - Allows you to change the certificate if you want to use a different one
Create test certificate - The test certificate that is created for you automatically expires one year after it has been created. If the test certificate has expired the project will not build.
More Details - Displays the "certifcate" dialog box to show you additional information
Timestamp server URL -
Sign the assembly -
Choose a strong name key file -
Change password -
Delay sign only -


Deployment Strategies

There are three different strategies you can choose from
1) Install from a website or network share
2) Installl from a cd
3) Start the application from a website or network share


Strategy 1
Application is deployed to a web server or network share
To install click on an icon on the web page
Application is downloaded, installed and started
Application appears in the Add/Remove Programs dialog box
In the Publish Wizard, click From the Web
This is the default deployment strategy


Strategy 2
Application is saved on a cd
To install click on the file
Application is installed and started
Application appears in the Add/Remove Programs dialog box
In the Publish Wizard, click From a CD-Rom


Strategy 3
To install click on an icon on the web page
Application is started
When the application is closed the application disappears and is no longer available
Nothing is added the Add/Remove Programs dialog box
The application is actually downloaded and installed into the ClickOnce Cache
In the Publish Wizard, click Do not install the Application on the "Install or Run from Web page"



Allows you to publish, update and cache the code locally.


Supports publishing to:

  • local drives

  • UNC paths

  • http sites

  • removable media (cds, dvds, usb drives)


All ClickOnce deployments must be signed with a digital certificate
By default ClickOnce applications are automatically signed with a Self-Cert and are excluded from Trusted Application Deployment.
When you sign a ClickOnce deployment using a certificate, ClickOnce records the date and time of the signing and embeds it into the deployment's digital signature.
As long as the deployment was signed when the certificate was valid, ClickOnce will allow the application to run even if the certificate has since expired.



The IE settings to affect how ClickOnce works if the installer is on a website because the .NET framework uses IE settings to determine if that particular website can be trusted.
Installation folder URL - customers want to deploy the solution locally on their servers.


This is a deployment technique that allows for a self-updating Windows based application that can be installed and then run with minimal user interaction
This method of deployment supports offline, automatic updating and rollback
Unlike the Setup / Windows Installer technique nothing is added to the Program Files directory, the registry or to the desktop
Deploying using ClickOnce only supports creating keys under HKEY_CURRENT_USER
link - https://robindotnet.wordpress.com/2010/05/31/enhanced-logging-in-clickonce-deployment/


How to Deploy VSTO solutions ?

There are several ways of installing your VSTO solutions
1) Run the setup.exe


2) Opening the vsto deployment manifest
(assuming that the VSTO runtime is already installed)


3) Opening the customised workbook or document (document-level only)
(assuming all pre-requisites are already installed and security policy has been set)


4) Opening the host application (application-level only)



Loading a new Version Sequence

Loading the correct version involves several steps
1) The VSTO runtime reads the application manifest embedded in the solution and gets the location of the deployment manifest
2) The VSTO runtime compares the version of the application manifest with the version in the deployment manifest
3) If the versions do not match then the corresponding application manifest is downloaded. This replaces the existing application manifest in the document.
4) The VSTO then reads the location of the assembly and loads it.


Manifests

These are necessary if you are deploying your solutions using the Publish Wizard.
Using application and deployment manifests enable automatic updating and rollback
This deployment architecture is based on two XML files: an application manifest and a deployment manifest:


.vsto (Deployment manifest - VSTO)

This identifies the current version and other deployment settings
The deployment manifests in Visual Studio 2008 have a .vsto file extension
This is the same format as that used for ClickOnce.


.manifest (Application manifest)

Describes all the assemblies that make up the application.
Describes the application including assemblies, dependencies, permissions etc.
Contains information about where the assembly is located and which host item classes need to be created.
There can be several application manifests, one for each version of the customisation.
These are embedded in the Excel and Word VSTO solutions and point to where the assembly is located.
It also points to the corresponding deployment manifest


.deploy (Deployment manifest)

This is only used when you are deploying using ClickOnce.
A .deploy extension is generally added to the end of the deployment and application manifests although this is not mandatory.


.application

This file was only used by Visual Studio 2005 SE
This is to point the VSTO runtime to the most recent version of the application manifest.
There can only ever be one deployment manifest
Normally deployed to a shared folder or web server.
Automatically generated by the Publishing process


This points to the current version of the application manifest
This file is misidentified by Windows Explorer as an application manifest
SS


Utilities > MAGE.exe


Editing Manifest Files

To edit VSTO application manifests you have a couple of options:
1 Use the VSTO Application Manifest Editor
This is an editor that ships with the VSTO SDK


2 Use the ServerDocument object model
This can be used to write a program that can be used to manipulate both the application and deployment manifests. Primarily designed to manipulate the cached data island on the server ?


Reference to the System.Deployment is needed if you want to display Publish version information.
.IsNetworkDeployed property
.CurrentVersion property


Application Cache

Also known as ClickOnce Cache
Also known as the ClickOnce Application Cache or ClickOnce Deployment Cache https://msdn.microsoft.com/en-us/library/267k390a.aspx


All clickonce applications which are installed locally or hosted online are saved on the clients computer in a ClickOnce Application Cache The ClickOnce Cache is a group of hidden folders under the users profile, Local Settings folder.
This folder holds all the application files, assemblies, configuration files, application and user settings.
The folder/cache helps to isolate applications as well as separating different versions of the same applications.


If an application is set to run online then every version that the user has accessed is kept If an application is set to run locally then only the current version and the previously installed one is kept.


Where is the ClickOnce Cache ?


Windows 7 - C:\Users\"username"\AppData\Local\Apps\2.0\
Windows XP - C:\Documents and Settings\"username"\Local Settings\Apps\2.0\


How to clear the ClickOnce Cache ?


There are two ways to clear the (entire) ClickOnce Application Cache mage -cc or
rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache


Cache Storage Quota

A clickonce application that is hosted online has a restriction on the amount of space that it can occupy in the ClickOnce Application Cache A clickonce application that is installed locally are not restricted in size and do not take up any space in the ClickOnce Cache folder A single partially-trusted online application cannot take up more than half of the Cache quota.


By default this size is restricted to 250 MB A system administrator could change this by changing the following DWORD key HKCU \ Software \ Classes \ Software \ Microsoft \ Windows \ CurrentVersion \ Deployment \ OnlineAppQuotaInKb \



Checking at Run time


System.Reflection.Assembly.GetExecutingAssembly().CodeBase


You can access these files using the System.Deployment namespace to determine their runtime location System.Deployment.ApplicationDeployment class


Deployment - Digital Signatures (add the deployment.h)


Adding the digital certificate to trusted publisher's list
Right click on "*.dll" in the installation directory.
Select Properties->Digital Signature tab
Select the Thomson financial certification from the list and click Details button.
The Digital Signature Details window is displayed.
In the General tab click 'View Certificate' button.
The Certificate window is displayed.
In the General tab- click the Install Certificate.
The Certificate Import wizard is displayed
Click the Next button
Select "Place all certificates in the following store" option and click on the Browse button.
Select the "Trusted Publishers" folder from the list.
Click OK
Click Next
Click Finish.


Important

In Visual Studio 2005 the Application Manifest had the following file extension .manifest


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext