From 090cebb01fef036a3471dea2e8372b8eed16b367 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Tue, 8 Jul 2025 21:30:53 -0700 Subject: [PATCH 1/2] fix: create persist files in pre_install fixes #45 --- update.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/update.py b/update.py index 90c5c21f..9cb4f3d9 100644 --- a/update.py +++ b/update.py @@ -328,7 +328,11 @@ def do_padfile(pad_name: str, pad_data: str, urls: Urls) -> Urls: manifest.pop("architecture") manifest["url"] = download manifest["hash"] = hash32 - + + manifest["pre_install"] = [ + r'if (-not (Test-Path \"$persist_dir\\'+ name + r'.cfg\")) { New-Item \"$dir\\' +name + r'.cfg\" -ItemType file | Out-Null }', + r'if (-not (Test-Path \"$persist_dir\\' + name + r'_lng.ini\")) { New-Item \"$dir\\' + name + r'_lng.ini\" -ItemType file | Out-Null }', + ] # See https://github.com/ScoopInstaller/Nirsoft/issues/17 # See https://github.com/ScoopInstaller/Nirsoft/issues/46 password = PASSWORDS.get(name, '') @@ -341,10 +345,8 @@ def do_padfile(pad_name: str, pad_data: str, urls: Urls) -> Urls: manifest["architecture"]["32bit"]["url"] += "#dl.zip_" else: manifest["url"] += "#dl.zip_" - manifest["pre_install"] = [ - r"$zip=(Get-ChildItem $dir\\" + name + "*).Name", - r"7z x $dir\\$zip -p'" + password + "' $('-o' + $dir) | Out-Null" - ] + manifest["pre_install"].append(r"$zip=(Get-ChildItem $dir\\" + name + "*).Name") + manifest["pre_install"].append(r"7z x $dir\\$zip -p'" + password + "' $('-o' + $dir) | Out-Null") rewrite_json(json_file, manifest) From 8d5e52f5fb999bd77de5e14c8f80a97e5feb1813 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Tue, 8 Jul 2025 21:51:21 -0700 Subject: [PATCH 2/2] fix: simplify pre_install commands --- update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update.py b/update.py index 9cb4f3d9..645f30db 100644 --- a/update.py +++ b/update.py @@ -330,8 +330,8 @@ def do_padfile(pad_name: str, pad_data: str, urls: Urls) -> Urls: manifest["hash"] = hash32 manifest["pre_install"] = [ - r'if (-not (Test-Path \"$persist_dir\\'+ name + r'.cfg\")) { New-Item \"$dir\\' +name + r'.cfg\" -ItemType file | Out-Null }', - r'if (-not (Test-Path \"$persist_dir\\' + name + r'_lng.ini\")) { New-Item \"$dir\\' + name + r'_lng.ini\" -ItemType file | Out-Null }', + 'if (-not (Test-Path \"$persist_dir/'+ name + '.cfg\")) { New-Item \"$dir/' +name + '.cfg\" -ItemType file | Out-Null }', + 'if (-not (Test-Path \"$persist_dir/' + name + '_lng.ini\")) { New-Item \"$dir/' + name + '_lng.ini\" -ItemType file | Out-Null }', ] # See https://github.com/ScoopInstaller/Nirsoft/issues/17 # See https://github.com/ScoopInstaller/Nirsoft/issues/46 @@ -345,8 +345,8 @@ def do_padfile(pad_name: str, pad_data: str, urls: Urls) -> Urls: manifest["architecture"]["32bit"]["url"] += "#dl.zip_" else: manifest["url"] += "#dl.zip_" - manifest["pre_install"].append(r"$zip=(Get-ChildItem $dir\\" + name + "*).Name") - manifest["pre_install"].append(r"7z x $dir\\$zip -p'" + password + "' $('-o' + $dir) | Out-Null") + manifest["pre_install"].append('$zip=(Get-ChildItem $dir/' + name + '*).Name') + manifest["pre_install"].append('7z x $dir/$zip -p' + password + " $('-o' + $dir) | Out-Null") rewrite_json(json_file, manifest)