Skip to content

Commit a225786

Browse files
committed
Add install.ps1
[GitHub #98]
1 parent c6a0801 commit a225786

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tool/install.ps1

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ---------------------------------------------------------------
2+
# File Name : install.ps1
3+
# File Authors : Aoran Zeng <ccmywish@qq.com>
4+
# | ChatGPT <https://chatgpt.com/>
5+
# Created On : <2024-10-26>
6+
# Last Modified : <2024-10-26>
7+
#
8+
#
9+
# chsrc installer for Windows
10+
#
11+
# ---------------------------------------------------------------
12+
13+
# [Environment]::Is64BitProcess # True
14+
15+
$osarch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
16+
17+
$dlarch = ""
18+
19+
switch ($osarch) {
20+
21+
"Arm64" {
22+
$dlarch = "arm64"
23+
Write-Error "Unsupported platform Arm64";
24+
}
25+
26+
"Arm" {
27+
$dlarch = "arm"
28+
Write-Error "Unsupported platform Arm";
29+
}
30+
31+
'X64' { $dlarch = "x64" }
32+
'X86' { $dlarch = "x86" }
33+
}
34+
35+
$url = "https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc-${dlarch}-windows.exe"
36+
37+
Write-Output "[INFO] URL: $url"
38+
curl.exe -L $url -o chsrc.exe
39+
Write-Output "🎉 Installation completed, path: ./chsrc.exe"

0 commit comments

Comments
 (0)