mirror of
https://github.com/ciromattia/kcc
synced 2025-12-12 17:26:23 +00:00
Replaced cx_Freeze with py2exe
This commit is contained in:
@@ -53,7 +53,7 @@ sudo pip3 install pillow python-slugify psutil
|
||||
```
|
||||
|
||||
### For freezing code:
|
||||
- Windows - [cx_Freeze](https://bitbucket.org/anthony_tuininga/cx_freeze) HEAD version with [this](https://bitbucket.org/anthony_tuininga/cx_freeze/pull-request/29/conversions-to-support-untranslated-wide) patchset.
|
||||
- Windows - [py2exe](https://pypi.python.org/pypi/py2exe) 0.9.2+
|
||||
- OS X - [py2app](https://bitbucket.org/ronaldoussoren/py2app) 0.8+
|
||||
|
||||
## USAGE
|
||||
|
||||
18
kcc.iss
18
kcc.iss
@@ -42,18 +42,16 @@ Name: "CB7association"; Description: "CB7"; GroupDescription: "File associations
|
||||
|
||||
[Files]
|
||||
; x64 files
|
||||
Source: "build\exe.win-amd64-3.3\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "build\exe.win-amd64-3.3\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "build\exe.win-amd64-3.3\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "build\exe.win-amd64-3.3\*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "build\exe.win-amd64-3.3\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "dist_64\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "dist_64\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "dist_64\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "dist_64\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||
Source: "other\vcredist_x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode
|
||||
; x86 files
|
||||
Source: "build\exe.win32-3.3\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "build\exe.win32-3.3\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "build\exe.win32-3.3\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "build\exe.win32-3.3\*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "build\exe.win32-3.3\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "dist\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "dist\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "dist\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||
Source: "other\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode
|
||||
; Common files
|
||||
Source: "LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion solidbreak
|
||||
|
||||
Binary file not shown.
Binary file not shown.
74
setup.py
74
setup.py
@@ -6,7 +6,7 @@ Usage (Mac OS X):
|
||||
python setup.py py2app
|
||||
|
||||
Usage (Windows):
|
||||
python setup.py build
|
||||
python setup.py py2exe
|
||||
"""
|
||||
from sys import platform, version_info
|
||||
if version_info[0] != 3:
|
||||
@@ -55,31 +55,61 @@ if platform == "darwin":
|
||||
)
|
||||
)
|
||||
elif platform == "win32":
|
||||
# noinspection PyUnresolvedReferences
|
||||
import py2exe
|
||||
import platform as arch
|
||||
from cx_Freeze import setup, Executable
|
||||
from distutils.core import setup
|
||||
if arch.architecture()[0] == '64bit':
|
||||
library = 'libEGL64.dll'
|
||||
suffix = '_64'
|
||||
else:
|
||||
library = 'libEGL32.dll'
|
||||
base = "Win32GUI"
|
||||
suffix = ''
|
||||
additional_files = [('imageformats', ['C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qgif.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qico.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qjpeg.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qmng.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qsvg.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qtga.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qtiff.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\imageformats\qwbmp.dll']),
|
||||
('platforms', ['C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\platforms\qminimal.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\platforms\qoffscreen.dll',
|
||||
'C:\Python33' + suffix +
|
||||
'\Lib\site-packages\PyQt5\plugins\platforms\qwindows.dll']),
|
||||
('', ['LICENSE.txt',
|
||||
'other\\7za.exe',
|
||||
'other\\UnRAR.exe',
|
||||
'other\\Additional-LICENSE.txt',
|
||||
'other\\7za.exe',
|
||||
'C:\Python33' + suffix + '\Lib\site-packages\PyQt5\libEGL.dll'])]
|
||||
extra_options = dict(
|
||||
options={"build_exe": {"optimize": 2,
|
||||
"include_files": ['LICENSE.txt',
|
||||
['other/UnRAR.exe', 'UnRAR.exe'],
|
||||
['other/7za.exe', '7za.exe'],
|
||||
['other/Additional-LICENSE.txt', 'Additional-LICENSE.txt'],
|
||||
['other/' + library, 'libEGL.dll']
|
||||
],
|
||||
"copy_dependent_files": True,
|
||||
"create_shared_zip": False,
|
||||
"append_script_to_exe": True,
|
||||
"replace_paths": '*=',
|
||||
"excludes": ['tkinter']}},
|
||||
executables=[Executable(MAIN,
|
||||
base=base,
|
||||
targetName="KCC.exe",
|
||||
icon="icons/comic2ebook.ico",
|
||||
compress=False)])
|
||||
options={'py2exe': {"bundle_files": 2,
|
||||
"dll_excludes": ["tcl85.dll", "tk85.dll"],
|
||||
"dist_dir": "dist" + suffix,
|
||||
"compressed": True,
|
||||
"includes": ["sip"],
|
||||
"excludes": ["tkinter"],
|
||||
"optimize": 2}},
|
||||
windows=[{"script": "kcc.py",
|
||||
"dest_base": "KCC",
|
||||
"version": VERSION,
|
||||
"copyright": "Ciro Mattia Gonano, Pawel Jastrzebski © 2014",
|
||||
"legal_copyright": "ISC License (ISCL)",
|
||||
"product_version": VERSION,
|
||||
"product_name": "Kindle Comic Converter",
|
||||
"file_description": "Kindle Comic Converter",
|
||||
"icon_resources": [(1, "icons\comic2ebook.ico")]}],
|
||||
zipfile=None,
|
||||
data_files=additional_files)
|
||||
else:
|
||||
print('Please use setup.sh to build Linux package.')
|
||||
exit()
|
||||
|
||||
Reference in New Issue
Block a user