Freigeben über


Clickonce internals

Adding your Own Pre-requisite
If we want to add our own Pre-requisite for clickonce app we can use the "Boot Strapper Manifest Generator" (to generate the product.xml and package.xml), installable from the link
https://www.davidguyer.us/bmg/publish.htm

Pre-requisites packages for clickonce are located in  %Microsoft Visual Studio 8%\SDK\2.0\Boot Strapper\ Packages

Modifying the Maifests
Mage and MageUI Tools (mage.exe - command line tool , mageui.exe - GUI ) - Comes with .Net FrameworkSDK / Visual Studio SDK located in  %Microsoft Visual Studio 8%\SDK\2.0\Bin
Used to create\modify  a  new the maifest files.

Reference - https://msdn2.microsoft.com/en-us/library/xhctdw55.aspx

----------------------------------------------------------------------------------------------------------
Clickonce Application Manifest - .manifest extension ( inside the app version folder)
==============
1) assembly element - manifestVersion

<asmv1:assembly manifestVersion="1.0" xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd"

2) assembly identity element - Required. Identifies the application manifest for the ClickOnce application.
 name
 version
 publicKeyToken
 processorArchitecture
 language

<asmv1:assemblyIdentity name="ClickonceTestApp.exe" version="1.0.0.0" publicKeyToken="c4e3b7403e61d2fd" language="neutral" processorArchitecture="msil"

3) Trust info element 
 Application security requirements

  <trustInfo>
    <security>
      <applicationRequestMinimum>
        <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
        <defaultAssemblyRequest permissionSetReference="Custom" />
      </applicationRequestMinimum>
    </security>
  </trustInfo>

4) Dependency Element
 Pre-requisite Assemblies
 Install Assemblies
 
 CLR version

  <dependency>
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
      <assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="2.0.50727.0" />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ClickonceTestApp.exe" size="28672">
      <assemblyIdentity name="ClickonceTestApp" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
      <hash>
        <dsig:Transforms>
          <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
        </dsig:Transforms>
        <dsig:DigestMethod Algorithm="https://www.w3.org/2000/09/xmldsig#sha1" />
        <dsig:DigestValue>EN6Kbfqo1AU4K4/OpvPEzHl1Ito=</dsig:DigestValue>
      </hash>
    </dependentAssembly>
  </dependency>

5) File Element - Required. Identifies each nonassembly file that is used by the application. Can include Component Object Model (COM) isolation data associated with the file.

Reference URL - https://msdn2.microsoft.com/en-us/library/ws1c2fch.aspx

For Each version of App manifest in the root folder, there are
Source location Ex: Server URL
Install Dependednt Assemblies
Publisher Identity, issuerkeyhash

----------------------------------------------------------------------------------------------------------

Clickonce Deployment  Manifest - .deploy extension ( in the root folder)
==============
App - maifest (without version name)
1) assembly element - manifestVersion

<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0"

2) assembly identity element - Required. Identifies the application manifest for the ClickOnce application.
 name
 version
 publicKeyToken
 processorArchitecture
 language

<assemblyIdentity name="ClickonceTestApp.application" version="1.0.0.2" publicKeyToken="c4e3b7403e61d2fd" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />

3) description element -  Required. Identifies application information used to create a shell presence and the Add or Remove Programs item in Control Panel.
 publisher
 product
 supportUrl

<description asmv2:publisher="Microsoft" asmv2:product="ClickonceTestApp" xmlns="urn:schemas-microsoft-com:asm.v1" />

4) Deployment element  -  Optional. Identifies the attributes used for the deployment of updates and exposure to the system.

  <deployment install="true" mapFileExtensions="true">
    <subscription>
      <update>
        <beforeApplicationStartup />
      </update>
    </subscription>
    <deploymentProvider codebase="https://srinivas/ClickonceTestApp/ClickonceTestApp.application" />
  </deployment>

5)Dependency element - Required. Identifies the version of the application to install for the deployment and the location of the application manifest.

  <dependency>
    <dependentAssembly dependencyType="install" codebase="ClickonceTestApp_1_0_0_2\ClickonceTestApp.exe.manifest" size="5842">
      <assemblyIdentity name="ClickonceTestApp.exe" version="1.0.0.2" publicKeyToken="c4e3b7403e61d2fd" language="neutral" processorArchitecture="msil" type="win32" />
      <hash>
        <dsig:Transforms>
          <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
        </dsig:Transforms>
        <dsig:DigestMethod Algorithm="https://www.w3.org/2000/09/xmldsig#sha1" />
        <dsig:DigestValue>s9nT+YQI7jkXCCSYqTu5C4ZVIxw=</dsig:DigestValue>
      </hash>
    </dependentAssembly>
  </dependency>

6) Signature Element - Optional. Contains the necessary information to digitally sign this deployment manifest.

Reference URL  - https://msdn2.microsoft.com/en-us/library/k26e96zf.aspx