Skip to content

Commit 0ea9221

Browse files
committed
everything: Update script logic, add .reg file
1 parent dd7f09a commit 0ea9221

9 files changed

Lines changed: 93 additions & 29 deletions

bucket/everything.json

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@
77
"url": "https://www.voidtools.com/License.txt"
88
},
99
"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\"`"
1218
],
1319
"architecture": {
1420
"64bit": {
@@ -30,18 +36,18 @@
3036
" Start-Process -FilePath \"$dir\\Everything.exe\" -ArgumentList @('-install-config', 'null') -NoNewWindow -Wait",
3137
"}",
3238
"# 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 {",
3440
" if (Test-Path -Path \"$persist_dir\\$_\" -PathType Leaf) {",
3541
" Copy-Item -Path \"$persist_dir\\$_\" -Destination $dir -Force",
3642
" }",
3743
"}"
3844
],
3945
"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 {",
4248
" $content = Get-Content -Path $_.FullName -Encoding utf8",
4349
" 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",
4551
"}"
4652
],
4753
"bin": "Everything.exe",
@@ -57,7 +63,7 @@
5763
],
5864
"pre_uninstall": [
5965
"# 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 {",
6167
" if (Test-Path -Path \"$dir\\$_\" -PathType Leaf) {",
6268
" Copy-Item -Path \"$dir\\$_\" -Destination $persist_dir -Force",
6369
" }",
@@ -73,7 +79,11 @@
7379
"}",
7480
"$base_service_name = 'Everything'",
7581
"$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+
"}",
7787
"if ($PSVersionTable.PSVersion -ge [version]::new(6, 0)) {",
7888
" $services = Get-Service -Name \"*$base_service_name*\" -ErrorAction SilentlyContinue",
7989
"} else {",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[HKEY_CURRENT_USER\Software\Classes\.efu]
4+
"Content Type"="text/plain"
5+
"PerceivedType"="text"
6+
7+
[HKEY_CURRENT_USER\Software\Classes\.efu\OpenWithProgIDs]
8+
"Everything.FileList"=hex(0):
9+
10+
11+
[HKEY_CURRENT_USER\Software\Classes\Everything.FileList]
12+
@="Everything File List"
13+
"AppUserModelID"="voidtools.Everything"
14+
"FriendlyTypeName"="Everything File List"
15+
16+
[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\DefaultIcon]
17+
@="\"{{everything_dir}}\\Everything.exe\",1"
18+
19+
[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell]
20+
@="open"
21+
22+
[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\edit]
23+
"Icon"="\"{{everything_dir}}\\Everything.exe\",0"
24+
25+
[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\edit\command]
26+
@="\"{{everything_dir}}\\Everything.exe\" -edit \"%1\""
27+
28+
[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\open]
29+
"Icon"="\"{{everything_dir}}\\Everything.exe\",0"
30+
31+
[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\open\command]
32+
@="\"{{everything_dir}}\\Everything.exe\" \"%1\""
Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
Windows Registry Editor Version 5.00
22

3-
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything]
3+
[HKEY_CURRENT_USER\Software\Classes\Directory\background\shell\Search Everything...]
44
@="Search with &Everything"
5-
"Icon"="$app_path"
5+
"Icon"="\"{{everything_dir}}\\Everything.exe\",0"
66

7-
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything\command]
8-
@="$app_path -path \"%1\""
7+
[HKEY_CURRENT_USER\Software\Classes\Directory\background\shell\Search Everything...\command]
8+
@="\"{{everything_dir}}\\Everything.exe\" -path \"%V\""
99

10-
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything]
11-
@="Search with &Everything"
12-
"Icon"="$app_path"
13-
14-
; %v – For verbs that are none implies all. If there is no parameter passed this is the working directory.
15-
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything\command]
16-
@="$app_path -path \"%V\""
1710

18-
[HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything]
11+
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\Search Everything...]
1912
@="Search with &Everything"
20-
"Icon"="$app_path"
13+
"Icon"="\"{{everything_dir}}\\Everything.exe\",0"
2114

22-
[HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything\command]
23-
@="$app_path -path \"%1\""
15+
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\Search Everything...\command]
16+
@="\"{{everything_dir}}\\Everything.exe\" -path \"%1\""
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
4+
"Everything"="\"{{everything_dir}}\\Everything.exe\" -startup"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[HKEY_CURRENT_USER\Software\Classes\ES]
4+
@="URL:Everything Search Protocol"
5+
"URL Protocol"=""
6+
7+
[HKEY_CURRENT_USER\Software\Classes\ES\DefaultIcon]
8+
@="\"{{everything_dir}}\\Everything.exe\",0"
9+
10+
[HKEY_CURRENT_USER\Software\Classes\ES\shell]
11+
12+
[HKEY_CURRENT_USER\Software\Classes\ES\shell\open]
13+
14+
[HKEY_CURRENT_USER\Software\Classes\ES\shell\open\command]
15+
@="\"{{everything_dir}}\\Everything.exe\" -url \"%1\""
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[HKEY_CURRENT_USER\Software\Classes\.efu\OpenWithProgIDs]
4+
"Everything.FileList"=-
5+
6+
[-HKEY_CURRENT_USER\Software\Classes\Everything.FileList]
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
Windows Registry Editor Version 5.00
22

3-
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything]
4-
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything\command]
5-
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything]
6-
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything\command]
7-
[-HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything]
8-
[-HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything\command]
3+
[-HKEY_CURRENT_USER\Software\Classes\Directory\background\shell\Search Everything...]
4+
5+
[-HKEY_CURRENT_USER\Software\Classes\Folder\shell\Search Everything...]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
4+
"Everything"=-
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Windows Registry Editor Version 5.00
2+
3+
[-HKEY_CURRENT_USER\Software\Classes\ES]

0 commit comments

Comments
 (0)