Oops, gmail won't let me attach this file.
The text of the three files needed (build.bat, setup.py and app.py) are included below.

When using bundle 1 or 2, I get an error when trying to run the .exe:

Traceback (most recent call last):
  File "app.py", line 13, in ?
  File "zipextimporter.pyc", line 78, in load_module
  File "win32com\client\__init__.pyc", line 12, in ?
  File "zipextimporter.pyc", line 78, in load_module
  File "win32com\client\dynamic.pyc", line 24, in ?
  File "zipextimporter.pyc", line 78, in load_module
  File "win32com\client\build.pyc", line 26, in ?
ImportError: No module named pywintypes

PyWinTypes23.dll is included in the zip, but not pywintypes.pyc.
If I don't use bundle, pywintypes.pyc is automatically included in the zip and the .exe runs fine.

Attached is a small project that duplicates the problem.
Included is a batch file 'build.txt' which builds and trys to run the .exe file.
You can edit build.bat to change the bundle option.

H.R.Gartenbauer


--------------------------------------------
file build.bat:
--------------------------------------------
 
echo Removing previous build...
del /s /f /q dist >nul
del /s /f /q build >nul
echo Building distribution...
c:\python23\python.exe setup.py py2exe --packages encodings --bundle 1
if errorlevel 1 goto error
echo distribution DONE, running app.exe
cd dist
.\app.exe
goto end
:error
echo ERROR
:end

--------------------------------------------
file setup.py:
--------------------------------------------
 
import time
import sys

# ModuleFinder can't handle runtime changes to __path__, but win32com uses them

try:
  import modulefinder
  import win32com
  for p in win32com.__path__[1:]:
    modulefinder.AddPackagePath("win32com", p)
  for extra in ["win32com.shell"]: #,"win32com.mapi"
    __import__(extra)
    m = sys.modules[extra]
    for p in m.__path__[1:]:
      modulefinder.AddPackagePath(extra, p)
except ImportError:
  pass # no build path setup, no worries.

from distutils.core import setup
import py2exe

excludes = [ "libgdk", "Tkconstants","Tkinter","tcl" ]
includes = ["encodings", "encodings.*", ]


class Target:
  def __init__(self, **kw):
    self.__dict__.update(kw)
# for the versioninfo resources
    self.version = "0.5.0"
    self.company_name = "co"
    self.copyright = "Copyright 2005"
    self.name = "app"

app = Target(
    script = "app.py",
    dest_base = "app",
    )

setup(
        windows=[app],
    zipfile=None,
        name = "app",
        description = "app",
        version = "0.1",
        options = {"py2exe": {
      "compressed": 1,
      "dll_excludes": ["libgdk-win32-2.0-0.dll", "libgobject-2.0-0.dll", "wxc.pyd", "wxmsw24uh.dll", "tcl84.dll","tk84.dll"],
      "packages": ["encodings", "encodings.*"],
      }},
#    data_files=[('', [ ])]
        )

--------------------------------------------
file app.py:
--------------------------------------------

# force py2exe to include these:
from win32com import *
from pythoncom import *
from win32com.client import *
from win32com.client.util import *
from win32com.server import *
from win32com.server.util import *
from win32com.server.policy import *
#from pywintypes import *
import pywintypes
from winshell import *

if __name__ == '__main__':
  sidEveryone = pywintypes.SID()

--------------------------------------------