diff --git a/bucket/everything.json b/bucket/everything.json index eead2f005deea9..5f592bc68790c7 100644 --- a/bucket/everything.json +++ b/bucket/everything.json @@ -1,11 +1,26 @@ { "version": "1.4.1.1032", - "description": "Locate files and folders by name instantly.", + "description": "A file and folder search engine for Windows that instantly locates files and folders by name.", "homepage": "https://www.voidtools.com", - "license": "MIT", + "license": { + "identifier": "MIT", + "url": "https://www.voidtools.com/License.txt" + }, "notes": [ - "To add Everything to right-click context menu, run:", - "reg import \"$dir\\install-context.reg\"" + "To register file associations, please execute the following command:", + "reg import \"$dir\\install-associations.reg\"", + "To register application startup, please execute the following command:", + "reg import \"$dir\\register-startup-entry.reg\"", + "To register the context menu entry, please execute the following command:", + "reg import \"$dir\\install-context.reg\"", + "To register the URL protocol handler, please execute the following command:", + "reg import \"$dir\\register-url-handler.reg\"", + "", + "Please note that the related logic has been changed.", + "The context menu must be unregistered and then registered again, even if it was previously registered.", + "The following command can be used to unregister it:", + "reg import \"$dir\\uninstall-context.reg\"", + "No further action is required if this message appears again." ], "architecture": { "64bit": { @@ -22,24 +37,23 @@ } }, "pre_install": [ - "# for arm64", - "if ($architecture -eq 'arm64') { Rename-Item \"$dir\\EverythingARM64.exe\" -NewName 'Everything.exe' }", - "# END", - "ensure \"$persist_dir\" | Out-Null", - "if (!(Test-Path \"$persist_dir\\Everything.ini\")) { Start-Process -Wait \"$dir\\Everything.exe\" -Args @('-install-config null') }", - "Get-ChildItem \"$persist_dir\\*\" -Include 'Bookmarks.csv', 'Everything.db', 'Everything.ini', 'Filters.csv', 'Search History.csv' | Copy-Item -Destination \"$dir\" -ErrorAction SilentlyContinue" + "if ($architecture -eq 'arm64') { Rename-Item -Path \"$dir\\EverythingARM64.exe\" -NewName 'Everything.exe' }", + "if (-not (Test-Path -Path \"$persist_dir\\*.ini\" -PathType Leaf)) {", + " Start-Process -FilePath \"$dir\\Everything.exe\" -ArgumentList @('-install-config', 'null') -NoNewWindow -Wait", + "}", + "# Hard links are not applicable here because the application creates a new file instead of modifying the existing one in place.", + "'*.db', '*.csv', '*.ico', '*.ini', '*.txt' | ForEach-Object {", + " if (Test-Path -Path \"$persist_dir\\$_\" -PathType Leaf) {", + " Copy-Item -Path \"$persist_dir\\$_\" -Destination $dir -Force", + " }", + "}" ], "post_install": [ - "$app_path = \"$dir\\Everything.exe\".Replace('\\', '\\\\')", - "'install-context.reg', 'uninstall-context.reg' | ForEach-Object {", - " if (Test-Path \"$bucketsdir\\extras\\scripts\\everything\\$_\") {", - " $content = Get-Content \"$bucketsdir\\extras\\scripts\\everything\\$_\"", - " $content = $content.Replace('$app_path', $app_path)", - " if ($global) {", - " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", - " }", - " }", - " $content | Set-Content -Path \"$dir\\$_\" -Encoding ascii", + "$everything_dir = $dir -replace '\\\\', '\\\\'", + "Get-ChildItem -Path \"$bucketsdir\\$bucket\\scripts\\$app\" -Filter '*.reg' -File | ForEach-Object {", + " $content = Get-Content -Path $_.FullName -Encoding utf8", + " if ($global) { $content = $content -replace 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE' }", + " $content -replace '{{everything_dir}}', $everything_dir | Set-Content -Path \"$dir\\$($_.Name)\" -Encoding unicode", "}" ], "bin": "Everything.exe", @@ -49,23 +63,61 @@ "Everything" ] ], + "persist": [ + "Logs", + "HTTP server" + ], "pre_uninstall": [ - "Stop-Process -Name 'Everything' -Force -ErrorAction SilentlyContinue", - "$service_installed_in_current_dir_via_scoop = (sc.exe qc Everything) -match $dir.Replace('\\', '\\\\')", - "if ($service_installed_in_current_dir_via_scoop) {", - " if ($(Get-Service -Name Everything -ErrorAction SilentlyContinue).Status -ne 'Stopped') {", - " if (!(is_admin) -and $(Get-Service -Name Everything -ErrorAction SilentlyContinue)) { error 'Admin rights are required to stop Everything service'; break }", - " Stop-Service -Name 'Everything' -Force -ErrorAction SilentlyContinue | Out-Null", + "# Hard links are not applicable here because the application creates a new file instead of modifying the existing one in place.", + "'*.db', '*.csv', '*.ico', '*.ini', '*.txt' | ForEach-Object {", + " if (Test-Path -Path \"$dir\\$_\" -PathType Leaf) {", + " Copy-Item -Path \"$dir\\$_\" -Destination $persist_dir -Force", " }", - " if ((Get-Service -Name Everything -ErrorAction SilentlyContinue) -and ($cmd -eq 'uninstall')) {", - " if (!(is_admin) -and $(Get-Service -Name Everything -ErrorAction SilentlyContinue)) { error 'Admin rights are required to remove Everything service'; break }", - " sc.exe delete 'Everything'", - " }", - "}", - "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-context.reg\" }", - "Get-ChildItem \"$dir\\*\" -Include 'Bookmarks.csv', 'Everything.db', 'Everything.ini', 'Filters.csv', 'Search History.csv' | Copy-Item -Destination \"$persist_dir\" -ErrorAction SilentlyContinue -Force" + "}" ], - "checkver": "Download Everything ([\\d.]+)", + "uninstaller": { + "script": [ + "if ($cmd -eq 'uninstall') {", + " Get-ChildItem -Path $dir -Filter 'un*.reg' -File | ForEach-Object j{", + " $registry_file = '\"{0}\"' -f $_.FullName", + " Start-Process -FilePath 'reg.exe' -ArgumentList @('import', $registry_file) -WindowStyle Hidden -Wait", + " }", + "}", + "$base_service_name = 'Everything'", + "$path_regex = [regex]::Escape((Split-Path -Path $dir -Parent))", + "$process = Get-Process -Name 'Everything' -ErrorAction SilentlyContinue | Where-Object { $_.Path -match $path_regex }", + "if ($process.Count -gt 0) {", + " Write-Host \"`nINFO Identified $($process.Count) running processes for termination.\" -ForegroundColor DarkGray", + " Stop-Process -Id $process.Id -Force -ErrorAction SilentlyContinue", + "}", + "if ($PSVersionTable.PSVersion -ge [version]::new(6, 0)) {", + " $services = Get-Service -Name \"*$base_service_name*\" -ErrorAction SilentlyContinue", + "} else {", + " $name_filter = \"Name like '%$base_service_name%'\"", + " $services = Get-CimInstance -ClassName Win32_Service -Filter $name_filter -ErrorAction SilentlyContinue |", + " Select-Object -Property *, @{ Name = 'BinaryPathName'; Expression = { $_.PathName } }", + "}", + "$service = $services | Where-Object { $_.BinaryPathName -match $path_regex }", + "if ($null -ne $service) {", + " if (-not (is_admin)) { abort \"`n[ERROR] $app requires admin rights to $cmd.\" }", + " Stop-Service -Name $service.Name -Force -ErrorAction SilentlyContinue", + " $process.Id | Where-Object -FilterScript { $null -ne $_ } | ForEach-Object {", + " Get-Process -Id $_ -ErrorAction SilentlyContinue | Where-Object -FilterScript { $_.Name -like '*Everything*' }", + " } | Stop-Process -Force -ErrorAction SilentlyContinue", + " Start-Sleep -Milliseconds 1500", + " if ($cmd -ne 'uninstall') { return }", + " if ($PSVersionTable.PSVersion -ge [version]::new(6, 0)) {", + " Remove-Service -Name 'Everything' -ErrorAction SilentlyContinue", + " } else {", + " Start-Process -FilePath 'sc.exe' -ArgumentList @('delete', 'Everything') -NoNewWindow -Wait", + " }", + "}" + ] + }, + "checkver": { + "url": "https://www.voidtools.com/Changes.txt", + "regex": "Version\\s*([\\d.]+)(?=\\s)" + }, "autoupdate": { "architecture": { "64bit": { diff --git a/scripts/everything/install-associations.reg b/scripts/everything/install-associations.reg new file mode 100644 index 00000000000000..62c05be9a426f0 --- /dev/null +++ b/scripts/everything/install-associations.reg @@ -0,0 +1,32 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Classes\.efu] +"Content Type"="text/plain" +"PerceivedType"="text" + +[HKEY_CURRENT_USER\Software\Classes\.efu\OpenWithProgIDs] +"Everything.FileList"=hex(0): + + +[HKEY_CURRENT_USER\Software\Classes\Everything.FileList] +@="Everything File List" +"AppUserModelID"="voidtools.Everything" +"FriendlyTypeName"="Everything File List" + +[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\DefaultIcon] +@="\"{{everything_dir}}\\Everything.exe\",1" + +[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell] +@="open" + +[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\edit] +"Icon"="\"{{everything_dir}}\\Everything.exe\",0" + +[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\edit\command] +@="\"{{everything_dir}}\\Everything.exe\" -edit \"%1\"" + +[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\open] +"Icon"="\"{{everything_dir}}\\Everything.exe\",0" + +[HKEY_CURRENT_USER\Software\Classes\Everything.FileList\shell\open\command] +@="\"{{everything_dir}}\\Everything.exe\" \"%1\"" diff --git a/scripts/everything/install-context.reg b/scripts/everything/install-context.reg index a3c82fdb1df16e..39a880dd3795b2 100644 --- a/scripts/everything/install-context.reg +++ b/scripts/everything/install-context.reg @@ -1,23 +1,16 @@ Windows Registry Editor Version 5.00 -[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything] +[HKEY_CURRENT_USER\Software\Classes\Directory\background\shell\Search Everything...] @="Search with &Everything" -"Icon"="$app_path" +"Icon"="\"{{everything_dir}}\\Everything.exe\",0" -[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything\command] -@="$app_path -path \"%1\"" +[HKEY_CURRENT_USER\Software\Classes\Directory\background\shell\Search Everything...\command] +@="\"{{everything_dir}}\\Everything.exe\" -path \"%V\"" -[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything] -@="Search with &Everything" -"Icon"="$app_path" - -; %v – For verbs that are none implies all. If there is no parameter passed this is the working directory. -[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything\command] -@="$app_path -path \"%V\"" -[HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything] +[HKEY_CURRENT_USER\Software\Classes\Folder\shell\Search Everything...] @="Search with &Everything" -"Icon"="$app_path" +"Icon"="\"{{everything_dir}}\\Everything.exe\",0" -[HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything\command] -@="$app_path -path \"%1\"" +[HKEY_CURRENT_USER\Software\Classes\Folder\shell\Search Everything...\command] +@="\"{{everything_dir}}\\Everything.exe\" -path \"%1\"" diff --git a/scripts/everything/register-startup-entry.reg b/scripts/everything/register-startup-entry.reg new file mode 100644 index 00000000000000..f59724a4c5e3c0 --- /dev/null +++ b/scripts/everything/register-startup-entry.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] +"Everything"="\"{{everything_dir}}\\Everything.exe\" -startup" diff --git a/scripts/everything/register-url-handler.reg b/scripts/everything/register-url-handler.reg new file mode 100644 index 00000000000000..b8d3547934d471 --- /dev/null +++ b/scripts/everything/register-url-handler.reg @@ -0,0 +1,15 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Classes\ES] +@="URL:Everything Search Protocol" +"URL Protocol"="" + +[HKEY_CURRENT_USER\Software\Classes\ES\DefaultIcon] +@="\"{{everything_dir}}\\Everything.exe\",0" + +[HKEY_CURRENT_USER\Software\Classes\ES\shell] + +[HKEY_CURRENT_USER\Software\Classes\ES\shell\open] + +[HKEY_CURRENT_USER\Software\Classes\ES\shell\open\command] +@="\"{{everything_dir}}\\Everything.exe\" -url \"%1\"" diff --git a/scripts/everything/uninstall-associations.reg b/scripts/everything/uninstall-associations.reg new file mode 100644 index 00000000000000..60bbd3c222b103 --- /dev/null +++ b/scripts/everything/uninstall-associations.reg @@ -0,0 +1,6 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Classes\.efu\OpenWithProgIDs] +"Everything.FileList"=- + +[-HKEY_CURRENT_USER\Software\Classes\Everything.FileList] diff --git a/scripts/everything/uninstall-context.reg b/scripts/everything/uninstall-context.reg index fa80fbdb199d34..40b55fe228cedb 100644 --- a/scripts/everything/uninstall-context.reg +++ b/scripts/everything/uninstall-context.reg @@ -1,8 +1,14 @@ Windows Registry Editor Version 5.00 +[-HKEY_CURRENT_USER\Software\Classes\Directory\background\shell\Search Everything...] + +[-HKEY_CURRENT_USER\Software\Classes\Folder\shell\Search Everything...] + +; The entries below are retained to remove context menu items created by earlier versions +; These legacy cleanup rules will be removed after several future updates + [-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything] -[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Everything\command] + [-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything] -[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Everything\command] + [-HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything] -[-HKEY_CURRENT_USER\Software\Classes\Drive\shell\Everything\command] diff --git a/scripts/everything/unregister-startup-entry.reg b/scripts/everything/unregister-startup-entry.reg new file mode 100644 index 00000000000000..84e5f5cfd48c26 --- /dev/null +++ b/scripts/everything/unregister-startup-entry.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] +"Everything"=- diff --git a/scripts/everything/unregister-url-handler.reg b/scripts/everything/unregister-url-handler.reg new file mode 100644 index 00000000000000..463e6c52966470 --- /dev/null +++ b/scripts/everything/unregister-url-handler.reg @@ -0,0 +1,3 @@ +Windows Registry Editor Version 5.00 + +[-HKEY_CURRENT_USER\Software\Classes\ES]