Skip to content

Commit

Permalink
better build
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDumbTM committed Nov 6, 2023
1 parent 413c2d3 commit 5654cfc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"editor.rulers": [
{
"column": 80,
Expand Down
42 changes: 22 additions & 20 deletions src/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,32 @@ def build(root: os.PathLike, args: argparse.Namespace):
if args.release:
pathlib.Path(os.path.join(root, f"{args.name}")).unlink(True)

subprocess.run(["pyinstaller",
"-F",
"-w",
"--uac-admin",
os.path.join(root, "src", "main.py"),
f"--icon={args.icon}",
f"-n{args.name}"
])
proc = subprocess.run(["pyinstaller",
"-F",
"-w",
"--uac-admin",
os.path.join(root, "src", "main.py"),
f"--icon={args.icon}",
f"-n{args.name}"
])
print(proc.returncode)

# move the executable to the root directory
shutil.move(os.path.join(root, "dist", args.name), root)


parser = argparse.ArgumentParser()
parser.add_argument("-r", "--release", action='store_true')
parser.add_argument("-n", "--name", default=f"{int(time.time())}.exe")
parser.add_argument("-i",
"--icon",
default=os.path.join(DIR_PIC, "icon.ico"),
)
args = parser.parse_args()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--release", action='store_true')
parser.add_argument("-n", "--name", default=f"{int(time.time())}.exe")
parser.add_argument("-i",
"--icon",
default=os.path.join(DIR_PIC, "icon.ico"),
)
args = parser.parse_args()

if args.release:
args.name = "OneClick-Drivers-Installer.exe"
if args.release:
args.name = "OneClick-Drivers-Installer.exe"

build(DIR_ROOT, args)
clear_build_files(DIR_ROOT, args)
build(DIR_ROOT, args)
clear_build_files(DIR_ROOT, args)

0 comments on commit 5654cfc

Please sign in to comment.