-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_installer.py
37 lines (29 loc) · 1.04 KB
/
create_installer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import shutil
import subprocess
import argparse
import os
description = """Package everything in an installer."""
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=description)
args = parser.parse_args()
# get directory the script is in
script_dir = os.path.dirname(os.path.realpath(__file__))
os.chdir(script_dir)
# run pyinstaller, will create folder dist/pomodoro
subprocess.run(
[
"pyinstaller",
"--noconfirm",
"--name=matrix_playground",
"--icon=icon.ico",
"main.py"
],
check=True,
)
# copy resources to dist/matrix_playground
shutil.copy("commandinterpretter.py", "dist/matrix_playground")
shutil.copy("icon.ico", "dist/matrix_playground")
shutil.copy("quickreference.txt", "dist/matrix_playground")
shutil.copy("examples.txt", "dist/matrix_playground")
# create installer
subprocess.run('makensis build_installer.nsi', shell=True, check=True)