[commit] r1667 - in trunk: GME/Meta GME/Mga GME/Parser Install Install/Build

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Fri Nov 4 17:36:18 CDT 2011


Author: ksmyth
Date: Fri Nov  4 17:36:18 2011
New Revision: 1667

Log:
tools.py: CoCreateInstance accoring to --arch. Need AppIDs for out-of-proc activation

Modified:
   trunk/GME/Meta/MgaMetaProject.rgs
   trunk/GME/Mga/MgaProject.rgs
   trunk/GME/Parser/MgaParser.rgs
   trunk/Install/Build/tools.py
   trunk/Install/GME_bin.wxs

Modified: trunk/GME/Meta/MgaMetaProject.rgs
==============================================================================
--- trunk/GME/Meta/MgaMetaProject.rgs	Fri Nov  4 15:51:23 2011	(r1666)
+++ trunk/GME/Meta/MgaMetaProject.rgs	Fri Nov  4 17:36:18 2011	(r1667)
@@ -20,6 +20,7 @@
 			{
 				val ThreadingModel = s 'Apartment'
 			}
+			val AppID = s '{461F30AF-3BF0-11D4-B3F0-005004D38590}'
 			'TypeLib' = s '{0ADEEC71-D83A-11D3-B36B-005004D38590}'
 		}
 	}

Modified: trunk/GME/Mga/MgaProject.rgs
==============================================================================
--- trunk/GME/Mga/MgaProject.rgs	Fri Nov  4 15:51:23 2011	(r1666)
+++ trunk/GME/Mga/MgaProject.rgs	Fri Nov  4 17:36:18 2011	(r1667)
@@ -20,6 +20,7 @@
 			{
 				val ThreadingModel = s 'Apartment'
 			}
+			val AppID = s '{461F30AF-3BF0-11D4-B3F0-005004D38590}'
 			'TypeLib' = s '{270B4F86-B17C-11D3-9AD1-00AA00B6FE26}'
 		}
 	}

Modified: trunk/GME/Parser/MgaParser.rgs
==============================================================================
--- trunk/GME/Parser/MgaParser.rgs	Fri Nov  4 15:51:23 2011	(r1666)
+++ trunk/GME/Parser/MgaParser.rgs	Fri Nov  4 17:36:18 2011	(r1667)
@@ -20,6 +20,7 @@
 			{
 				val ThreadingModel = s 'Apartment'
 			}
+			val AppID = s '{461F30AF-3BF0-11D4-B3F0-005004D38590}'
 			'TypeLib' = s '{70C41B15-E3CE-11D3-B37A-005004D38590}'
 		}
 	}

Modified: trunk/Install/Build/tools.py
==============================================================================
--- trunk/Install/Build/tools.py	Fri Nov  4 15:51:23 2011	(r1666)
+++ trunk/Install/Build/tools.py	Fri Nov  4 17:36:18 2011	(r1667)
@@ -27,6 +27,15 @@
     "General Exception Class for all build problems"
     pass
 
+def Dispatch(progid):
+    from pythoncom import CLSCTX_ALL, CLSCTX_LOCAL_SERVER
+    CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000
+    CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000
+    if prefs['arch'] == 'x64':
+        return win32com.client.DispatchEx(progid, clsctx=CLSCTX_LOCAL_SERVER|CLSCTX_ACTIVATE_64_BIT_SERVER)
+    else:
+        return win32com.client.DispatchEx(progid, clsctx=CLSCTX_LOCAL_SERVER|CLSCTX_ACTIVATE_32_BIT_SERVER)
+
 #
 # Tools/utilities
 #
@@ -131,8 +140,8 @@
     extension.
     """
     toolmsg("Parsing " + xml_file + " with paradigm " + paradigm)
-    parser  = win32com.client.Dispatch( "MGA.MgaParser" )
-    project = win32com.client.Dispatch( "MGA.MgaProject" )
+    parser  = Dispatch( "MGA.MgaParser" )
+    project = Dispatch( "MGA.MgaProject" )
     mga_file = os.path.splitext(xml_file)[0] + ".mga"
     project.Create( "MGA="+mga_file, paradigm )
     parser.ParseProject( project, xml_file )
@@ -150,7 +159,7 @@
     extension.
     """
     toolmsg("Parsing and registering " + xml_file + " (" + paradigm + ")")
-    registrar = win32com.client.Dispatch( "MGA.MgaRegistrar" )
+    registrar = Dispatch( "MGA.MgaRegistrar" )
     # KMS: registering user fails if system is already registered. TODO: remove so we dont need elevation
     if paradigm in registrar.GetParadigmsDisp(2):
         registrar.UnregisterParadigm(paradigm, 2)
@@ -165,7 +174,7 @@
     
     returns the GUID as a string
     """ 
-    metaproject = win32com.client.Dispatch("MGA.MgaMetaProject")
+    metaproject = Dispatch("MGA.MgaMetaProject")
     metaproject.Open('MGA=' + mta_file)
     try:
         import uuid

Modified: trunk/Install/GME_bin.wxs
==============================================================================
--- trunk/Install/GME_bin.wxs	Fri Nov  4 15:51:23 2011	(r1666)
+++ trunk/Install/GME_bin.wxs	Fri Nov  4 17:36:18 2011	(r1667)
@@ -267,11 +267,13 @@
                 <ProgId Id="Mga.MgaMetaConstraint" Description="MgaMetaConstraint Class" />
               </ProgId>
             </Class>
-            <Class Id="{83BA3244-B758-11D3-ABAE-000000000000}" Context="InprocServer32" Description="MgaMetaProject Class" ThreadingModel="apartment" Programmable="yes">
-              <ProgId Id="Mga.MgaMetaProject.1" Description="MgaMetaProject Class">
-                <ProgId Id="Mga.MgaMetaProject" Description="MgaMetaProject Class" />
-              </ProgId>
-            </Class>
+            <AppId Description="MgaUtil" Id="{461F30AF-3BF0-11D4-B3F0-005004D38590}">
+              <Class Id="{83BA3244-B758-11D3-ABAE-000000000000}" Context="InprocServer32" Description="MgaMetaProject Class" ThreadingModel="apartment" Programmable="yes">
+                <ProgId Id="Mga.MgaMetaProject.1" Description="MgaMetaProject Class">
+                  <ProgId Id="Mga.MgaMetaProject" Description="MgaMetaProject Class" />
+                </ProgId>
+              </Class>
+            </AppId>
             <Class Id="{83BA3246-B758-11D3-ABAE-000000000000}" Context="InprocServer32" Description="MgaMetaFolder Class" ThreadingModel="apartment" Programmable="yes">
               <ProgId Id="Mga.MgaMetaFolder.1" Description="MgaMetaFolder Class">
                 <ProgId Id="Mga.MgaMetaFolder" Description="MgaMetaFolder Class" />
@@ -463,11 +465,13 @@
                 <ProgId Id="Mga.MgaO" Description="MgaO Class" />
               </ProgId>
             </Class>
-            <Class Id="{270B4F93-B17C-11D3-9AD1-00AA00B6FE26}" Context="InprocServer32" Description="MgaProject Class" ThreadingModel="apartment" Programmable="yes">
-              <ProgId Id="Mga.MgaProject.1" Description="MgaProject Class">
-                <ProgId Id="Mga.MgaProject" Description="MgaProject Class" />
-              </ProgId>
-            </Class>
+            <AppId Description="MgaUtil" Id="{461F30AF-3BF0-11D4-B3F0-005004D38590}">
+              <Class Id="{270B4F93-B17C-11D3-9AD1-00AA00B6FE26}" Context="InprocServer32" Description="MgaProject Class" ThreadingModel="apartment" Programmable="yes">
+                <ProgId Id="Mga.MgaProject.1" Description="MgaProject Class">
+                  <ProgId Id="Mga.MgaProject" Description="MgaProject Class" />
+                </ProgId>
+              </Class>
+            </AppId>
             <Class Id="{C592F6F0-C1FD-11D3-9AD2-00AA00B6FE26}" Context="InprocServer32" Description="MgaFolders Class" ThreadingModel="apartment" Programmable="yes">
               <ProgId Id="Mga.MgaFolders.1" Description="MgaFolders Class">
                 <ProgId Id="Mga.MgaFolders" Description="MgaFolders Class" />
@@ -682,11 +686,13 @@
                 <ProgId Id="Mga.MgaMetaParser" Description="MetaParser Class" />
               </ProgId>
             </Class>
-            <Class Id="{94D6FB54-1F7C-11D4-B3D0-005004D38590}" Context="InprocServer32" Description="MgaParser Class" ThreadingModel="apartment" Programmable="yes">
-              <ProgId Id="Mga.MgaParser.1" Description="MgaParser Class">
-                <ProgId Id="Mga.MgaParser" Description="MgaParser Class" />
-              </ProgId>
-            </Class>
+            <AppId Description="MgaUtil" Id="{461F30AF-3BF0-11D4-B3F0-005004D38590}">
+              <Class Id="{94D6FB54-1F7C-11D4-B3D0-005004D38590}" Context="InprocServer32" Description="MgaParser Class" ThreadingModel="apartment" Programmable="yes">
+                <ProgId Id="Mga.MgaParser.1" Description="MgaParser Class">
+                  <ProgId Id="Mga.MgaParser" Description="MgaParser Class" />
+                </ProgId>
+              </Class>
+            </AppId>
             <Class Id="{A5D0DAE7-16EE-11D4-B3C2-005004D38590}" Context="InprocServer32" Description="MgaDumper Class" ThreadingModel="apartment" Programmable="yes">
               <ProgId Id="Mga.MgaDumper.1" Description="MgaDumper Class">
                 <ProgId Id="Mga.MgaDumper" Description="MgaDumper Class" />


More information about the gme-commit mailing list