1
0
Fork 0
mirror of synced 2024-05-19 12:02:54 +12:00

Add freeze.py to generate msi file for windows. (Bug fixed)

This commit is contained in:
Dummerle 2021-08-30 20:34:53 +02:00
parent b799241357
commit 5f01d99062
5 changed files with 74 additions and 12 deletions

6
.github/GenPKG.sh vendored
View file

@ -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 +0,0 @@
Subproject commit f689dacef1b8902da34aae7eff85a1bbe8e0a0a4

View file

@ -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
View 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")]
)

View file

@ -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)