Skip to content

Commit

Permalink
minimize build output
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Aug 7, 2024
1 parent 671a081 commit 024f730
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions src/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import os
from cx_Freeze import setup, Executable
from setuptools.command.install import install as _install
import winshell

src_dir = os.path.dirname(os.path.abspath(__file__))
build_dir = "build/HeadsetControl-Qt"
Expand All @@ -16,6 +14,7 @@
"include_files": include_files,
"zip_include_packages": zip_include_packages,
"excludes": ["tkinter"],
"silent": True,
}

executables = [
Expand All @@ -27,36 +26,9 @@
)
]


class InstallCommand(_install):
def run(self):
if not os.path.exists(install_dir):
os.makedirs(install_dir)
if not os.path.exists(build_dir):
print("##################################################")
print("# Nothing to install. #")
print("# Please build the project first. #")
print("##################################################")
return
self.copy_tree(build_dir, install_dir)
print("")
print(f"Executable installed to {install_dir}")

shortcut_path = os.path.join(winshell.programs(), "HeadsetControl-Qt.lnk")
target = os.path.join(install_dir, "HeadsetControl-Qt.exe")
icon = os.path.join(install_dir, "icons/icon.ico")

winshell.CreateShortcut(
Path=shortcut_path, Target=target, Icon=(icon, 0), Description="HeadsetControl-Qt", StartIn=install_dir
)

print("Created shortcut in start menu")


setup(
name="HeadsetControl-Qt",
version="1.0",
options={"build_exe": build_exe_options},
executables=executables,
cmdclass={"install": InstallCommand},
)

0 comments on commit 024f730

Please sign in to comment.