Skip to content

Commit

Permalink
fix game config for unity, no backup, and no computer choice
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldin101 committed Oct 26, 2023
1 parent 00d3375 commit 0c4928d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .Database/GameList.json

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions .Templates/Generic/OnlineInstaller.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ if (test-path "$steamPath\steamapps\common\$gameFolderName\") {
}

cd $gamepath
$choice = $null
if (Test-Path "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID\isConfigured.vdf") {
while ($choice -eq $null) {
echo "SteamCloudify has already been installed on another computer, and saves for that computer are already in Steam Cloud"
Expand Down Expand Up @@ -125,18 +126,20 @@ if (Test-Path "$steamPath\steamapps\common\Steam Controller Configs\$steamid\con
} else {
$choice = 1
}

mkdir "$env:appdata\$cloudname\" | out-null
Rename-Item ".\$gameExecutableName" "$($gameExecutableName.TrimEnd(".exe")) Game.exe"
Invoke-WebRequest $database.updateLink -OutFile ".\$gameExecutableName"
Invoke-WebRequest $database.gameUpdateChecker -OutFile "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"

mkdir "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID" | out-null
if ($gameSaveFolder -ne $null) {
Copy-Item "$gameSaveFolder" "$env:appdata\$cloudName\1\" -Recurse -Force | Out-Null
}
if ($gameRegistryEntries -ne $null) {
reg export $gameRegistryEntries "$env:appdata\$cloudName\1.reg"
}

mkdir "$env:appdata\$cloudname\" | out-null
Rename-Item ".\$gameExecutableName" "$($gameExecutableName.TrimEnd(".exe")) Game.exe"
mkdir "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID"
Invoke-WebRequest $database.updateLink -OutFile ".\$gameExecutableName"
Invoke-WebRequest $database.gameUpdateChecker -OutFile "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"
if ($choice -eq 1) {
if ($gameSaveFolder -ne $null) {
Get-ChildItem $gameSaveFolder -recurse -Include ($gameSaveExtensions | ForEach-Object { "*$_" }) | `
Expand All @@ -162,7 +165,7 @@ $CloudConfig.Add("steamID",$steamid)
$CloudConfig.Add("lastBackup",(Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds)
$CloudConfig.Add("CloudSyncDownload", $database.updateLink)
$CloudConfig | ConvertTo-Json -depth 32 | Format-Json | Set-Content "$env:appdata\$cloudName\CloudConfig.json"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | out-null
Install-Module -Name BurntToast -Confirm:$false -Force
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$cloudName | Out-Null
New-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$cloudName -Name "DisplayIcon" -Value "$gamepath\$gameExecutableName" -PropertyType "String" -Force | Out-Null
Expand Down
15 changes: 9 additions & 6 deletions .Templates/Saves in game folder/OnlineInstaller.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ if (test-path "$steamPath\steamapps\common\$gameFolderName\") {
}
$gameSaveFolder | iex
cd $gamepath
$choice = $null
if (Test-Path "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID\isConfigured.vdf") {
while ($choice -eq $null) {
echo "SteamCloudify has already been installed on another computer, and saves for that computer are already in Steam Cloud"
Expand Down Expand Up @@ -130,18 +131,20 @@ if (Test-Path "$steamPath\steamapps\common\Steam Controller Configs\$steamid\con
} else {
$choice = 1
}

mkdir "$env:appdata\$cloudname\" | out-null
Rename-Item ".\$gameExecutableName" "$($gameExecutableName.TrimEnd(".exe")) Game.exe"
Invoke-WebRequest $database.updateLink -OutFile ".\$gameExecutableName"
Invoke-WebRequest $database.gameUpdateChecker -OutFile "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"

mkdir "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID" | out-null
if ($gameSaveFolder -ne $null) {
Copy-Item "$gameSaveFolder" "$env:appdata\$cloudName\1\" -Recurse -Force | Out-Null
}
if ($gameRegistryEntries -ne $null) {
reg export $gameRegistryEntries "$env:appdata\$cloudName\1.reg"
}

mkdir "$env:appdata\$cloudname\" | out-null
Rename-Item ".\$gameExecutableName" "$($gameExecutableName.TrimEnd(".exe")) Game.exe"
mkdir "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID"
Invoke-WebRequest $database.updateLink -OutFile ".\$gameExecutableName"
Invoke-WebRequest $database.gameUpdateChecker -OutFile "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"
if ($choice -eq 1) {
if ($gameSaveFolder -ne $null) {
Get-ChildItem $gameSaveFolder -recurse -Include ($gameSaveExtensions | ForEach-Object { "*$_" }) | `
Expand All @@ -167,7 +170,7 @@ $CloudConfig.Add("steamID",$steamid)
$CloudConfig.Add("lastBackup",(Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds)
$CloudConfig.Add("CloudSyncDownload", $database.updateLink)
$CloudConfig | ConvertTo-Json -depth 32 | Format-Json | Set-Content "$env:appdata\$cloudName\CloudConfig.json"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | out-null
Install-Module -Name BurntToast -Confirm:$false -Force
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$cloudName | Out-Null
New-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$cloudName -Name "DisplayIcon" -Value "$gamepath\$gameExecutableName" -PropertyType "String" -Force | Out-Null
Expand Down
12 changes: 11 additions & 1 deletion .Templates/Unity/OnlineInstaller.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if (test-path "$steamPath\steamapps\common\$gameFolderName\") {
}

cd $gamepath
$choice = $null
if (Test-Path "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID\isConfigured.vdf") {
while ($choice -eq $null) {
$disableChoice = Read-Host "SteamCloudify is already enabled for this game. Would you like to disable SteamCloudify [Y/n]"
Expand Down Expand Up @@ -129,6 +130,15 @@ Rename-Item ".\$gameExecutableName" "$($gameExecutableName.TrimEnd(".exe")) Game
New-Item -Path "$gamepath\$($gameExecutableName.TrimEnd(".exe")) Game_Data" -ItemType Junction -Value "$gamepath\$($gameExecutableName.TrimEnd(".exe"))_Data" | Out-Null
Invoke-WebRequest $database.updateLink -OutFile ".\$gameExecutableName"
Invoke-WebRequest $database.gameUpdateChecker -OutFile "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"

mkdir "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID" | out-null
if ($gameSaveFolder -ne $null) {
Copy-Item "$gameSaveFolder" "$env:appdata\$cloudName\1\" -Recurse -Force | Out-Null
}
if ($gameRegistryEntries -ne $null) {
reg export $gameRegistryEntries "$env:appdata\$cloudName\1.reg"
}

if ($choice -eq 1) {
if ($gameSaveFolder -ne $null) {
Get-ChildItem $gameSaveFolder -recurse -Include ($gameSaveExtensions | ForEach-Object { "*$_" }) | `
Expand All @@ -155,7 +165,7 @@ $CloudConfig.Add("steamID",$steamid)
$CloudConfig.Add("lastBackup",(Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds)
$CloudConfig.Add("CloudSyncDownload", $database.updateLink)
$CloudConfig | ConvertTo-Json -depth 32 | Format-Json | Set-Content "$env:appdata\$cloudName\CloudConfig.json"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | out-null
Install-Module -Name BurntToast -Confirm:$false -Force
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$cloudName | Out-Null
New-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$cloudName -Name "DisplayIcon" -Value "$gamepath\$gameExecutableName" -PropertyType "String" -Force | Out-Null
Expand Down

0 comments on commit 0c4928d

Please sign in to comment.