Files
SceneMarshal/scripts/uninstall-explorer-menu.ps1
T
ali a57a392d7a feat(subtitle): 文本字幕外置化仅限 TRANSCODE 源;右键菜单合并为级联子菜单
- 内嵌 ASS 抽取与字体抽取挂到 verdict == TRANSCODE(extract-subs /
  --extract-internal 仍可强制),直传片源不再生成外挂副本
- 外挂 SRT 兜底仅在 [Subtitles] export 不含 ass 时启用,避免同语言双份
- 新增同语言判重(含旧命名 <stem>.<lang>.srt),重复抽取不再产生重复字幕
- 识别中英双语轨为 zh-en,语言白名单加入 zh-en
- 外挂字幕统一 <stem>.internal.<lang>.srt 命名
- 右键菜单合并为 SceneMarshal 级联子菜单(ExtendedSubCommandsKey),
  四项:媒体整理 / 媒体归档 / 补外挂字幕 / 入库校验,图标 assets/menu 自绘
- HANDOFF 补右键菜单说明;新增 docs/movie-duplicates.md 记录电影库清理
2026-11-19 13:55:33 +08:00

60 lines
1.9 KiB
PowerShell

#Requires -Version 7.0
<#
.SYNOPSIS
移除 install-explorer-menu.ps1 注册的 SceneMarshal 右键菜单。
.DESCRIPTION
清理范围:
- 5 处位置上的 SceneMarshal 父菜单(级联)及旧版平级项
- 级联用的共享子菜单键 SceneMarshalMenu / SceneMarshalMenuBg
- 兜底模式(-Flat)注册的 SceneMarshal-<action> 平级项
.EXAMPLE
.\uninstall-explorer-menu.ps1
#>
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
$shells = @(
'HKCU:\Software\Classes\Directory\shell',
'HKCU:\Software\Classes\Directory\Background\shell',
'HKCU:\Software\Classes\SystemFileAssociations\.mkv\shell',
'HKCU:\Software\Classes\SystemFileAssociations\.mp4\shell',
'HKCU:\Software\Classes\SystemFileAssociations\.avi\shell'
)
$keyNames = @('SceneMarshal', 'SceneMarshalArchive')
$removed = 0
foreach ($shell in $shells) {
foreach ($name in $keyNames) {
$key = Join-Path $shell $name
if (Test-Path -LiteralPath $key) {
Remove-Item -LiteralPath $key -Recurse -Force
$removed++
Write-Host " - 已移除 $key" -ForegroundColor DarkGray
}
}
# 兜底模式留下的平级项
Get-ChildItem -LiteralPath $shell -ErrorAction SilentlyContinue |
Where-Object { $_.PSChildName -like 'SceneMarshal-*' } |
ForEach-Object {
Remove-Item -LiteralPath $_.PSPath -Recurse -Force
$script:removed++
Write-Host (" - 已移除 {0}" -f $_.PSChildName) -ForegroundColor DarkGray
}
}
# 共享子菜单
foreach ($sub in @('SceneMarshalMenu', 'SceneMarshalMenuBg')) {
$key = "HKCU:\Software\Classes\$sub"
if (Test-Path -LiteralPath $key) {
Remove-Item -LiteralPath $key -Recurse -Force
$script:removed++
Write-Host " - 已移除 $key" -ForegroundColor DarkGray
}
}
Write-Host ("✔ 右键菜单已清理({0} 项)" -f $removed) -ForegroundColor Green