mirror of
https://github.com/ciromattia/kcc
synced 2025-12-13 17:56:30 +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:
|
### 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+
|
- OS X - [py2app](https://bitbucket.org/ronaldoussoren/py2app) 0.8+
|
||||||
|
|
||||||
## USAGE
|
## USAGE
|
||||||
|
|||||||
18
kcc.iss
18
kcc.iss
@@ -42,18 +42,16 @@ Name: "CB7association"; Description: "CB7"; GroupDescription: "File associations
|
|||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
; x64 files
|
; x64 files
|
||||||
Source: "build\exe.win-amd64-3.3\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
Source: "dist_64\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||||
Source: "build\exe.win-amd64-3.3\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
Source: "dist_64\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||||
Source: "build\exe.win-amd64-3.3\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
Source: "dist_64\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||||
Source: "build\exe.win-amd64-3.3\*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
Source: "dist_64\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
||||||
Source: "build\exe.win-amd64-3.3\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: Is64BitInstallMode
|
|
||||||
Source: "other\vcredist_x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode
|
Source: "other\vcredist_x64.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: Is64BitInstallMode
|
||||||
; x86 files
|
; x86 files
|
||||||
Source: "build\exe.win32-3.3\imageformats\*"; DestDir: "{app}\imageformats\"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
Source: "dist\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: "dist\platforms\*"; DestDir: "{app}\platforms\"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||||
Source: "build\exe.win32-3.3\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
Source: "dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||||
Source: "build\exe.win32-3.3\*.pyd"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
Source: "dist\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
||||||
Source: "build\exe.win32-3.3\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Check: not Is64BitInstallMode
|
|
||||||
Source: "other\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode
|
Source: "other\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion deleteafterinstall; Check: not Is64BitInstallMode
|
||||||
; Common files
|
; Common files
|
||||||
Source: "LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion solidbreak
|
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
|
python setup.py py2app
|
||||||
|
|
||||||
Usage (Windows):
|
Usage (Windows):
|
||||||
python setup.py build
|
python setup.py py2exe
|
||||||
"""
|
"""
|
||||||
from sys import platform, version_info
|
from sys import platform, version_info
|
||||||
if version_info[0] != 3:
|
if version_info[0] != 3:
|
||||||
@@ -55,31 +55,61 @@ if platform == "darwin":
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif platform == "win32":
|
elif platform == "win32":
|
||||||
|
# noinspection PyUnresolvedReferences
|
||||||
|
import py2exe
|
||||||
import platform as arch
|
import platform as arch
|
||||||
from cx_Freeze import setup, Executable
|
from distutils.core import setup
|
||||||
if arch.architecture()[0] == '64bit':
|
if arch.architecture()[0] == '64bit':
|
||||||
library = 'libEGL64.dll'
|
suffix = '_64'
|
||||||
else:
|
else:
|
||||||
library = 'libEGL32.dll'
|
suffix = ''
|
||||||
base = "Win32GUI"
|
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(
|
extra_options = dict(
|
||||||
options={"build_exe": {"optimize": 2,
|
options={'py2exe': {"bundle_files": 2,
|
||||||
"include_files": ['LICENSE.txt',
|
"dll_excludes": ["tcl85.dll", "tk85.dll"],
|
||||||
['other/UnRAR.exe', 'UnRAR.exe'],
|
"dist_dir": "dist" + suffix,
|
||||||
['other/7za.exe', '7za.exe'],
|
"compressed": True,
|
||||||
['other/Additional-LICENSE.txt', 'Additional-LICENSE.txt'],
|
"includes": ["sip"],
|
||||||
['other/' + library, 'libEGL.dll']
|
"excludes": ["tkinter"],
|
||||||
],
|
"optimize": 2}},
|
||||||
"copy_dependent_files": True,
|
windows=[{"script": "kcc.py",
|
||||||
"create_shared_zip": False,
|
"dest_base": "KCC",
|
||||||
"append_script_to_exe": True,
|
"version": VERSION,
|
||||||
"replace_paths": '*=',
|
"copyright": "Ciro Mattia Gonano, Pawel Jastrzebski © 2014",
|
||||||
"excludes": ['tkinter']}},
|
"legal_copyright": "ISC License (ISCL)",
|
||||||
executables=[Executable(MAIN,
|
"product_version": VERSION,
|
||||||
base=base,
|
"product_name": "Kindle Comic Converter",
|
||||||
targetName="KCC.exe",
|
"file_description": "Kindle Comic Converter",
|
||||||
icon="icons/comic2ebook.ico",
|
"icon_resources": [(1, "icons\comic2ebook.ico")]}],
|
||||||
compress=False)])
|
zipfile=None,
|
||||||
|
data_files=additional_files)
|
||||||
else:
|
else:
|
||||||
print('Please use setup.sh to build Linux package.')
|
print('Please use setup.sh to build Linux package.')
|
||||||
exit()
|
exit()
|
||||||
|
|||||||
Reference in New Issue
Block a user