mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 03:37:48 -06:00
Fixed nsis build script
Contributes to CURA-9365
This commit is contained in:
parent
c731ac7dfe
commit
f1a6c54414
2 changed files with 5 additions and 4 deletions
|
@ -14,8 +14,8 @@ from jinja2 import Template
|
||||||
|
|
||||||
|
|
||||||
def generate_nsi(source_path: str, dist_path: str, filename: str):
|
def generate_nsi(source_path: str, dist_path: str, filename: str):
|
||||||
dist_loc = Path(dist_path)
|
dist_loc = Path(os.getcwd(), dist_path)
|
||||||
source_loc = Path(source_path)
|
source_loc = Path(os.getcwd(), source_path)
|
||||||
instdir = Path("$INSTDIR")
|
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()]
|
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 = {}
|
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]
|
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:
|
with open(jinja_template_path, "r") as f:
|
||||||
template = Template(f.read())
|
template = Template(f.read())
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ def generate_nsi(source_path: str, dist_path: str, filename: str):
|
||||||
|
|
||||||
|
|
||||||
def build(dist_path: 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"))]
|
command = ["makensis", "/V2", "/P4", str(dist_loc.joinpath("Ultimaker-Cura.nsi"))]
|
||||||
subprocess.run(command)
|
subprocess.run(command)
|
||||||
|
|
||||||
|
|
|
@ -2,3 +2,4 @@ pytest
|
||||||
pyinstaller
|
pyinstaller
|
||||||
pyinstaller-hooks-contrib
|
pyinstaller-hooks-contrib
|
||||||
sip==6.5.1
|
sip==6.5.1
|
||||||
|
jinja2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue