PTV MapServer SDK 5.6: Registry-Free installation – avoid a DLL-hell!

All ancient PTV MapServer versions result in a registry-based integration of the PTV MapServer-COM-DLLs. When the installation is complete, the new PTV MapServer version is also available to all other applications using it – many customers maintain a map&guide and an own developed application on their own system.

A real disadvantage of this system-wide PTV MapServer installation is the risk of overwriting the configuration of an already existing PTV MapServer-application, which is highly bounded to its own PTV MapServer version. This behaviour results into the so-called DLL-hell.
Commonly a PTV MapServer update should not cause any problems, because the PTV MapServer interface is kept downwards compatible – but due to its huge amount of functionality, its semantic behaviour may change unintentionally from time to time. So, the opportunity to provide an application with its own dedicated and tested PTV MapServer is preferable.
To achieve this goal, the PTV MapServer SDK 5.6 supports a technology called “win32 side-by-side”. With Windows XP, Microsoft introduced this technology. Central point is an application specific manifest, which is an XML file matching a predefined schema (further details can be seen in http://msdn2.microsoft.com/en-us/library/aa375632.aspx). Inside, it refers to all COM-DLLs used by this application, especially their locations in the filesystem. To make these DLLs only known to the application, a subfolder of the application exe can be used.
To provide a convenient way for a registry-free installation, the PTV MapServer InstKit Setup contains a manifest with all existing PTV MapServer-DLLs. The references of these DLLs all link to a subfolder named PTV.Logistics.MapServer, to where the InstKit setup copies these DLLs. This happens, if an exe-path is specified in the command line of the InstKit setup:

 setup.exe -s -ptv:Path"c:/programs/MyCompany/MyApplication.exe"

Please pay attention for a correct specification of the parameter -ptv:Path: Spelling mistakes result in a registry-based installation, which is apparently not desired. Also the -characters have to be used, independently of existing spaces inside the pathname.

If the spelling is correct, the InstKit-setup

  • copies all PTV MapServer-DLLs to the folder c:/programs/MyCompany/PTV.Logistics.MapServer, whereat no COM registration is performed. So, these DLLs remain unknown to other applications.
  • copies and renames the application-specific manifest to c:/programs/MyCompany/MyApplication.exe.manifest. This naming convention (appending .manifest at the end of the exe-filename) is mandatory for a correct functioning. This application-specific manifest only contains a reference to a PTV MapServer specific manifest in the PTV.Logistics.MapServer folder.

This approach offers the opportunity to aggregate other third-party-DLLs in the same manner by simply adding <assemblyIdentity>keys in the application’s manifest:

MyApplication.exe.manifest

...
<dependency>
 <dependentAssembly>
 <assemblyIdentity name="PTV.Logistics.MapServer" version="5.6.0.10" type="win32" processorArchitecture="x86"/>
 <assemblyIdentity name="ThirdPartyLTDFolderName" version="4.7.1.1" type="win32" processorArchitecture="x86"/> </dependentAssembly>
</dependency>
...

Please be aware, that the manifest-mechanism is based on the Microsoft-COM technology itself, it is not implemented by the PTV MapServer.

Information and contact data for questions concerning PTV MapServer:

This entry was posted in PTV Mapserver and tagged , , , by Martina Beck. Bookmark the permalink.

About Martina Beck

Martina Beck has been working for PTV since 2000. As certified computer scientist she was originally responsible for providing customers with technical support and she later moved on to the Product Management division. Since 2011 she has been working for PTV as an online marketing manager in international marketing with an emphasis on social media (et al. Facebook, Twitter, Google+, YouTube). The PTV Developer Blog is the PTV Developer Components' lead channel. The posts on important topics and trends originate from close cooperation with developers, the product management and other experts.