diff --git a/README.md b/README.md index 32c0f46..9704a87 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # 🎬 SceneRename +SceneRename logo + ![Python Version](https://img.shields.io/badge/python-3.11%2B-blue.svg) ![Docker Ready](https://img.shields.io/badge/Docker-Ready-2496ED.svg?logo=docker&logoColor=white) ![License](https://img.shields.io/badge/license-AGPL--3.0-blue.svg) diff --git a/assets/scenerename.ico b/assets/scenerename.ico new file mode 100644 index 0000000..d8ca11c Binary files /dev/null and b/assets/scenerename.ico differ diff --git a/assets/scenerename.png b/assets/scenerename.png new file mode 100644 index 0000000..db0709c Binary files /dev/null and b/assets/scenerename.png differ diff --git a/scripts/install-explorer-menu.ps1 b/scripts/install-explorer-menu.ps1 index 721d6fe..b0b465c 100644 --- a/scripts/install-explorer-menu.ps1 +++ b/scripts/install-explorer-menu.ps1 @@ -38,6 +38,10 @@ function New-MenuCommand([string]$Token) { $menuText = 'SceneRename 重命名' +$repoRoot = Split-Path -Parent $PSScriptRoot +$iconPath = Join-Path $repoRoot 'assets\scenerename.ico' +if (-not (Test-Path -LiteralPath $iconPath)) { $iconPath = $pwsh } + $targets = @( @{ Key = 'HKCU:\Software\Classes\Directory\shell\SceneRename'; Token = '%1' }, @{ Key = 'HKCU:\Software\Classes\Directory\Background\shell\SceneRename'; Token = '%V' }, @@ -51,7 +55,7 @@ foreach ($item in $targets) { New-Item -Path $item.Key -Force | Out-Null New-Item -Path $commandKey -Force | Out-Null New-ItemProperty -Path $item.Key -Name '(default)' -Value $menuText -PropertyType String -Force | Out-Null - New-ItemProperty -Path $item.Key -Name 'Icon' -Value $pwsh -PropertyType String -Force | Out-Null + New-ItemProperty -Path $item.Key -Name 'Icon' -Value $iconPath -PropertyType String -Force | Out-Null New-ItemProperty -Path $commandKey -Name '(default)' -Value (New-MenuCommand $item.Token) -PropertyType String -Force | Out-Null }