참고) 안되는건 잼미니나 채찍피티한테 물어봐라 걔네가 더 잘 알려준다 나한테 물어봐도 모른다~~ 나도 얘네 갈궈서 만든거다~~
C:\Users\ 계정명 \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
여기가 시작프로그램 위치임
아래꺼 다하고
작업 관리자 들어가서 스크립트 파일은 자동실행 안되게 막아놓으셈
안 막으면 매번 컴 킬때마다 스크립트 켜저서 귀차늠...
이런식으로
메모장에다 복붙해서 만들면됨
쉘 스크립트 check_lyrics_update.ps1
$appPath = "$env:LOCALAPPDATA\spicetify\CustomApps\ivLyrics"
$manifestPath = "$appPath\manifest.json"
$versionFile = "$appPath\.version"
$repoOwner = "ivLis-Studio"
$repoName = "ivLyrics"
try {
Write-Host " Checking for updates..." -ForegroundColor Yellow
# GitHub에서 최신 릴리스 정보 가져오기
$apiUrl = "https://api.github.com/repos/$repoOwner/$repoName/releases/latest"
$release = Invoke-RestMethod $apiUrl -UseBasicParsing -TimeoutSec 20
$remoteVer = $release.tag_name -replace '^v', ''
Write-Host " Latest version: v$remoteVer" -ForegroundColor Cyan
# 설치 여부 확인
$needUpdate = $false
if (Test-Path $manifestPath) {
# 마지막 설치 버전 확인
if (Test-Path $versionFile) {
$localVer = Get-Content $versionFile -ErrorAction SilentlyContinue
Write-Host " Installed version: v$localVer" -ForegroundColor Cyan
if ($localVer -eq $remoteVer) {
Write-Host " >> Already up-to-date. Skipping." -ForegroundColor Green
exit 0
} else {
Write-Host " >> Update available (v$localVer -> v$remoteVer)" -ForegroundColor Yellow
$needUpdate = $true
}
} else {
Write-Host " >> Version file not found. Updating..." -ForegroundColor Yellow
$needUpdate = $true
}
} else {
Write-Host " >> Not installed. Installing..." -ForegroundColor Yellow
$needUpdate = $true
}
# 업데이트가 필요한 경우
if ($needUpdate) {
Write-Host "--- Installing Latest Version of $repoOwner/$repoName ---" -ForegroundColor Cyan
# 다운로드 URL (소스코드 zip)
$downloadUrl = $release.zipball_url
$zipPath = "$env:TEMP\ivLyrics_latest.zip"
$extractPath = "$env:TEMP\ivLyrics_extract"
# 1. 다운로드
Write-Host "Downloading..."
Invoke-WebRequest -Uri $downloadUrl -OutFile $zipPath
# 2. 압축 해제 준비
if (Test-Path $extractPath) { Remove-Item $extractPath -Recurse -Force }
New-Item -Path $extractPath -ItemType Directory | Out-Null
# 3. 압축 해제
Write-Host "Extracting..."
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
# 4. 폴더명 찾기 (GitHub zip은 폴더명이 랜덤 해시값임)
$extractedDir = Get-ChildItem -Path $extractPath -Directory | Select-Object -First 1
if ($extractedDir) {
# 5. 기존 폴더 안전 제거
if (Test-Path $appPath) { Remove-Item $appPath -Recurse -Force }
# 6. 새 버전 이동
Move-Item -Path $extractedDir.FullName -Destination $appPath
# 7. 버전 파일 기록
$remoteVer | Out-File -FilePath $versionFile -Encoding utf8 -NoNewline
Write-Host " Success! Version $remoteVer installed." -ForegroundColor Green
} else {
Write-Host " [Error] Extraction failed." -ForegroundColor Red
}
# 임시 파일 정리
Remove-Item $zipPath -Force -ErrorAction SilentlyContinue
Remove-Item $extractPath -Recurse -Force -ErrorAction SilentlyContinue
}
} catch {
Write-Host " [Error] Update failed: $_" -ForegroundColor Red
# 오류 발생 시에도 설치 시도 (Fallback)
Write-Host " Attempting fallback installation..."
try {
iwr -useb "https://github.com/ivLis-Studio/ivLyrics/archive/refs/heads/main.zip" -OutFile "$env:TEMP\ivLyrics_main.zip"
Expand-Archive -Path "$env:TEMP\ivLyrics_main.zip" -DestinationPath "$env:TEMP\ivLyrics_fallback" -Force
$fallbackSource = Get-ChildItem "$env:TEMP\ivLyrics_fallback" -Directory | Select-Object -First 1
if (Test-Path $appPath) { Remove-Item $appPath -Recurse -Force }
Move-Item $fallbackSource.FullName $appPath
Write-Host " Fallback installation completed." -ForegroundColor Green
} catch {
Write-Host " Fallback also failed." -ForegroundColor Red
}
}
배치 파일 spicetify_auto_update.bat
댓글 1