YaoGuangSR Guide

mlem

1. Prerequisite

Download the 3.8.51 game client via your preferred source and method ( you can also try Aria2)

Open your Windows PowerShell and run the below in one go:

1
2
3
4
5
6
winget install `
Git.Git `
Microsoft.WindowsTerminal `
Microsoft.PowerShell `
--accept-package-agreements `
--accept-source-agreements

2. Install/Update

Place your StarRail_3.8.51 51GB game folder to your defaults Downloads folder and name it StarRail, it would look like this:

1
2
3
4
Downloads
└── StarRail
    ├── StarRail_Data
    └── StarRail.exe

Open your Windows Terminal and open PowerShell instead of Windows PowerShell and run the below in one go:
powershell

&   {
#Set path for stuffs
$rero="$env:AppData\rero"
$hsr="$env:UserProfile\Downloads\StarRail"
$ps="yaoguang-sr"
$psname="YaoGuangSR"

# Creat and Download stuffs
New-Item -Path "$rero\zig", "$rero\$ps\game" -ItemType Directory -Force
if (!(Test-Path "$rero\$ps\game\*")) { Move-Item -Path "$hsr\*" -Destination "$rero\$ps\game" }
if (!(Test-Path "$rero\zig\zig-x86_64-windows-0.14.1")) { curl -L https://ziglang.org/download/0.14.1/zig-x86_64-windows-0.14.1.zip | tar -xf - -C "$rero\zig" }
git -C "$rero\$ps\server" pull || git clone https://git.xeondev.com/HonkaiSlopRail/yaoguang-sr "$rero\$ps\server"

# Applying stuffs
Copy-Item "$rero\$ps\server\launcher\*" -Destination "$rero\$ps\game" -Force
Rename-Item -Path "$rero\$ps\game\StarRail_Data\Plugins\x86_64\AccountPlatNative.dll" -NewName "AccountPlatNative.1dll" -ErrorAction SilentlyContinue
(Get-Content $Profile) | Where-Object { $_ -notmatch '^function zig14' } | Out-File -FilePath $Profile
@"
function zig14 {& "$rero\zig\zig-x86_64-windows-0.14.1\zig.exe" @args}
"@ | Out-File -FilePath $Profile -Append -Encoding utf8 -Force

# Creat quickstart
@"
@echo off
wt --title "Dispatch" -d "$rero\$ps\server" pwsh -NoExit -Command "zig14 build run-dispatch" ^; new-tab --title "Gameserver" -d "$rero\$ps\server" pwsh -NoExit -Command "zig14 build run-gameserver"
start "" /D "$rero\$ps\game" "$rero\$ps\game\launcher.exe"
"@ | Out-File "$env:AppData\Microsoft\Windows\Start Menu\Programs\$psname.bat" -Encoding utf8 -Force

# Create shortcut
$ws = New-Object -ComObject WScript.Shell
$sc = $ws.CreateShortcut("$env:AppData\Microsoft\Windows\Start Menu\Programs\$psname.lnk")
$sc.TargetPath = "$env:AppData\Microsoft\Windows\Start Menu\Programs\$psname.bat"
$sc.IconLocation = "$env:AppData\rero\$ps\game\StarRail.exe,0"
$sc.Save()
$b = [IO.File]::ReadAllBytes("$env:AppData\Microsoft\Windows\Start Menu\Programs\$psname.lnk")
$b[0x15] = $b[0x15] -bor 0x20
[IO.File]::WriteAllBytes("$env:AppData\Microsoft\Windows\Start Menu\Programs\$psname.lnk", $b)
}

Open YaoGuangSR as it's your shortcut now and enjoy

3. Config

Will write later, all of your stuffs are at C:\Users\Yourusername\AppData\Roaming\rero\yaoguang-sr

4. Uninstall

Open your Windows Terminal and open PowerShell instead of Windows PowerShell and run the below in one go:

& {
$rero="$env:AppData\rero"
$ps="yaoguang-sr"
$psname="YaoGuangSR"

Remove-Item -Path "$env:AppData\Microsoft\Windows\Start Menu\Programs\$psname.lnk"
Remove-Item -Path "$env:AppData\Microsoft\Windows\Start Menu\Programs\$psname.bat"
(Get-Content $Profile) | Where-Object { $_ -notmatch '^function zig14' } | Out-File -FilePath $Profile
Remove-Item -Path "$rero\$ps\game\hkrpg.dll"
Remove-Item -Path "$rero\$ps\game\launcher.exe"
Rename-Item -Path "$rero\$ps\game\StarRail_Data\Plugins\x86_64\AccountPlatNative.1dll" -NewName "AccountPlatNative.dll"
New-Item -Path "$env:UserProfile\Downloads\StarRail" -ItemType Directory -Force
Move-Item -Path "$rero\$ps\game\*" -Destination "$env:UserProfile\Downloads\StarRail" -Force
cmd /c "rd /s /q $rero\$ps"
cmd /c "rd /s /q $rero\zig\zig-x86_64-windows-0.14.1"
}
Edit

Pub: 09 Jan 2026 09:37 UTC

Edit: 09 Jan 2026 09:40 UTC

Views: 160