--- a/trunk/py2exe/setup.py
+++ b/trunk/py2exe/setup.py
@@ -29,7 +29,7 @@
 
 from py2exe import __version__
 
-# $Id: setup.py 723 2013-05-24 19:59:36Z theller $
+# $Id: setup.py 726 2013-06-05 18:42:13Z theller $
 
 import sys, os, string
 from distutils.core import setup, Extension, Command
@@ -376,16 +376,18 @@
 
 _memimporter = Extension("_memimporter",
                          ["source/MemoryModule.c",
-                          "source/_memimporter_module.c",
+                          "source/MyLoadLibrary.c",
+                          "source/_memimporter.c",
                           "source/actctx.c"],
-                         depends=depends + ["source/_memimporter.c"],
-                         define_macros=macros,
+                         depends=depends,
+                         define_macros=macros + [("STANDALONE", "1")],
                          )
 
 run = Interpreter("py2exe.run",
                   ["source/run.c", "source/start.c", "source/icon.rc",
                    "source/Python-dynload.c",
                    "source/MemoryModule.c",
+                   "source/MyLoadLibrary.c",
                    "source/_memimporter.c",
                    "source/actctx.c",
                    ],
@@ -397,6 +399,7 @@
                     ["source/run_w.c", "source/start.c", "source/icon.rc",
                      "source/Python-dynload.c",
                      "source/MemoryModule.c",
+                     "source/MyLoadLibrary.c",
                      "source/_memimporter.c",
                      "source/actctx.c",
                      ],
@@ -409,6 +412,7 @@
                       ["source/run_dll.c", "source/start.c", "source/icon.rc",
                        "source/Python-dynload.c",
                        "source/MemoryModule.c",
+                       "source/MyLoadLibrary.c",
                        "source/_memimporter.c",
                        "source/actctx.c",
                        ],
@@ -427,6 +431,7 @@
                              ["source/run_ctypes_dll.c", "source/start.c", "source/icon.rc",
                               "source/Python-dynload.c",
                               "source/MemoryModule.c",
+                              "source/MyLoadLibrary.c",
                               "source/_memimporter.c",
                               "source/actctx.c",
                               ],
@@ -445,6 +450,7 @@
                       ["source/run_isapi.c", "source/start.c",
                        "source/Python-dynload.c",
                        "source/MemoryModule.c",
+                       "source/MyLoadLibrary.c",
                        "source/_memimporter.c",
                        "source/actctx.c",
                        "source/icon.rc"],