feat(setup): MSIX/Store 버전 Claude 앱 자동 탐지 + 바로가기 지원
PD님 환경(Windows Store 버전 Claude Code) 실측 결과 반영: - Get-AppxPackage로 MSIX 패키지 우선 탐지 - AppxManifest.xml에서 AppId 추출하여 정확한 shell:AppsFolder URI 구성 - MSIX 탐지 시 TargetPath=explorer.exe, Arguments=shell:AppsFolder\<PFN>!<AppId> - 미탐지 시 기존 일반 claude.exe 경로 탐색으로 fallback - MSIX 바로가기 생성 후 WorkingDirectory 전달 보장 안 된다는 경고 추가 실측 정보: - PackageFamilyName: Claude_pzs8sxrjxfjjc - AppId: Claude - Executable: app\claude.exe (WindowsApps 직접 접근 제한됨) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
416dcceb11
commit
d69672176f
|
|
@ -129,8 +129,28 @@ if ($CreateShortcuts) {
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "=== 부서별 바탕화면 바로가기 생성 ==="
|
Write-Host "=== 부서별 바탕화면 바로가기 생성 ==="
|
||||||
|
|
||||||
# claude.exe 경로 자동 탐색
|
# 1) MSIX/Store 패키지 우선 탐지 (PD님 환경 표준)
|
||||||
if (-not $ClaudeExePath) {
|
$msixPkg = $null
|
||||||
|
try { $msixPkg = Get-AppxPackage -Name '*Claude*' -ErrorAction SilentlyContinue | Select-Object -First 1 } catch {}
|
||||||
|
|
||||||
|
$msixLaunchArg = $null
|
||||||
|
if ($msixPkg) {
|
||||||
|
# AppxManifest에서 AppId 추출
|
||||||
|
$manifestPath = Join-Path $msixPkg.InstallLocation 'AppxManifest.xml'
|
||||||
|
$appId = 'App'
|
||||||
|
if (Test-Path $manifestPath) {
|
||||||
|
try {
|
||||||
|
[xml]$m = Get-Content $manifestPath
|
||||||
|
$appIdNode = $m.Package.Applications.Application | Select-Object -First 1
|
||||||
|
if ($appIdNode -and $appIdNode.Id) { $appId = $appIdNode.Id }
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
$msixLaunchArg = "shell:AppsFolder\$($msixPkg.PackageFamilyName)!$appId"
|
||||||
|
Write-Host "Claude MSIX 패키지 탐지: $($msixPkg.PackageFamilyName) / AppId=$appId"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 2) MSIX 미탐지 시 일반 claude.exe 탐색 (fallback)
|
||||||
|
if (-not $msixLaunchArg -and -not $ClaudeExePath) {
|
||||||
$candidatePaths = @(
|
$candidatePaths = @(
|
||||||
"$env:LOCALAPPDATA\Programs\claude\claude.exe",
|
"$env:LOCALAPPDATA\Programs\claude\claude.exe",
|
||||||
"$env:LOCALAPPDATA\AnthropicClaude\claude.exe",
|
"$env:LOCALAPPDATA\AnthropicClaude\claude.exe",
|
||||||
|
|
@ -140,25 +160,17 @@ if ($CreateShortcuts) {
|
||||||
"$env:LOCALAPPDATA\Programs\Claude\Claude.exe"
|
"$env:LOCALAPPDATA\Programs\Claude\Claude.exe"
|
||||||
)
|
)
|
||||||
foreach ($cp in $candidatePaths) {
|
foreach ($cp in $candidatePaths) {
|
||||||
if (Test-Path $cp) {
|
if (Test-Path $cp) { $ClaudeExePath = $cp; Write-Host "claude.exe 자동 탐지: $ClaudeExePath"; break }
|
||||||
$ClaudeExePath = $cp
|
|
||||||
Write-Host "claude.exe 자동 탐지: $ClaudeExePath"
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (-not $ClaudeExePath) {
|
if (-not $ClaudeExePath) {
|
||||||
$where = (Get-Command claude.exe -ErrorAction SilentlyContinue).Source
|
$where = (Get-Command claude.exe -ErrorAction SilentlyContinue).Source
|
||||||
if ($where) {
|
if ($where) { $ClaudeExePath = $where; Write-Host "claude.exe PATH에서 탐지: $ClaudeExePath" }
|
||||||
$ClaudeExePath = $where
|
|
||||||
Write-Host "claude.exe PATH에서 탐지: $ClaudeExePath"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $ClaudeExePath -or -not (Test-Path $ClaudeExePath)) {
|
if (-not $msixLaunchArg -and (-not $ClaudeExePath -or -not (Test-Path $ClaudeExePath))) {
|
||||||
Write-Warning "claude.exe 경로 탐지 실패. 바로가기 생성 생략."
|
Write-Warning "Claude 실행 수단 탐지 실패 (MSIX·exe 모두). 바로가기 생성 생략."
|
||||||
Write-Warning "수동 지정: .\setup_windows.ps1 -CreateShortcuts -ClaudeExePath '<실제 경로>'"
|
Write-Warning "수동 지정: .\setup_windows.ps1 -CreateShortcuts -ClaudeExePath '<실제 경로>'"
|
||||||
Write-Warning "claude.exe 위치 확인법: Claude Code 앱 실행 파일 속성 > 대상 경로 복사"
|
|
||||||
} else {
|
} else {
|
||||||
$WshShell = New-Object -ComObject WScript.Shell
|
$WshShell = New-Object -ComObject WScript.Shell
|
||||||
$desktop = [Environment]::GetFolderPath("Desktop")
|
$desktop = [Environment]::GetFolderPath("Desktop")
|
||||||
|
|
@ -176,16 +188,28 @@ if ($CreateShortcuts) {
|
||||||
}
|
}
|
||||||
$shortcutPath = Join-Path $desktop "$($t.Name).lnk"
|
$shortcutPath = Join-Path $desktop "$($t.Name).lnk"
|
||||||
$sc = $WshShell.CreateShortcut($shortcutPath)
|
$sc = $WshShell.CreateShortcut($shortcutPath)
|
||||||
$sc.TargetPath = $ClaudeExePath
|
if ($msixLaunchArg) {
|
||||||
|
# MSIX 앱: explorer.exe shell:AppsFolder\... 방식
|
||||||
|
$sc.TargetPath = "explorer.exe"
|
||||||
|
$sc.Arguments = $msixLaunchArg
|
||||||
|
} else {
|
||||||
|
# 일반 exe 방식
|
||||||
|
$sc.TargetPath = $ClaudeExePath
|
||||||
|
$sc.IconLocation = "$ClaudeExePath,0"
|
||||||
|
}
|
||||||
$sc.WorkingDirectory = $t.Dir
|
$sc.WorkingDirectory = $t.Dir
|
||||||
$sc.IconLocation = "$ClaudeExePath,0"
|
|
||||||
$sc.Description = $t.Desc
|
$sc.Description = $t.Desc
|
||||||
$sc.Save()
|
$sc.Save()
|
||||||
Write-Host "바로가기 생성: $shortcutPath (WD=$($t.Dir))"
|
Write-Host "바로가기 생성: $shortcutPath (WD=$($t.Dir))"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "바로가기 3종 생성 완료. 바탕화면에서 각 바로가기 더블클릭으로 해당 부서 폴더에서 Claude Code 실행 가능."
|
if ($msixLaunchArg) {
|
||||||
|
Write-Host "바로가기 3종 생성 완료 (MSIX 모드)."
|
||||||
|
Write-Host "※ MSIX 앱은 WorkingDirectory가 전달되지 않을 수 있음. 바로가기 더블클릭 후 실제 프로젝트 경로 확인 필수."
|
||||||
|
} else {
|
||||||
|
Write-Host "바로가기 3종 생성 완료."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue