Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-31-2009, 10:54 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
External PM Windows and the Microsoft C Runtime

I'd like those external PM windows back. Now the following is a long explanation just for Stefan's benefit.

And Stefan, I don't know if the situation has changed since then, but back when you decided to remove the external PM windows and use the scripted GUI stuff, you were not properly distributing the C Runtime along with Graal, which led to DLL loading problems.

All modern Windows applications should come with a manifest (external or preferably embedded) that tells Windows which DLL files need to be loaded for the application. Not all DLL files use the manifest functionality clearly, but the C Runtime does. The manifest is designed so multiple variations of the same DLL files can exist side by side.

Now then here is an example of a manifest that should be embedded in or included with the Graal and RC exe files:
PHP Code:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type='win32' 
            name='Microsoft.VC80.CRT'
            version='8.0.50727.3053'
            processorArchitecture='x86'
            publicKeyToken='1fc8b3b9a1e18e3b'
            language='*'
        />
    </dependentAssembly>
</dependency>
</assembly>
Now when windows loads your EXE file and finds this embedded or named exefilename.manifest in the folder, it will attempt to load Microsoft.VC80.CRT version 8.0.50727.3053.

If you have the CRT installed properly (and that specific version), Windows will load this from C:\Windows\WinSxS, if not the program will not run. However, if you don't want to require the user to install the runtime, you have the option of distributing a private assembly along with the Graal executable. A private assembly is a more sophisticated version of simply putting the dll file in the folder with the executable.

Distributing a private assembly would involve placing these four files in the folder with the executable:
PHP Code:
Microsoft.VC80.CRT.manifest
msvcm80
.dll
msvcp80
.dll
msvcr80
.dll 
When Windows attempts to load the Microsoft.VC80.CRT assembly, if it finds a manifest for that assembly in the same folder as the executable, then that manifest will be loaded which in turn loads the 3 DLL files that make up the C Runtime. Loading an individual DLL file of the CRT is improper which is why you can simply dump one of them in with the executable and expect it to work.
__________________

Last edited by Inverness; 04-01-2009 at 03:12 AM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.