Skip to content

Commit 130c7f2

Browse files
authored
modern7z: Fix uninstaller logic
1 parent 974334b commit 130c7f2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bucket/modern7z.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434
"uninstaller": {
3535
"script": [
3636
"$7z_path = friendly_path -Path $(Get-CommandPath -Command '7z.exe')",
37-
"$codecs_dir = Join-Path -Path $(Split-Path -Path $7z_path -Parent) -ChildPath 'Codecs'",
38-
"Get-ChildItem -Path $dir -Exclude '*.json', 'ReadMe.txt' | ForEach-Object {",
39-
" Remove-Item -Path \"$codecs_dir\\$($_.Name)\" -Recurse -Force -ErrorAction SilentlyContinue",
37+
"if ($null -ne $7z_path) {",
38+
" $codecs_dir = Join-Path -Path $(Split-Path -Path $7z_path -Parent) -ChildPath 'Codecs'",
39+
" Get-ChildItem -Path $dir -Exclude '*.json', 'ReadMe.txt' | ForEach-Object -Process {",
40+
" Remove-Item -Path \"$codecs_dir\\$($_.Name)\" -Recurse -Force -ErrorAction SilentlyContinue",
41+
" }",
4042
"}"
4143
]
4244
},

0 commit comments

Comments
 (0)