1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'lxd'
from distutils.core import setup
import py2exe
import sys
# If run without args, build executables, in quiet mode.
if len(sys.argv) == 1:
sys.argv.append("py2exe")
sys.argv.append("-q")
INCLUDES = []
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</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false">
</requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<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
options = {"py2exe" :
{"compressed" : 1,
"optimize" : 2,
"bundle_files" : 2,
"includes" : INCLUDES,
"excludes" : ["Tkinter",],
"dll_excludes": [ "MSVCP90.dll", "mswsock.dll", "powrprof.dll"] }}
windows = [{"script": "bin.py",
"icon_resources": [(1, "bin.ico")],
"other_resources" : [(RT_MANIFEST, 1,
MANIFEST_TEMPLATE % dict(prog="MyAppName"))],
}]
setup(name = "MyApp",
version = "1.0",
description = "Description of the app",
author = "Author Name",
author_email ="author@project.com",
maintainer = "Maintainer Name",
maintainer_email = "you@project.com",
license = "wxWindows Licence",
url = "http://projecthomepage.com",
data_files = ["MSVCR90.dll", "gdiplus.dll"],
#data_files=[("img",[r"d:\test\1.gif",r"d:\test\2.gif"]),("xml",[r"d:\test\1.xml",r"d:\test\2.xml"])])
#zipfile=None,
options = options,
windows = windows,
)
|