diff --git a/scripts/build-release.sh b/scripts/build-release.sh index 58267f5..27a3461 100755 --- a/scripts/build-release.sh +++ b/scripts/build-release.sh @@ -15,3 +15,4 @@ cp ./target/x86_64-pc-windows-gnu/release/mcmg.exe ./target/mcmg_win32.exe cp ./target/x86_64-unknown-linux-gnu/release/mcmg ./target/mcmg_linux_x86_64 cp ./target/aarch64-unknown-linux-gnu/release/mcmg ./target/mcmg_linux_aarch64 cp ./scripts/setup-template.sh "./target/mcmg-setup-$1.sh" +cp ./scripts/setup-template.ps1 "./target/mcmg-setup-$1.ps1" diff --git a/scripts/setup-template.ps1 b/scripts/setup-template.ps1 new file mode 100644 index 0000000..9d10702 --- /dev/null +++ b/scripts/setup-template.ps1 @@ -0,0 +1,23 @@ + +$MyInvocation.MyCommand.Name -match '([0-9]+\.[0-9]+\.[0-9]+([ab]|(rc[-]*[0-9]*)))' +$Ver = $Matches[1] + + +if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) { + winget install Gyan.FFmpeg +} + +if (-not (Get-Command "yt-dlp" -ErrorAction SilentlyContinue)) { + winget install "yt-dlp.yt-dlp" +} + +if (-not (Get-Command spotdl -ErrorAction SilentlyContinue)) { + if (-not (Get-Command python -ErrorAction SilentlyContinue)) { + winget install "Python.Python.3.12" + } + python -m pip install spotdl +} + +$url = "https://git.mcorangehq.xyz/XOR64/music/releases/download/$Ver/mcmg_win32.exe" + +Invoke-WebRequest -Uri $url -OutFile "mcmg.exe"