Dear Bo,

> Please send the detailed instructions on how to do this to the list.
Ok. Here comes, the detailed how to use it guide.

First we need some general build.bat (or build.cmd) file for running the 
packaging:
$ python setup.py py2exe

After running the command script, the package generated in the "dist" directory,
located in the curent directory where you start the build.bat.

As you can see there is a setup.py is needed. Here is my version:

-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT
# setup.py
from distutils.core import setup
import py2exe

#here we can describe som general parameters as far I understood
class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        # for the versioninfo resources
        self.version = "1.4.0"
        self.company_name = "The LyX Team"
        self.copyright = "GNU GPL Version 2 or later"
        self.name = "LyX 1.4.0cvs"

manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="5.0.0.0"
    processorArchitecture="x86"
    name="%(prog)s"
    type="win32"
/>
<description>%(prog)s Program</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>
'''

RT_MANIFEST = 24

#here you have to give each target names to compile
lyx2lyx = Target(
    # used for the versioninfo resource
    description = "LyX2LyX fileformat converter 1.4.0cvs",

    # what to build
    script = "lyx2lyx.py",
    other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="lyx2lyx"))],
    icon_resources = [(1, "lyx2lyx_32x32.ico")],
    dest_base = "lyx2lyx")

general_command_wrapper = Target(
    # used for the versioninfo resource
    description = "General Command Wrapper",

    # what to build
    script = "general_command_wrapper.py",
#    other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="lyx2lyx"))],
#    icon_resources = [(1, "lyx2lyx_32x32.ico")],
    dest_base = "general_command_wrapper")


pic2ascii = Target(
    # used for the versioninfo resource
    description = "Pic to Ascii Converter",

    # what to build
    script = "pic2ascii.py",
#    other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="lyx2lyx"))],
#    icon_resources = [(1, "lyx2lyx_32x32.ico")],
    dest_base = "pic2ascii")

# if there are some script that is  called by the others you should also include
# them manually
includes = ["lyx_0_12","lyx_1_0_0","lyx_1_0_1","lyx_1_1_4","lyx_1_1_5",
            
"lyx_1_1_6","lyx_1_1_6fix3","lyx_1_2","lyx_1_3","profiling","lyx_1_4"]

# here is the main thing, here you will define general build parameters
setup(
    options = {"py2exe": {"compressed": 1,
                          "optimize": 2,
                          "includes": includes,
                          "ascii": 1,
                          "bundle_files": 2}},
#    zipfile = None, # uncomment and you will create several big exes with
# python interpreter in each .exe .

# here comes the list of executables to build, you have to define them earlier
    console = [lyx2lyx, general_command_wrapper, pic2ascii],
    )
-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT-CUT

In order to run the build.bat you should copy all the necessary script to the
current directory.

That's all.

I have used python 2.3.5 and py2exe 0.6.3 what is last version.

> After we get rid of perl and mingw and have python scripts compiled
> like this, we will be much closer to an everything-included lyx
> distribution ( convert.exe and aspell.exe should be easy to handle,
> and packing miktex is not all that necessary. ), although many people
> do not like this idea.

If you were trying to install it somewhere else, you will know that very hard to
get it working on a fresh machine. You should install at least 4-5 program, one
after the other. If I try to introduce it to my friend they are asking how easy
to install. :( Currently it is very hard. unless you use it on a Linux box.

Therefore, I prefer an almost all-in-one package. At least, you should consider
during install how to install what program.


-- 
Best regards,
 Alex                            mailto:[EMAIL PROTECTED]



Reply via email to