|
7 | 7 | "url": "https://www.voidtools.com/License.txt" |
8 | 8 | }, |
9 | 9 | "notes": [ |
10 | | - "To add Everything to right-click context menu, run:", |
11 | | - "reg import \"$dir\\install-context.reg\"" |
| 10 | + "To register file associations, please execute the following command:", |
| 11 | + "- `reg import \"$dir\\install-associations.reg\"`", |
| 12 | + "To register application startup, please execute the following command:", |
| 13 | + "- `reg import \"$dir\\register-startup-entry.reg\"`", |
| 14 | + "To register the context menu entry, please execute the following command:", |
| 15 | + "- `reg import \"$dir\\install-context.reg\"`", |
| 16 | + "To register the URL protocol handler, please execute the following command:", |
| 17 | + "- `reg import \"$dir\\register-url-handler.reg\"`" |
12 | 18 | ], |
13 | 19 | "architecture": { |
14 | 20 | "64bit": { |
|
30 | 36 | " Start-Process -FilePath \"$dir\\Everything.exe\" -ArgumentList @('-install-config', 'null') -NoNewWindow -Wait", |
31 | 37 | "}", |
32 | 38 | "# Hard links are not applicable here because the application creates a new file instead of modifying the existing one in place.", |
33 | | - "'*.db', '*.csv', '*.ico', '*.ini', 'txt' | ForEach-Object {", |
| 39 | + "'*.db', '*.csv', '*.ico', '*.ini', '*.txt' | ForEach-Object {", |
34 | 40 | " if (Test-Path -Path \"$persist_dir\\$_\" -PathType Leaf) {", |
35 | 41 | " Copy-Item -Path \"$persist_dir\\$_\" -Destination $dir -Force", |
36 | 42 | " }", |
37 | 43 | "}" |
38 | 44 | ], |
39 | 45 | "post_install": [ |
40 | | - "$app_path = \"$dir\\Everything.exe\".Replace('\\', '\\\\')", |
41 | | - "Get-ChildItem -Path \"$bucketsdir\\$bucket\\scripts\\$app\" -Filter '*.reg' -File | ForEach-Object {", |
| 46 | + "$everything_dir = $dir -replace '\\\\', '\\\\'", |
| 47 | + "Get-ChildItem -Path \"$bucketsdir\\$bucket\\scripts\\$app\" -Filter '*.reg' -File | ForEach-Object -Process {", |
42 | 48 | " $content = Get-Content -Path $_.FullName -Encoding utf8", |
43 | 49 | " if ($global) { $content = $content -replace 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE' }", |
44 | | - " $content.Replace('$app_path', $app_path) | Set-Content -Path \"$dir\\$($_.Name)\" -Encoding unicode", |
| 50 | + " $content -replace '{{everything_dir}}', $everything_dir | Set-Content -Path \"$dir\\$($_.Name)\" -Encoding unicode", |
45 | 51 | "}" |
46 | 52 | ], |
47 | 53 | "bin": "Everything.exe", |
|
57 | 63 | ], |
58 | 64 | "pre_uninstall": [ |
59 | 65 | "# Hard links are not applicable here because the application creates a new file instead of modifying the existing one in place.", |
60 | | - "'*.db', '*.csv', '*.ico', '*.ini', 'txt' | ForEach-Object {", |
| 66 | + "'*.db', '*.csv', '*.ico', '*.ini', '*.txt' | ForEach-Object {", |
61 | 67 | " if (Test-Path -Path \"$dir\\$_\" -PathType Leaf) {", |
62 | 68 | " Copy-Item -Path \"$dir\\$_\" -Destination $persist_dir -Force", |
63 | 69 | " }", |
|
73 | 79 | "}", |
74 | 80 | "$base_service_name = 'Everything'", |
75 | 81 | "$path_regex = [regex]::Escape((Split-Path -Path $dir -Parent))", |
76 | | - "Stop-Process -Name 'Everything' -Force -ErrorAction SilentlyContinue", |
| 82 | + "$process = Get-Process -Name 'Everything' -ErrorAction SilentlyContinue | Where-Object { $_.Path -match $path_regex }", |
| 83 | + "if ($process.Count -gt 0) {", |
| 84 | + " Write-Host \"`nINFO Identified $($process.Count) running processes for termination.\" -ForegroundColor DarkGray", |
| 85 | + " Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue", |
| 86 | + "}", |
77 | 87 | "if ($PSVersionTable.PSVersion -ge [version]::new(6, 0)) {", |
78 | 88 | " $services = Get-Service -Name \"*$base_service_name*\" -ErrorAction SilentlyContinue", |
79 | 89 | "} else {", |
|
0 commit comments