Hi,

The names I gave you were the names used internally. My apologies! You
need to use the following names instead

create_shared_zip (not createLibraryZip)
append_script_to_exe (not appendScriptToExe)
include_in_shared_zip (not appendScriptToLibrary)

The last two you can use with the Executable() object as you already
discovered. The first one, however, is a global option and must be set
globally. Set it in the same place you are setting includes, excludes,
packages and path in your sample. Unless you want something different
for each executable I would suggest setting the other ones globally as
well.

Hope that helps.

Anthony

On Mon, Nov 23, 2009 at 5:11 AM, Cor Bos <c...@ceboservice.nl> wrote:
> Hi,
> On windows I tried the following setup:
> c:\python25\python -OO cx_setup.py build --build-ext=r"Test"
> ###########
> from cx_Freeze import setup, Executable
>
> includes = []
> excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email',
> 'pywin.debugger',
>             'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
>             'Tkconstants', 'Tkinter']
> packages = []
> path = []
>
> Exe_Target_1 = Executable(
>     script = "Boekhouden.py",
>     initScript = None,
>     base = 'Win32GUI',
>     targetDir = r"Test",
>     targetName = "Boekhouden.exe",
>     compress = True,
>     copyDependentFiles = True,
> --> createLibraryZip = False,  <---- Added this line
>     appendScriptToExe = True,
>     appendScriptToLibrary = False,
>     icon = r"C:\Documents and Settings\All Users\Documents\Gedeelde
> bestanden\Boekhouden3.0\bp.ico"
>     )
>
> setup(
>     version = "3.3.0",
>     description = "Boekhouden voor MKB en particulier",
>     author = "Cebo",
>     name = "Boekhouden",
>     options = {"build_exe": {"includes": includes,
>                              "excludes": excludes,
>                              "packages": packages,
>                              "path": path
>                              }
>                },
>     executables = [Exe_Target_1]
>     )
> ##########
> As a result I got the following error message:
> Traceback (most recent call last):
>   File "cx_setup.py", line 27, in <module>
>     icon = r"C:\Documents and Settings\All Users\Documents\Gedeelde
> bestanden\Boekhouden3.0\bp.ico"
> TypeError: __init__() got an unexpected keyword argument 'createLibraryZip'
>
> I managed to get around this error by editing dist.py and freeze.py
> somewhat so its no real probleme but I guess my editing isn't supposed
> to be.
>
> Cor
>
> Anthony Tuininga schreef:
>> Hi,
>>
>> Apologies for the delay in answering this. I'm just unburying myself
>> from the mound of e-mail that piled up during a rather busy time.
>>
>> These are the different options:
>>
>> createLibraryZip = True
>> appendScriptToLibrary = True
>> appendScriptToExe = True or False
>> -- creates library.zip, all modules are placed in library.zip
>>
>> createLibraryZip = True
>> appendScriptToLibrary = False
>> appendScriptToExe = True
>> -- creates library.zip, script module appended to executable, all
>> other modules in library.zip
>>
>> createLibraryZip = True
>> appendScriptToLibrary = False
>> appendScriptToExe = False
>> -- creates library.zip, script module placed in <script>.zip, all
>> other modules in library.zip
>>
>> createLibraryZip = False
>> appendScriptToLibrary = True
>> appendScriptToExe = True or False
>> -- exception raised as cannot append to library.zip which is not being 
>> created
>>
>> createLibraryZip = False
>> appendScriptToLibrary = False
>> appendScriptToExe = True
>> -- does not create library.zip, all modules appended to executable
>>
>> createLibraryZip = False
>> appendScriptToLibrary = False
>> appendScriptToExe = False
>> -- does not create library.zip all modules placed in <script>.zip
>>
>> I hope that answers your questions. If it still does not, let me know
>> and I should be able to answer your question in considerably less time
>> than two months!
>>
>> Anthony
>>
>> On Fri, Sep 18, 2009 at 11:38 AM, Cor Bos <c...@ceboservice.nl> wrote:
>>> Hi,
>>> Thanks for your answer.
>>> I did some testing on Ubuntu and used the following setup file:
>>>
>>> from cx_Freeze import setup, Executable
>>>
>>> includes = []
>>> excludes = ['bsddb', 'curses', 'email', '_gtkagg', 'pywin.debugger',
>>>             'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
>>>             '_tkagg', 'Tkconstants', 'Tkinter']
>>> packages = []
>>> path = []
>>>
>>> Exe_Target_1 = Executable(
>>>     script = "Boekhouden.py",
>>>     initScript = None,
>>>     base = None,
>>>     targetDir = r"boekhouden_3.2.1_cx_build14",
>>>     targetName = "Boekhouden",
>>>     compress = True,
>>>     copyDependentFiles = True,
>>>     appendScriptToExe = True,
>>>     appendScriptToLibrary = False,
>>>     icon = r"/home/cor/Boekhouden3.0/bp.ico"
>>>     )
>>>
>>> setup(
>>>     version = "3.2.1",
>>>     description = "Boekhoudprogramma",
>>>     author = "Cebo",
>>>     name = "Boekhouden",
>>>     options = {"build_exe": {"includes": includes,
>>>                              "excludes": excludes,
>>>                              "packages": packages,
>>>                              "path": path
>>>                              }
>>>                },
>>>
>>>     executables = [Exe_Target_1]
>>>     )
>>> Startcmd:
>>> python -OO setup.py build --build-exe=r"boekhouden_3.2.1_cx_build14"
>>>
>>> I modified appendScriptToExe and appendScriptToLibrary and
>>> got the results shown below:
>>>
>>> appendScriptToExe = True
>>> appendScriptToLibrary = False
>>> Boekhouden  executable + library.zip
>>>
>>> appendScriptToExe = False
>>> appendScriptToLibrary = True
>>> Boekhouden executable + library.zip
>>>
>>> appendScriptToExe = True
>>> appendScriptToLibrary = True
>>> Boekhouden executable + library.zip
>>>
>>> appendScriptToExe = False
>>> appendScriptToLibrary = False
>>> Boekhouden executable + boekhouden.zip + library.zip
>>>
>>> The boekhouden.zip is only 2.7kB and contains cx_freeze_init.pyc and
>>> _main_.py
>>>
>>> Did I forget something in the setup file because the zipfile didn't get
>>> attached to the executable and in all cases the library.zip was created.
>>> The only difference was the size of the executable: 671,6kB or 674,4kB
>>> that's +/-2.7kB and 2 file missing from the library.zip
>>>
>>> Cor
>>>
>>>
>>>
>>> Anthony Tuininga schreef:
>>>> Hi, cx_Freezes uses up to three possible sources for the modules,
>>>> checking this order:
>>>>
>>>> 1) the executable itself (tacked on the end of it)
>>>> 2) a file with the same name as the executable with a .zip extension
>>>> in the same directory as the executable
>>>> 3) a file named "library.zip" in the same directory as the executable
>>>>
>>>> The relevant code for this is in Common.c (GetImporter function)
>>>>
>>>> The way to determine which will be used is via the
>>>> --append-script-to-exe option
>>>> --create-shared-zip option
>>>> --include-in-shared-zip option
>>>>
>>>> See the documentation for a little more information on this. If you're
>>>> still having trouble, let me know. Thanks.
>>>>
>>>> Anthony
>>>>
>>>> On Sun, Sep 13, 2009 at 9:36 AM, Cor Bos <c...@ceboservice.nl> wrote:
>>>>> Hi,
>>>>>
>>>>> Is there a way to rename the library.zip to a name derived from the
>>>>> executable like MyApp.exe and MyApp.zip.
>>>>> Py2Exe offers a renaming option but I couldn't find anything alike for
>>>>> CxFreeze.
>>>>>
>>>>> I want to use two separate executables in the same folder. But as both
>>>>> executables use the name "library.zip" and that won't work.
>>>>>
>>>>> I've tried to concatenate the library.zip to the executable but that
>>>>> didn't work and renaming the library.zip gives an zipimport error on
>>>>> Linux. On windows it seems to work with a modified Console.py.
>>>>>
>>>>> Any help would be welcome.
>>>>>
>>>>> Cor
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 
>>>>> 30-Day
>>>>> trial. Simplify your report design, integration and deployment - and 
>>>>> focus on
>>>>> what you do best, core application coding. Discover what's new with
>>>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>>>> _______________________________________________
>>>>> cx-freeze-users mailing list
>>>>> cx-freeze-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>>>>>
>>>> ------------------------------------------------------------------------------
>>>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>>>> trial. Simplify your report design, integration and deployment - and focus 
>>>> on
>>>> what you do best, core application coding. Discover what's new with
>>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>>> _______________________________________________
>>>> cx-freeze-users mailing list
>>>> cx-freeze-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>>>>
>>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
>>> http://p.sf.net/sfu/devconf
>>> _______________________________________________
>>> cx-freeze-users mailing list
>>> cx-freeze-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>>>
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>> trial. Simplify your report design, integration and deployment - and focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> cx-freeze-users mailing list
>> cx-freeze-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>>
>>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> cx-freeze-users mailing list
> cx-freeze-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to