Skip to content

Commit

Permalink
Get depot name from build props
Browse files Browse the repository at this point in the history
  • Loading branch information
welles committed Sep 22, 2023
1 parent 77241a3 commit b715eba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Version>3.0.3.0</Version>
<GameVersion>1.1.6.26219</GameVersion>
<GameBranch>Stable</GameBranch>
<DepotName>public</DepotName>
<HarmonyVersion>2.2.2</HarmonyVersion>
<MCMVersion>5.9.1</MCMVersion>
<ButterLibVersion>2.8.13</ButterLibVersion>
Expand Down
12 changes: 5 additions & 7 deletions Download-Game.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ Param(
$Branch = "stable"
)

$CurrentBeta = "1.2.0"
$DepotVersion = Get-Content $PWD\Directory.Build.props | Select-String -Pattern "<DepotName>([\w.-]+)<\/DepotName>" | ForEach-Object { $($_.Matches.Groups[1]).Value }

$GameDirectory = If ($Branch -eq "stable") { "bannerlord-stable" } ElseIf ($Branch -eq "beta") { "bannerlord-beta" } Else { throw "Invalid branch name!" }

$SteamCmdUrl = "https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip";

Write-Host "Downloading / updating game for branch [$Branch]" -ForegroundColor Cyan
Write-Host "Downloading game for branch [$Branch ($DepotVersion)] into [$GameDirectory]" -ForegroundColor Cyan

Write-Host "Checking if SteamCMD is installed... " -NoNewline

Expand Down Expand Up @@ -54,8 +56,4 @@ Else
Return
}

$GameDirectory = If ($Branch -eq "stable") { "bannerlord-stable" } ElseIf ($Branch -eq "beta") { "bannerlord-beta" } Else { throw "Invalid branch name!" }

$GameBranch = If ($Branch -eq "stable") { "public" } ElseIf ($Branch -eq "beta") { $CurrentBeta } Else { throw "Invalid branch name!" }

&"$PWD\bin\steamcmd\steamcmd.exe" +force_install_dir "$PWD\bin\$GameDirectory" +login $Credentials[0] $Credentials[1] "+app_update 261550 -beta $GameBranch validate" +quit
&"$PWD\bin\steamcmd\steamcmd.exe" +force_install_dir "$PWD\bin\$GameDirectory" +login $Credentials[0] $Credentials[1] "+app_update 261550 -beta $DepotVersion validate" +quit

0 comments on commit b715eba

Please sign in to comment.