Skip to content

Commit

Permalink
add warning for the disabling of background task
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldin101 committed Oct 31, 2023
1 parent 39e0c0b commit 3a9709d
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 24 deletions.
11 changes: 11 additions & 0 deletions .Templates/Generic/Background.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ $cloudName = "SteamCloudify for $gameName"
$databaseURL = "https://aldin101.github.io/SteamCloudify/$($gameName.Replace(' ', '%20'))/$($gameName.Replace(' ', '%20')).json"
$updateLink = "https://aldin101.github.io/SteamCloudify/$($gameName.Replace(' ', '%20'))/SteamCloudSync.exe"
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
[System.Windows.Forms.Application]::EnableVisualStyles()

$config = Get-Content "$env:appdata\$cloudName\CloudConfig.json" | ConvertFrom-Json
$steamPath = $config.steamPath
$steamid = $config.steamID
$gamepath = $config.gamepath
$fail = $false
cd $gamepath
$exehash=Get-FileHash -Algorithm MD5 "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"
while (1) {
Expand Down Expand Up @@ -55,6 +57,15 @@ while (1) {
[System.Windows.Forms.MessageBox]::Show( "SteamCloudify uninstalled successfully!", "Uninstalled!", "Ok", "Information" )
exit
}
try {
$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
} catch {
$fail = $true
}
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6 -and $fail -eq $false) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save data to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. Until one of those actions have been completed you will be unable to launch $gamename", "SteamCloudify", "Ok", "Warning")
$fail = $true
}
if ($(Get-FileHash -Algorithm MD5 "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudname.exe").Hash -ne $exehash.Hash) {
exit
}
Expand Down
12 changes: 8 additions & 4 deletions .Templates/Generic/SteamCloudSync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,14 @@ if ((Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds -
$config.lastBackup = (Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds
$config | ConvertTo-Json | Format-Json | Set-Content "$env:appdata\$cloudName\CloudConfig.json"
}

$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. After either of those actions are completed you will be able to launch the game again.", "SteamCloudify", "Ok", "Warning")
$fail = $false
try {
$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
} catch {
$fail = $true
}
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6 -and $fail -eq $false) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save data to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. After either of those actions are completed you will be able to launch the game again.", "SteamCloudify", "Ok", "Warning")
exit
}
$cloudFiles = Get-ChildItem -Path "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID\" -Include ($gameSaveExtensions | ForEach-Object { "*$_.vdf" }) -File -Recurse
Expand Down
11 changes: 11 additions & 0 deletions .Templates/Saves in game folder/Background.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ $cloudName = "SteamCloudify for $gameName"
$databaseURL = "https://aldin101.github.io/SteamCloudify/$($gameName.Replace(' ', '%20'))/$($gameName.Replace(' ', '%20')).json"
$updateLink = "https://aldin101.github.io/SteamCloudify/$($gameName.Replace(' ', '%20'))/SteamCloudSync.exe"
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
[System.Windows.Forms.Application]::EnableVisualStyles()

$config = Get-Content "$env:appdata\$cloudName\CloudConfig.json" | ConvertFrom-Json
$steamPath = $config.steamPath
$steamid = $config.steamID
$gamepath = $config.gamepath
$gameSaveFolder | iex
$fail = $false
cd $gamepath
$exehash=Get-FileHash -Algorithm MD5 "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"
while (1) {
Expand Down Expand Up @@ -60,6 +62,15 @@ while (1) {
[System.Windows.Forms.MessageBox]::Show( "SteamCloudify uninstalled successfully!", "Uninstalled!", "Ok", "Information" )
exit
}
try {
$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
} catch {
$fail = $true
}
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6 -and $fail -eq $false) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save data to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. Until one of those actions have been completed you will be unable to launch $gamename", "SteamCloudify", "Ok", "Warning")
$fail = $true
}
if ($(Get-FileHash -Algorithm MD5 "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudname.exe").Hash -ne $exehash.Hash) {
exit
}
Expand Down
12 changes: 8 additions & 4 deletions .Templates/Saves in game folder/SteamCloudSync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,14 @@ if ((Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds -
$config.lastBackup = (Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds
$config | ConvertTo-Json | Format-Json | Set-Content "$env:appdata\$cloudName\CloudConfig.json"
}

$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. After either of those actions are completed you will be able to launch the game again.", "SteamCloudify", "Ok", "Warning")
$fail = $false
try {
$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
} catch {
$fail = $true
}
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6 -and $fail -eq $false) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save data to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. After either of those actions are completed you will be able to launch the game again.", "SteamCloudify", "Ok", "Warning")
exit
}
$cloudFiles = Get-ChildItem -Path "$steamPath\steamapps\common\Steam Controller Configs\$steamid\config\$steamAppID\" -Include ($gameSaveExtensions | ForEach-Object { "*$_.vdf" }) -File -Recurse
Expand Down
11 changes: 11 additions & 0 deletions .Templates/Unity/Background.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ $cloudName = "SteamCloudify for $gameName"
$databaseURL = "https://aldin101.github.io/SteamCloudify/$($gameName.Replace(' ', '%20'))/$($gameName.Replace(' ', '%20')).json"
$updateLink = "https://aldin101.github.io/SteamCloudify/$($gameName.Replace(' ', '%20'))/SteamCloudSync.exe"
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
[System.Windows.Forms.Application]::EnableVisualStyles()

$config = Get-Content "$env:appdata\$cloudName\CloudConfig.json" | ConvertFrom-Json
$steamPath = $config.steamPath
$steamid = $config.steamID
$gamepath = $config.gamepath
$fail = $false
cd $gamepath
$exehash=Get-FileHash -Algorithm MD5 "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudName.exe"
while (1) {
Expand Down Expand Up @@ -54,6 +56,15 @@ while (1) {
[System.Windows.Forms.MessageBox]::Show( "SteamCloudify uninstalled successfully!", "Uninstalled!", "Ok", "Information" )
exit
}
try {
$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
} catch {
$fail = $true
}
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6 -and $fail -eq $false) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save data to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. Until one of those actions have been completed you will be unable to launch $gamename", "SteamCloudify", "Ok", "Warning")
$fail = $true
}
if ($(Get-FileHash -Algorithm MD5 "$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\$cloudname.exe").Hash -ne $exehash.Hash) {
exit
}
Expand Down
12 changes: 8 additions & 4 deletions .Templates/Unity/SteamCloudSync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,14 @@ if ((Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds -
$config.lastBackup = (Get-Date).ToUniversalTime().Subtract((Get-Date "1/1/1970")).TotalSeconds
$config | ConvertTo-Json | Format-Json | Set-Content "$env:appdata\$cloudName\CloudConfig.json"
}

$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. After either of those actions are completed you will be able to launch the game again.", "SteamCloudify", "Ok", "Warning")
$fail = $false
try {
$startup = Get-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder" -Name "SteamCloudify for $gameName.exe"
} catch {
$fail = $true
}
if ($($startup)."steamcloudify for $gamename.exe"[0] -ne 2 -and $($startup)."steamcloudify for $gamename.exe"[0] -ne 6 -and $fail -eq $false) {
[System.Windows.Forms.MessageBox]::Show("SteamCloudify is not allowed to run at startup. This means that if $gamename updates or the game files are validated SteamCloudify will be unable to re-patch the game.`n`nThis will cause your save data to stop syncing and might even result in data loss.`n`n`Please re-enable SteamCloudify in Task Manger's startup tab or uninstall SteamCloudify. After either of those actions are completed you will be able to launch the game again.", "SteamCloudify", "Ok", "Warning")
exit
}
$choice = "Yes"
Expand Down
8 changes: 4 additions & 4 deletions Get To The Orange Door/Resources/Background.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEOS 0x40004
FILETYPE 0x1
{
Expand All @@ -11,12 +11,12 @@ BLOCK "StringFileInfo"
{
VALUE "CompanyName", "Aldin101"
VALUE "FileDescription", "SteamCloudify Background Task "
VALUE "FileVersion", "1.0.0"
VALUE "FileVersion", "1.0.1"
VALUE "InternalName", "SteamCloudBackground "
VALUE "LegalCopyright", "Aldin101"
VALUE "OriginalFilename", "SteamCloudBackground.exe"
VALUE "ProductName", "SteamCloudify"
VALUE "ProductVersion", "1.0.0"
VALUE "ProductVersion", "1.0.1"
}
}

Expand Down
8 changes: 4 additions & 4 deletions Get To The Orange Door/Resources/CloudSync.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEOS 0x40004
FILETYPE 0x1
{
Expand All @@ -11,12 +11,12 @@ BLOCK "StringFileInfo"
{
VALUE "CompanyName", "Aldin101"
VALUE "FileDescription", "SteamCloudify launcher "
VALUE "FileVersion", "1.0.0"
VALUE "FileVersion", "1.0.1"
VALUE "InternalName", "SteamCloudSync "
VALUE "LegalCopyright", "Aldin101"
VALUE "OriginalFilename", "SteamCloudSync.exe"
VALUE "ProductName", "SteamCloudify"
VALUE "ProductVersion", "1.0.0"
VALUE "ProductVersion", "1.0.1"
}
}

Expand Down
8 changes: 4 additions & 4 deletions Get To The Orange Door/Resources/Offline.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEOS 0x40004
FILETYPE 0x1
{
Expand All @@ -11,12 +11,12 @@ BLOCK "StringFileInfo"
{
VALUE "CompanyName", "Aldin101"
VALUE "FileDescription", "SteamCloudify Offline Installer "
VALUE "FileVersion", "1.0.0"
VALUE "FileVersion", "1.0.1"
VALUE "InternalName", "SteamCloudOffline "
VALUE "LegalCopyright", "Aldin101"
VALUE "OriginalFilename", "SteamCloudify Offline Installer.exe"
VALUE "ProductName", "SteamCloudify"
VALUE "ProductVersion", "1.0.0"
VALUE "ProductVersion", "1.0.1"
}
}

Expand Down

0 comments on commit 3a9709d

Please sign in to comment.