|
3 | 3 | "description": "Regular expression search and replace tool for Windows.", |
4 | 4 | "homepage": "https://tools.stefankueng.com/grepWin.html", |
5 | 5 | "license": "GPL-3.0-only", |
6 | | - "notes": "Run '$dir\\install-context.reg' to add grepWin to right-click context menu.", |
| 6 | + "notes": [ |
| 7 | + "To add grepWin to right-click context menu, run:", |
| 8 | + "reg import \"$dir\\install-context.reg\"" |
| 9 | + ], |
7 | 10 | "architecture": { |
8 | 11 | "64bit": { |
9 | 12 | "url": "https://github.com/stefankueng/grepWin/releases/download/2.1.12/grepWin-x64-2.1.12_portable.zip", |
|
15 | 18 | } |
16 | 19 | }, |
17 | 20 | "pre_install": [ |
18 | | - "Get-ChildItem \"$dir\\grepWin*.exe\" | Rename-Item -NewName 'grepWin.exe'", |
| 21 | + "Get-ChildItem \"$dir\\grepWin*.exe\" | Rename-Item -NewName 'grepWin_portable.exe'", |
19 | 22 | "if (-not (Test-Path \"$persist_dir\\grepwin.ini\")) {", |
20 | 23 | " Set-Content \"$dir\\grepwin.ini\" (@('[global]', '[Software\\grepWin\\History]') -join \"`r`n\") -Encoding ASCII", |
21 | 24 | "}" |
22 | 25 | ], |
23 | 26 | "post_install": [ |
24 | | - "$app_path = \"$dir\\grepWin.exe\".Replace('\\', '\\\\')", |
| 27 | + "# keep the 'portable' suffix to ensure it runs in portable mode.", |
| 28 | + "$app_path = \"$dir\\grepWin_portable.exe\".Replace('\\', '\\\\')", |
25 | 29 | "'install-context.reg', 'uninstall-context.reg' | ForEach-Object {", |
26 | 30 | " if (Test-Path \"$bucketsdir\\extras\\scripts\\grepwin\\$_\") {", |
27 | 31 | " $content = Get-Content \"$bucketsdir\\extras\\scripts\\grepwin\\$_\"", |
|
31 | 35 | " }", |
32 | 36 | " }", |
33 | 37 | " $content | Set-Content -Path \"$dir\\$_\" -Encoding ascii", |
| 38 | + "}", |
| 39 | + "# Workaround for https://github.com/ScoopInstaller/Extras/pull/17697 (Remove this workaround after 2027-01-01)", |
| 40 | + "if ($cmd -eq 'update') {", |
| 41 | + " $regPath = 'HKCU:\\Software\\Classes\\*\\shell\\grepWin\\command'", |
| 42 | + " if ($global) {", |
| 43 | + " $regPath = $regPath -replace '^HKCU', 'HKLM'", |
| 44 | + " }", |
| 45 | + " $regValue = Get-ItemProperty -LiteralPath $regPath -ErrorAction Ignore", |
| 46 | + " if ($regValue -and $regValue.'(default)' -match \"^$([regex]::Escape($(appdir $app $global)))\") {", |
| 47 | + " reg import \"$dir\\install-context.reg\" *> $null", |
| 48 | + " }", |
34 | 49 | "}" |
35 | 50 | ], |
36 | | - "bin": "grepWin.exe", |
| 51 | + "bin": [ |
| 52 | + [ |
| 53 | + "grepWin_portable.exe", |
| 54 | + "grepWin" |
| 55 | + ] |
| 56 | + ], |
37 | 57 | "shortcuts": [ |
38 | 58 | [ |
39 | | - "grepWin.exe", |
40 | | - "grepWin", |
41 | | - "/portable" |
| 59 | + "grepWin_portable.exe", |
| 60 | + "grepWin" |
42 | 61 | ] |
43 | 62 | ], |
44 | 63 | "persist": "grepwin.ini", |
45 | | - "pre_uninstall": "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-context.reg\" }", |
| 64 | + "pre_uninstall": "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-context.reg\" *> $null }", |
46 | 65 | "checkver": { |
47 | 66 | "github": "https://github.com/stefankueng/grepWin" |
48 | 67 | }, |
|
0 commit comments