Add freeze.py to generate msi file for windows. (Bug fixed)
This commit is contained in:
parent
b799241357
commit
5f01d99062
6
.github/GenPKG.sh
vendored
6
.github/GenPKG.sh
vendored
|
@ -1,6 +0,0 @@
|
|||
export PYTHONPATH=$PWD
|
||||
version=$(python3 rare --version)
|
||||
cd .github
|
||||
git clone https://aur.archlinux.org/rare.git
|
||||
cd ..
|
||||
sed -i "s/.*pkgver=.*/pkgver=$version/" .github/rare/PKGBUILD
|
1
.github/rare
vendored
1
.github/rare
vendored
|
@ -1 +0,0 @@
|
|||
Subproject commit f689dacef1b8902da34aae7eff85a1bbe8e0a0a4
|
34
.github/workflows/release.yml
vendored
34
.github/workflows/release.yml
vendored
|
@ -87,5 +87,35 @@ jobs:
|
|||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
|
||||
|
||||
|
||||
cx_freeze:
|
||||
runs-on: "windows-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Dependencies
|
||||
run: pip3 install -r requirements.txt
|
||||
|
||||
- name: cx_freeze
|
||||
run: pip3 install --upgrade cx_freeze
|
||||
|
||||
- name: prepare Files
|
||||
run: mv rare/__main__.py rare/Rare.py
|
||||
|
||||
- name: Build
|
||||
run: python freeze.py bdist_msi
|
||||
|
||||
- name: Rename File
|
||||
run: mv dist/* dist/Rare.msi
|
||||
|
||||
- name: Upload to GitHub
|
||||
uses: svenstaro/upload-release-action@2.2.1
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: dist/Rare.msi
|
||||
asset_name: Rare.msi
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
36
freeze.py
Normal file
36
freeze.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from cx_Freeze import setup, Executable
|
||||
|
||||
# Dependencies are automatically detected, but it might need fine tuning.
|
||||
# "packages": ["os"] is used as example only
|
||||
|
||||
requirements = [
|
||||
"requests",
|
||||
"PIL",
|
||||
"setuptools",
|
||||
"wheel",
|
||||
"PyQt5",
|
||||
"qtawesome",
|
||||
"notifypy",
|
||||
"psutil",
|
||||
"pypresence",
|
||||
'win32com'
|
||||
]
|
||||
|
||||
bdist_msi_options = {
|
||||
'add_to_path': False,
|
||||
'initial_target_dir': r'[ProgramFilesFolder]\%s' % "Rare",
|
||||
}
|
||||
build_exe_options = {"includes": requirements, "excludes": ["tkinter", "setuptools"]}
|
||||
|
||||
base = "Win32GUI"
|
||||
|
||||
setup(
|
||||
name="Rare",
|
||||
version="1.5.0",
|
||||
description="A GUI for Legendary",
|
||||
options={"build_exe": build_exe_options},
|
||||
shortcutName="Rare",
|
||||
shortcutDir="DesktopFolder",
|
||||
executables=[Executable("rare/__main__.py",
|
||||
base=base, icon="rare/resources/images/Rare.ico")]
|
||||
)
|
|
@ -34,7 +34,7 @@ def main():
|
|||
|
||||
if args.version:
|
||||
print(__version__)
|
||||
exit(0)
|
||||
return
|
||||
try:
|
||||
# this object only allows one instance pre machine
|
||||
me = singleton.SingleInstance()
|
||||
|
@ -47,12 +47,15 @@ def main():
|
|||
else:
|
||||
file.write("start")
|
||||
file.close()
|
||||
|
||||
exit(0)
|
||||
return
|
||||
|
||||
if args.subparser == "launch":
|
||||
args.silent = True
|
||||
|
||||
# fix error in cx_freeze
|
||||
import multiprocessing
|
||||
multiprocessing.freeze_support()
|
||||
|
||||
from rare.app import start
|
||||
start(args)
|
||||
|
||||
|
|
Loading…
Reference in a new issue