October 31, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Visual C++ 2005 IDE Enhancements, Part 4: Beta 2 Changes

  • May 9, 2005
  • By Nick Wienholt
  • Send Email »
  • More Articles »

The final step is nominating the security requirements that the application needs to run. For a C++/CLI application compiled with /clr:pure, the assembly produced will not be verifiably type safe, and the Full Trust permission set will be required. An application downloaded from an intranet or the Internet will not be granted this permission set by default. The end-user will be prompted to increase the permissions granted to this application when it runs.

Once the application manifest is complete, it can be signed and saved. The following are the contents of the manifest produced, excluding the XML signature, for COTest:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schema
                Location="urn:schemas-microsoft-com:asm.v1
                assembly.adaptive.xsd" manifestVersion="1.0"
                xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
                xmlns="urn:schemas-microsoft-com:asm.v2"
                xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
                xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<asmv1:assemblyIdentity name="COTest.exe" version="1.0.0.0"
                        publicKeyToken="0000000000000000"
                        language="neutral"
                        processorArchitecture="msil"
                        type="win32" />
   <application />
      <entryPoint>
         <assemblyIdentity name="COTest"
                           version="1.0.0.0"
                           language="neutral"
                           processorArchitecture="x86" />
         <commandLine file="COTest.exe" parameters="" />
      </entryPoint>
      <trustInfo>
         <security>
         <applicationRequestMinimum>
            <PermissionSet class="System.Security.PermissionSet"
                           version="1"
                           Unrestricted="true"
                           ID="Custom"
                           SameSite="site" />
            <defaultAssemblyRequest permissionSetReference="Custom" />
         </applicationRequestMinimum>
         </security>
      </trustInfo>
      <dependency>
         <dependentAssembly dependencyType="install"
                            allowDelayedBinding="true"
                            codebase="COTest.exe"
                            size="27648">
         <assemblyIdentity name="COTest"
                           version="1.0.0.0"
                           language="neutral"
                           processorArchitecture="x86" />
         <hash>
         <dsig:Transforms>
            <dsig:Transform
               Algorithm="urn:schemas-microsoft-com:HashTransforms.
                              Identity" />
            </dsig:Transforms>
            <dsig:DigestMethod
               Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
            <dsig:DigestValue>
               wWWjlZfzs0BZNXX3QyDQzJgRTTY=</dsig:DigestValue>
         </hash>
         </dependentAssembly>
      </dependency>
      <dependency>
         <dependentAssembly dependencyType="preRequisite"
                            allowDelayedBinding="true">
         <assemblyIdentity
            name="Microsoft.Windows.CommonLanguageRuntime"
            version="2.0.50215.0" />
         </dependentAssembly>
      </dependency>
</asmv1:assembly>

The final piece of the ClickOnce story is the deployment manifest. As with the application manifest, it can be produced by either the command-line or GUI SDK tool. To mix things up a little, this example uses the command-line Mage.exe. As stated earlier, a deployment manifest contains information about how an application is distributed and updated. To create the deployment manifest, use the following command line:

mage -New Deployment
     -ToFile CoTest.application
     -Name "CoTest"
     -Version 1.0.0.0
     -AppManifest CoTest.exe.manifest

Looking at each of the command line parameters in turn, this statement will create a new deployment manifest to a file named CoTest.application. The name of the deployment will be CoTest, the most current version will be 1.0.0.0, and the deployment manifest will point to the application manifest CoTest.manifest. By default, the deployment manifest generated will run the deployed application in online-only mode (**The Visual Studio documentation in Beta 2 incorrectly states the opposite.**). To have the ClickOnce application installed so that it can be run offline, use the -Install true command-line parameter when generating the deployment manifest.

The following is the deployment manifest generated by the command line above:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1
       assembly.adaptive.xsd"
       manifestVersion="1.0"
       xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
       xmlns="urn:schemas-microsoft-com:asm.v2"
       xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
       xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
       xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity name="CoTest.app"
                  version="1.0.0.0"
                  publicKeyToken="0000000000000000"
                  language="neutral"
                  processorArchitecture="msil"
                  xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="."
             asmv2:product="CoTest"
             xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="false" />
<dependency>
   <dependentAssembly dependencyType="install"
                      allowDelayedBinding="true"
                      codebase="CoTest.exe.manifest"
                      size="1961">
      <assemblyIdentity name="COTest.exe"
                        version="1.0.0.0"
                        publicKeyToken="63026ad33ba9ab1b"
                        language="neutral"
                        processorArchitecture="msil"
                        type="win32" />
      <hash>
         <dsig:Transforms>
         <dsig:Transform
            Algorithm="urn:schemas-microsoft-com:HashTransforms.
                           Identity" />
         </dsig:Transforms>
         <dsig:DigestMethod
            Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
         <dsig:DigestValue>
            bBXpM0xYmqDcEqzUpD6Ja+F5XRU=
         </dsig:DigestValue>
      </hash>
   </dependentAssembly>
</dependency>
</asmv1:assembly>




Page 2 of 3



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel