Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = [
'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
password = PASSWORDS.get(name, '')
Expand All @@ -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('$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)

Expand Down