git submodule init
git submodule update --recursive --force

.\buildSFML.ps1
.\buildViGEmClient.ps1

cd deps/traypp

git apply ../../traypp_unicode.patch

cd ../../

cd .\GlosSIConfig\

..\version_help.ps1

$apiKeyText = "
/* Autogenerated version info file */
#pragma once

inline const char* steamgridb_key = ""$env:STEAMGRIDDB_KEY"";
"

if (!(Test-Path 'steamgrid_api_keys.h')) {
    New-Item -Path "." -Name "steamgrid_api_keys.h" -ItemType "file" -Value $apiKeyText
}

cd ../

if (!(Test-Path 'steamgrid.exe')) {
    Invoke-WebRequest -o steamgrid.zip https://github.com/boppreh/steamgrid/releases/download/v3.4.0/steamgrid_windows.zip
    7z e steamgrid.zip  steamgrid.exe
}
