Fix .msi file and remove macos .app file, because is did not work
This commit is contained in:
parent
3c4a0e446f
commit
f278a29c32
33
.github/workflows/release.yml
vendored
33
.github/workflows/release.yml
vendored
|
@ -102,9 +102,6 @@ jobs:
|
||||||
- name: cx_freeze
|
- name: cx_freeze
|
||||||
run: pip3 install --upgrade cx_freeze wheel
|
run: pip3 install --upgrade cx_freeze wheel
|
||||||
|
|
||||||
- name: prepare Files
|
|
||||||
run: mv rare/__main__.py rare/Rare.py
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: python freeze.py bdist_msi
|
run: python freeze.py bdist_msi
|
||||||
|
|
||||||
|
@ -119,33 +116,3 @@ jobs:
|
||||||
asset_name: Rare.msi
|
asset_name: Rare.msi
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
mac_os:
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
|
|
||||||
- name: Rare Dependencies
|
|
||||||
run: pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: install pyinstaller
|
|
||||||
run: pip install pyinstaller
|
|
||||||
|
|
||||||
- name: copy files
|
|
||||||
run: mv rare/__main__.py __main__.py
|
|
||||||
|
|
||||||
- name: run pyinstaller
|
|
||||||
run: pyinstaller -F --name Rare --add-data "rare/languages/*:rare/languages" --add-data "rare/resources/colors/*:rare/resources/colors" --add-data "rare/resources/images/*:rare/resources/images/" --add-data "rare/resources/stylesheets/RareStyle/*:rare/resources/stylesheets/RareStyle/" --windowed --icon rare/resources/images/Rare.icns __main__.py
|
|
||||||
|
|
||||||
- name: upload to GitHub
|
|
||||||
uses: svenstaro/upload-release-action@2.2.1
|
|
||||||
with:
|
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
file: dist/Rare.app
|
|
||||||
asset_name: Rare_MacOS.app
|
|
||||||
tag: ${{ github.ref }}
|
|
||||||
overwrite: true
|
|
103
freeze.py
103
freeze.py
|
@ -1,82 +1,35 @@
|
||||||
import sys
|
|
||||||
|
|
||||||
from cx_Freeze import setup, Executable
|
from cx_Freeze import setup, Executable
|
||||||
|
|
||||||
from rare import __version__
|
from rare import __version__
|
||||||
|
|
||||||
# Packages to include
|
shortcut_table = [
|
||||||
python_packages = [
|
("DesktopShortcut", # Shortcut
|
||||||
"PyQt5",
|
"DesktopFolder", # Directory_
|
||||||
'requests',
|
"Rare", # Name
|
||||||
'PIL',
|
"TARGETDIR", # Component_
|
||||||
'qtawesome',
|
"[TARGETDIR]Rare.exe", # Target
|
||||||
'psutil',
|
None, # Arguments
|
||||||
'pypresence',
|
None, # Description
|
||||||
'win32com'
|
None, # Hotkey
|
||||||
|
None, # Icon
|
||||||
|
None, # IconIndex
|
||||||
|
None, # ShowCmd
|
||||||
|
'TARGETDIR' # WkDir
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
# Modules to include
|
msi_data = {"Shortcut": shortcut_table}
|
||||||
python_modules = []
|
bdist_msi_options = {'data': msi_data}
|
||||||
|
base = "Win32GUI"
|
||||||
|
|
||||||
base = None
|
setup(
|
||||||
name = None
|
name="Rare",
|
||||||
build_options = {}
|
version=__version__,
|
||||||
build_exe_options = {}
|
description="A GUI for Legendary",
|
||||||
shortcutName = None
|
options={
|
||||||
shortcutDir = None
|
"bdist_msi": bdist_msi_options,
|
||||||
bdist_msi_options = None
|
},
|
||||||
src_files = []
|
executables=[Executable("rare/__main__.py",
|
||||||
external_so_files = []
|
base=base, icon="rare/resources/images/Rare.ico",
|
||||||
|
target_name="Rare")]
|
||||||
if sys.platform == 'win32':
|
)
|
||||||
base = 'Win32GUI'
|
|
||||||
name = 'Rare.exe'
|
|
||||||
shortcut_table = [
|
|
||||||
('DesktopShortcut', # Shortcut
|
|
||||||
'DesktopFolder', # Directory
|
|
||||||
'Rare', # Name
|
|
||||||
'TARGETDIR', # Component
|
|
||||||
'[TARGETDIR]' + name, # Target
|
|
||||||
None, # Arguments
|
|
||||||
'A gui for Legendary.', # Description
|
|
||||||
None, # Hotkey
|
|
||||||
None, # Icon
|
|
||||||
None, # IconIndex
|
|
||||||
None, # ShowCmd
|
|
||||||
'TARGETDIR' # Working Directory
|
|
||||||
)]
|
|
||||||
msi_data = {"Shortcut": shortcut_table}
|
|
||||||
bdist_msi_options = {'data': msi_data, "all_users": False}
|
|
||||||
build_options["bdist_msi"] = bdist_msi_options
|
|
||||||
else:
|
|
||||||
name = 'Rare'
|
|
||||||
|
|
||||||
src_files += [
|
|
||||||
'LICENSE',
|
|
||||||
'README.md',
|
|
||||||
'rare/resources/images/Rare.ico',
|
|
||||||
]
|
|
||||||
|
|
||||||
# Dependencies are automatically detected, but it might need fine tuning.
|
|
||||||
build_exe_options["packages"] = python_packages
|
|
||||||
build_exe_options["include_files"] = src_files + external_so_files
|
|
||||||
build_exe_options["includes"] = python_modules
|
|
||||||
build_exe_options["excludes"] = ["setuptools", "tkinter", "pkg_resources"]
|
|
||||||
|
|
||||||
# Set options
|
|
||||||
build_options["build_exe"] = build_exe_options
|
|
||||||
|
|
||||||
setup(name='Rare',
|
|
||||||
version=__version__,
|
|
||||||
description='A gui for Legendary.',
|
|
||||||
options=build_options,
|
|
||||||
executables=[
|
|
||||||
Executable('rare/Rare.py',
|
|
||||||
target_name=name,
|
|
||||||
icon='rare/resources/images/Rare.ico',
|
|
||||||
base=base,
|
|
||||||
shortcut_name=shortcutName,
|
|
||||||
shortcut_dir=shortcutDir,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ from rare.utils import singleton, utils
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
parser.add_argument("-V", "--version", action="store_true", help="Shows version and exits")
|
parser.add_argument("-V", "--version", action="store_true", help="Shows version and exits")
|
||||||
parser.add_argument("-S", "--silent", action="store_true",
|
parser.add_argument("-S", "--silent", action="store_true",
|
||||||
|
@ -53,12 +54,14 @@ def main():
|
||||||
args.silent = True
|
args.silent = True
|
||||||
|
|
||||||
# fix error in cx_freeze
|
# fix error in cx_freeze
|
||||||
import multiprocessing
|
|
||||||
multiprocessing.freeze_support()
|
|
||||||
|
|
||||||
from rare.app import start
|
from rare.app import start
|
||||||
start(args)
|
start(args)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
import multiprocessing
|
||||||
|
|
||||||
|
multiprocessing.freeze_support()
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -347,8 +347,12 @@ def create_desktop_link(app_name, core: LegendaryCore, type_of_link="desktop") -
|
||||||
# Add shortcut
|
# Add shortcut
|
||||||
shell = Dispatch('WScript.Shell')
|
shell = Dispatch('WScript.Shell')
|
||||||
shortcut = shell.CreateShortCut(pathLink)
|
shortcut = shell.CreateShortCut(pathLink)
|
||||||
shortcut.Targetpath = sys.executable
|
if sys.executable.endswith("Rare.exe"):
|
||||||
shortcut.Arguments = f'{target} launch {app_name}'
|
executable = sys.executable
|
||||||
|
else:
|
||||||
|
executable = f"{sys.executable} {os.path.abspath(sys.argv[0])}"
|
||||||
|
shortcut.Targetpath = executable
|
||||||
|
shortcut.Arguments = f'launch {app_name}'
|
||||||
shortcut.WorkingDirectory = os.getcwd()
|
shortcut.WorkingDirectory = os.getcwd()
|
||||||
|
|
||||||
# Icon
|
# Icon
|
||||||
|
|
Loading…
Reference in a new issue