From a22578604a9f2b3ff4a6dc3b6e815f8f6a8705b8 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Sat, 26 Oct 2024 00:16:35 +0800 Subject: [PATCH] Add install.ps1 [GitHub #98] --- tool/install.ps1 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tool/install.ps1 diff --git a/tool/install.ps1 b/tool/install.ps1 new file mode 100644 index 0000000..9bf3320 --- /dev/null +++ b/tool/install.ps1 @@ -0,0 +1,39 @@ +# --------------------------------------------------------------- +# File Name : install.ps1 +# File Authors : Aoran Zeng +# | ChatGPT +# Created On : <2024-10-26> +# Last Modified : <2024-10-26> +# +# +# chsrc installer for Windows +# +# --------------------------------------------------------------- + +# [Environment]::Is64BitProcess # True + +$osarch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture + +$dlarch = "" + +switch ($osarch) { + + "Arm64" { + $dlarch = "arm64" + Write-Error "Unsupported platform Arm64"; + } + + "Arm" { + $dlarch = "arm" + Write-Error "Unsupported platform Arm"; + } + + 'X64' { $dlarch = "x64" } + 'X86' { $dlarch = "x86" } +} + +$url = "https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc-${dlarch}-windows.exe" + +Write-Output "[INFO] URL: $url" +curl.exe -L $url -o chsrc.exe +Write-Output "🎉 Installation completed, path: ./chsrc.exe"