This project is read-only.

Configuration

Q: How to provide multiple updates available on server for download?

A: You will need to follow the below mentioned steps to provide multiple updates on server available for download:
  • Create separate manifest file corresponding to each update
  • Create entry of each manifest file in the main manifest file (manifest.xml)
  • Modify the manifestedId corresponding to the update which needs to be downloaded

Create separate manifest file corresponding to each update:
Use manifest editor to create separate manifest file corresponding to each update.

Example:
File: msi_patch.xml
<manifest  manifestid="{C18DC1E6-001C-4d5b-9A84-DD3E1C580552}" 
    mandatory="False"
      xmlns="urn:schemas-microsoft-com:PAG:updater-application-block:v2:manifest">
        <description> Patch the simple application </description> 
    <application applicationid="{215E1AD7-9ABA-432f-A952-24BABA556850}"> </application> 
    <entrypoint file="" parameters=""> </entrypoint> 
    <location>.\..\..</location> 
    <files base="http://localhost/Updater2QuickStarts/cs/msi/server/"> </files> 
    <file source="SimpleApplication.msp"> 
    </files> 
    <activation>
    <tasks>
    <task
    type="Microsoft.ApplicationBlocks.Updater.ActivationProcessors.MsiProcessor,
  Microsoft.ApplicationBlocks.Updater.ActivationProcessors" name="MSIProcessor"\>
    <config>
    <installtype>Patch</installtype>
    <packagepath>SimpleApplication.msp</packagepath>
  <propertyvalues>REINSTALL=ALL REINSTALLMODE=omus</propertyvalues>
    <uilevel>msiUILevelProgressOnly</uilevel>
    </config>
    </task>  
     </tasks>  
    </activation> 
    </manifest> 



Create entry of each manifest file in the main manifest file (manifest.xml):
Use manifest editor to include the reference to all manifest files related to application update. The related manifest files should be included under the <includemanifest> Tag

Example:
File: Manifest.xml
<manifest manifestid="{311085F7-9320-4318-9A67-9BE32F04E933}" xmlns="urn:schemas-microsoft-com:PAG:updater-application- block:v2:manifest">   
              mandatory="False" 
       xmlns="urn:schemas-microsoft-com:PAG:updater-application-block:v2:manifest">
      <description>Install the simple application</description>
    <application applicationid="{215E1AD7-9ABA-432f-A952-24BABA556850}">
    <entrypoint file="" parameters=""/>
      <location>.\..\..</location>
        </application>
        <files base="http://localhost/Updater2QuickStarts/cs/msi/server/">
          <file source="SimpleApplicationSetup.msi">
  </files>
    .........................

      <includedmanifests>
    <manifest location="msi_patch.xml" manifestid="{C18DC1E6-001C-4d5b-9A84- manifestid="{C18DC1E6-001C-4d5b-9A84-D3E1C580552}"/>
      <manifest location="msi_remove.xml" manifestid="{AAB3F1B4-6CBC-48ea-80FE-5177212BE318}"/>
     </includedmanifests>
</manifest>


Modify the manifestedId corresponding to the update that needs to be downloaded:
The manifestId attribute of the manifest tag in the manifest file need to updated for each file that needs to be downloaded

Example:
    <manifest mandatory="False" manifestid="{C18DC1E6-001C-4d5b-9A84-DD3E1C580552}"
     xmlns="urn:schemas-microsoft-   com:PAG:updater-application-block:v2:manifest">


Q: Do I need to include the full path in source attribute of File element in Manifest.xml?

A: No, the full Path is not required. The Updater will pick up the path from base attribute of the files element.

Example:
    <files base="http://localhost/Updater2QuickStarts/cs/msi/server/">
     <file source="SimpleApplicationSetup.msi"/>
     </files>


Q: What do we need to change in manifest.xml so that updater know that there is an update available?

A: You will need to change the manifestID attribute of the manifest tag in Manifest.xml file on server. The updater compares the manifest ID of server’s Manifest with applied Manifest on the client. The applied Manifests are stored in the UAB\applications\<application-id> subfolder, which gets created on the client machine in the application folder.

Example.:
    <manifest mandatory="False" manifestid="{C18DC1E6-001C-4d5b-9A84-DD3E1C580552}"
    xmlns="urn:schemas-microsoft-com:PAG:updater-application-block:v2:manifest">


Q: How to provide Partial Updates using File hash comparison?

A: The Updater Application Block includes the ability to compare file hashes on potential download files to verify whether the versions currently on the client computer differ from the updates available on the server. This lets you minimize the number of downloaded files, therefore minimizing the overall time for the update process to occur.

You will need to follow the below mentioned steps:
  • Modify the files and file elements in the manifest file
  • Compare file hashes of client and server files

Modify the files and file elements in the manifest file:
Modify the files and file elements in the manifest file to include the hash comparison flag, the hash of the file on the server, and the hash provider to use.

The following code shows an example of the files element of a manifest file that uses hash comparisons.
    <files base="http://localhost/Updater2QuickStarts/cs/AutoInproc/server/" 
      hashcomparison="Yes" hashprovider="hmac1">
      <file hash="a5aqUnlIyzu670VDJW8lSwXJdJM=" source="AutoInproc.exe">
          <file hash="0UOXi/+fNtBihjD9Vv8WS+1NBCo=" source="AutoInproc.pdb">
     </files> 


Compare file hashes of client and server files:
When the manifest is retrieved from the server, the hash comparison flag is checked. If this flag is set to true, the hash value retrieved from the manifest is compared with the file on the client computer and if the file has not changed, it is removed from the list of files to download in the manifest class.

Deployment

Q: How to resolve the “Specified cast not valid” error, which comes with BITSDownloader?

A: This error comes if you have Background Intelligent Transfer Service (BITS) version older than v1.5. IBackgroundCopyJob2 was made available from BITS v1.5 onwards.

You will need to follow the below mentioned steps:
  • Check the version of BITS on your machine
  • Update the version if BITS version on your machine is older

Check the version of BITS on your machine:

To check the version of BITS on the client computer, check the version of QMgr.dll. To find the version number of the DLL:
  1. Locate QMgr.dll in %windir%\System32.
  2. Right-click QMgr.dll and click Properties.
  3. Click the Version tab.
  4. Note the version number.
  5. The below table lists the versions of BITS and their corresponding QMgr.dll file version numbers

BITS Version QMgr.dll Version
BITS 2.0 6.6.xxxx.xxxx
BITS 1.5 6.5.xxxx.xxxx
BITS 1.2 6.2.xxxx.xxxx
BITS 1.0 6.0.xxxx.xxxx


Update the version, if BITS version on your machine is older:
The BITS version on your machine should be higher or equal to BITS v1.5. On Windows XP, BITS 2.0 gets installed as part of SP2.

If the version is not appropriate, download the versions from the links mentioned below:

The following is the link to download BITS v2.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=B93356B1-BA43-480F-983D-EB19368F9047&displaylang=en

The following is the link to download BITS v1.5
http://www.microsoft.com/downloads/details.aspx?FamilyID=8c6ef6c8-2abf-43c7-ab51-e0c53303086d&DisplayLang=en

Q: I am getting System.UnauthorizedAccessException while using UAB in my Web Application. How do I resolve this error?

A: You will need to follow the below mentioned steps:
  • Check that manifest.xml file in the web application does have the read permission in IIS
  • If not, then select the read attribute of the manifest.xml

Check that manifest.xml file in the web application does have the read permission in IIS:
  1. In IIS Open properties for the Folder, which contains Manifest.xml
  2. Check whether the Read Checkbox is selected on the Directory Tab

If not, then select the read attribute of the manifest.xml:
  1. If the Read Checkbox is not selected on the Directory Tab, you will need to select it.

Q: How to remove the old version folders from the client machine?

A: You will need to follow the below mentioned steps:
  • Develop the custom Activation Processor
  • Configure the custom Activation Processor

Develop the custom Activation Processor:
To create an activation processor class:
  1. Add references to the following assemblies:
    1. Microsoft.ApplicationBlocks.Updater.dll
    2. Microsoft.Practices.EnterpriseLibrary.Configuration.dll
  2. Import the Microsoft.ApplicationBlocks.Updater namespace
  3. Create a new class, which implements IActivationProcessor interface of Microsoft.ApplicationBlocks.Updater namespace.
  4. Implement the following methods defined in the IActivationProcessor interface.
    1. Init: Add any initialization code to this method
    2. PrepareExecution: Add code to this method to verify that any prerequisites for the execution are met. If the prerequisites are not met, you should raise an exception to the calling code.
    3. Execute: Add code to this method to delete the old version folders
    4. OnError: Add code to this method that should run if a later processor in the chain fails.

Configure the custom Activation Processor:
You can configure a client application to use a custom activation processor by modifying the activation element in the manifest file.

Example:
    <activation> 
  <tasks>
    <task name="DeletedOldVersionsProcessor" type="MyApp.RegistryProcessor, MyApp"/>
     </tasks>
  </activation>


Q: I am facing a problem for first time setup that stated -"Server doesn't support Range Header". How can I fix it?

A: This occurs if your update includes a file whose extension is included in the App Mappings under IIS virtual folder configuration.

You will need to perform following steps:
  • Check the IIS App Mappings of application virtual Directory
  • Remove the App Mapping for certain file extensions(if required)

Check the IIS App Mappings of application virtual Directory:
  1. Open the properties of Application Virtual Directory
  2. Select Configuration option from Virtual Directory Tab
  3. In Application Configuration screen, check whether App Mapping exists for the Update File Types.

Remove the App Mapping for certain file extensions (if required):
  1. If there is an App Mapping corresponding to the Update File Type, you will need to remove it.

Q: Why does IIS 6.0 blocks request for some file types when requested via Updater?

A: Earlier versions of IIS include a wildcard character MIME mapping, which permits IIS to serve any file regardless of its extension. IIS 6.0 does not include this wildcard character MIME mapping and does not serve any type of extension that is not defined at the Mime Map node in the IIS metabase.

You will need to follow the below mentioned steps:
  • Define the MIME type in IIS for the specific file extension

Define the MIME type in IIS for the specific file extension:
  1. Open the IIS Microsoft Management Console (MMC), right-click the folder name, and then click Properties.
  2. On the HTTP Headers page, click Mime Types.
  3. Click New.
  4. In the Extension box, type .pdb or any required extension.
  5. In the MIME type box, type a valid MIME type (for example, binary.).
  6. Apply the new settings. IIS now serves files with the extension that you added. In this example, IIS now serves files with the extension specified above.

Downloader

Q: I need to use IBackgroundCopyJob2 to send Credential information the server. How to use it? Are there any samples available?

A: The BITS 2.0 fix posted on the GDN workspace, contains a BitsCredentialWrapper.CPP that contains the fix for using IBackgroundCopyJob2 for setting the credentials.

The details are provided at http://www.gotdotnet.com/workspaces/releases/viewuploads.aspx?id=83c68646-befb-4586-ba9f-fdf1301902f5

Q: How can I provide the proxy server information to download the manifest information at runtime?

A: You will need to perform the following steps:
  • Import Namespace System.Net
  • Provide Proxy server Information

Import Namespace System.Net:
You will need to import the namespace System.Net.

Provide Proxy server Information:
You will need to provide the Proxy server information before giving call to CheckForUpdates() method.

Example:
    Uri proxyURI = new Uri ("http://webproxy:80"); 
    GlobalProxySelection.Select = new WebProxy (proxyURI);

Processor

Q: I need to perform certain operation after WaitForApplicationExit Processor installs all files in the client application folder. How can I do this?

A: You will need to follow the following steps:
  • Subscribe to ActivationCompleted event of ApplicationUpdater Manager
    • Handle the ActivationCompleted event

Subscribe to ActivationCompleted event of ApplicationUpdaterManager:
Declare the event as per the below syntax:
    updater.ActivationCompleted +=new ActivationCompletedEventHandler(updater_ActivationCompleted); 


Handle the ActivationCompleted event:
Handle the event and write the code for operation you need to perform after WaitFor ApplicationExit Processor installs all files in the client application folder.

Example:
    private void updater_ActivationCompleted(object sender, ActivationCompleteEventArgs e) 
    { 
    // Add your implementation here 
   }   

Last edited Feb 23, 2007 at 2:48 PM by jonathanmenasches, version 5

Comments

No comments yet.