Skip to content

Commit

Permalink
Add install.ps1
Browse files Browse the repository at this point in the history
[GitHub #98]
  • Loading branch information
ccmywish committed Oct 25, 2024
1 parent c6a0801 commit a225786
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tool/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ---------------------------------------------------------------
# File Name : install.ps1
# File Authors : Aoran Zeng <[email protected]>
# | ChatGPT <https://chatgpt.com/>
# 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"

0 comments on commit a225786

Please sign in to comment.