I've never been able to get this to work, but I need to figure it out.  I need 
to include a data file, and the manual says:

You can force the include of any file in much the same way you do excludes:
collect = COLLECT(a.binaries +
          [('readme', '/my/project/readme', 'DATA')], ...)
I added the following to the .spec file:

exe = EXE(pyz,
          a.scripts,
          a.binaries + [('aom2_impulse.ico', 
'..\\aom2-remote\\aom2_impulse.ico', 'DATA')], 
          a.zipfiles,
          ...

To avoid confusion, the file is not being included here for pyinstaller to 
insert as an icon.  I need to access the data file at run time to replace the 
Tkinter title bar icon in Windows.

When build this I get:

Traceback (most recent call last):
  File "C:\Users\Lynn 
Oliver\Documents\Python\pyinstaller\PyInstaller\build.py", line 1052, in 
assemble
    [reslang or "*"])
  File "C:\Users\Lynn 
Oliver\Documents\Python\pyinstaller\PyInstaller\utils\winresource.py", line 
277, in UpdateResourcesFromResFile
    res = GetResources(srcpath, types, names, languages)
  File "C:\Users\Lynn 
Oliver\Documents\Python\pyinstaller\PyInstaller\utils\winresource.py", line 
188, in GetResources
    hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
error: (2, 'LoadLibraryEx', 'The system cannot find the file specified.')
INFO: Appending archive to EXE ..\aom2-remote\debug\dist\aomDSP.exe

Here is the complete spec file:

# -*- mode: python -*-
a = Analysis(['\\\\psf\\python\\axeomatic2\\aomDSP.py'],
             pathex=['C:\\Users\\Lynn Oliver\\Documents\\Python\\pyinstaller'],
             hiddenimports=[],
             hookspath=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          a.binaries + [('aom2_impulse.ico', 
'..\\aom2-remote\\aom2_impulse.ico', 'DATA')], 
          a.zipfiles,
          a.datas, 
          name=os.path.join('dist', 'aomDSP.exe'),
          debug=True,
          strip=None,
          upx=True,
          console=False , icon='..\\aom2-remote\\aom2_impulse.ico')
app = BUNDLE(exe,
             name=os.path.join('dist', 'aomDSP.exe.app'))

Any suggestions?

Lynn

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to