Fixed nsis build script

Contributes to CURA-9365
This commit is contained in:
j.spijker@ultimaker.com 2022-07-15 12:03:51 +02:00 committed by Jelle Spijker
parent c731ac7dfe
commit f1a6c54414
2 changed files with 5 additions and 4 deletions

View file

@ -14,8 +14,8 @@ from jinja2 import Template
def generate_nsi(source_path: str, dist_path: str, filename: str):
dist_loc = Path(dist_path)
source_loc = Path(source_path)
dist_loc = Path(os.getcwd(), dist_path)
source_loc = Path(os.getcwd(), source_path)
instdir = Path("$INSTDIR")
dist_paths = [p.relative_to(dist_loc.joinpath("Ultimaker-Cura")) for p in sorted(dist_loc.joinpath("Ultimaker-Cura").rglob("*")) if p.is_file()]
mapped_out_paths = {}
@ -35,7 +35,7 @@ def generate_nsi(source_path: str, dist_path: str, filename: str):
rmdir_paths = sorted(list(rmdir_paths), reverse = True)[:-2]
jinja_template_path = Path(sys.argv[2])
jinja_template_path = Path(source_loc.joinpath("packaging", "NSIS", "Ultimaker-Cura.nsi.jinja"))
with open(jinja_template_path, "r") as f:
template = Template(f.read())
@ -65,7 +65,7 @@ def generate_nsi(source_path: str, dist_path: str, filename: str):
def build(dist_path: str):
dist_loc = Path(dist_path)
dist_loc = Path(os.getcwd(), dist_path)
command = ["makensis", "/V2", "/P4", str(dist_loc.joinpath("Ultimaker-Cura.nsi"))]
subprocess.run(command)

View file

@ -2,3 +2,4 @@ pytest
pyinstaller
pyinstaller-hooks-contrib
sip==6.5.1
jinja2