#1  
Old 05-20-2018, 01:12 AM
powbam's Avatar
powbam powbam is offline
Praetorian
 
Join Date: Nov 2013
Posts: 6,326
Default [TOOL] GD Switcher - A niche tool for niche fools

[TOOL] GD Switcher - A niche tool for niche fools

What It Does
  • Its intended function is simply to make separate backups for Steam and GOG and then quickly switch between them as you need, keeping your character saves and settings intact. This is primarily useful for those who own copies on both platforms and wish to play different Grim Dawn versions but DON'T wish their saves and settings to intermix between the two. Since both platforms utilize the SAME save folder you may actually find this tool necessary for ease of use and automation of the procedure.

  • Either game client CAN be started from Switcher's Main Menu. It will verify which save is active for you AUTOMATICALLY. If the wrong save is active it will back up the active one appropriately and restore the correct one for the client you wish to use and then proceed to start the game. When you are finished playing you will be presented, right then and there, with an option to backup your save. I don't think I need to say how handy that can be.

  • As a byproduct of this intended usage it CAN also be used for just one or the other as a backup mechanism.

  • It can create as many backups of the 'current' default backup as you wish, allowing you to individually name them how you wish, to provide security against data loss.

  • Extract and Restore previous User-made backups.

Copy the current code from the post below into a .txt file and then rename the file extension to .bat or .cmd extension.

Or, you can download the .txt file (clicking link initiates download) and then rename it as a .bat or .cmd extension.

Click here to go to the post directly below to learn the basics.

Steam forum thread for GD Switcher located here..
https://steamcommunity.com/app/21999...2345926605496/

Version Information

The date of each update will be the "version" number. This is displayed within the script at the top of the screen. You can also select an option from the Main Menu that will take you to this thread to check for updates.

Current Version
ver.5-26-2018
  • Decided to add a "sort" of versioning. It's still based off the date and displays at the top of the script, ie. ver.5-26-2018. There is an option at the bottom of the Main Menu to bring you here to check the version.

  • Finished expanding the ability of the script to create .zip's whenever it makes a backup during any switching operation in the script. This means that when you use Auto Switcher or when you select Play Steam/GOG and it initiates an autoswitch it will also create a default backup .zip which is deleted and recreated everytime a backup occurs to keep it current. This default .zip file is what the "Create a backup of a backup" option in the Steam & GOG Menu pulls from when you use this option to create your own backups.

  • The Restore Steam/GOG Backup options in the Steam & GOG Menu now each bring you to a further sub menu where you can choose to either restore the current default backup OR you can choose to extract one of your User-made backups and restore it. Be mindful that doing so deletes (and replaces) the current default backup. If you don't want to lose it for good be sure to create a User-made backup of it first.

Old Version History

Spoiler!


Final Thoughts

Thanks go to @eisprinzessin for suggesting this route and @mamba and @medea fleecestealer for enduring my short temper. They figured out the trick to talking me down. Be nice, even when I'm being a prick
__________________
powbam is like a forum vulture, when he shows up, the thread is close to death. ~jiaco

Last edited by powbam; 05-26-2018 at 10:55 PM.
Reply With Quote
  #2  
Old 05-21-2018, 03:50 PM
powbam's Avatar
powbam powbam is offline
Praetorian
 
Join Date: Nov 2013
Posts: 6,326
Default

How To Use

*Note: I would advise that you have cloud saves off in Steam and in Galaxy if you use GOG's client. I do not currently plan to attempt to make Switcher work with cloudsaving.

1) Setting it up
  • GD Switcher is a simple .bat or .cmd file. You can either copy and paste the code in the post below into a .txt file and then rename the file extension to .bat or .cmd extension or you can download the .txt file attached to this post and then rename it as a .bat or .cmd extension.

2) Setting it up, cont.
  • After you have your file ready just place it where you want. Create a shortcut file or pin it to your taskbar if you like, and then execute.



3) Making backups
  • You need to make backups FIRST to use this as intended. Press 2 on your keyboard to enter the Steam & GOG Menu. Then Press 2 to initiate a Steam Backup (ensure the saves you want for Steam are present in the default save folder).



4) Making backups, cont.
  • Repeat the process for GOG. You will want to delete the Grim Dawn default directory and start a new save from scratch (with your GOG version of GD) before initiating the backup. Alternatively you can just select "Play GOG GD" from the Main Menu and it will automatically set it up for you!

  • Your backups can be found @ C:\Users\USERNAME HERE\Documents\My Games\Grim Dawn_Switcher

5) Auto Switcher & Auto Verify
  • That's pretty much all you need to do to start switching. At the Main Menu press 1 to enter the Auto Switcher Menu or just stay at the Main Menu and select "Play" Steam or GOG GD.


  • You may not always remember which saves you last had loaded. For that I rigged up a "verifier". It simply creates a text file in C:\Users\USERNAME HERE\Documents\My Games\Grim Dawn when you first backup your separate installations that I then have Switcher check for to determine between Steam/GOG and it then lets you know which one is active.

  • Now just Switch in the save you want. After setting up your backups it's that simple.
Attached Files
File Type: txt gdswitcher.txt (21.1 KB, 52 views)
__________________
powbam is like a forum vulture, when he shows up, the thread is close to death. ~jiaco

Last edited by powbam; 05-26-2018 at 10:55 PM.
Reply With Quote
  #3  
Old 05-23-2018, 07:30 PM
powbam's Avatar
powbam powbam is offline
Praetorian
 
Join Date: Nov 2013
Posts: 6,326
Default

GD Switcher Batch Script Code

Current Version
ver.5-26-2018

Code:
@echo off

setlocal enableextensions

set switchDateVer=echo  ver.5-26-2018
set switchDateVer2=ver.5-26-2018
set switchHeader=echo    GD Switcher - A niche tool for niche fools
set checkVersionWWW=www.grimdawn.com/forums/showthread.php?p=637535#post637535
set myGamDefSavePath=%UserProfile%\Documents\My Games
set gdDefSavePath=%UserProfile%\Documents\My Games\Grim Dawn
set switchBckupDefPath=%UserProfile%\Documents\My Games\Grim Dawn_Switcher
set switchBckupDefGOGPath=%UserProfile%\Documents\My Games\Grim Dawn_Switcher\Grim Dawn_GOG\Grim Dawn
set switchBckupDefGOGPath2=%UserProfile%\Documents\My Games\Grim Dawn_Switcher\Grim Dawn_GOG
set switchBckupDefStmPath=%UserProfile%\Documents\My Games\Grim Dawn_Switcher\Grim Dawn_Steam\Grim Dawn
set switchBckupDefStmPath2=%UserProfile%\Documents\My Games\Grim Dawn_Switcher\Grim Dawn_Steam
set charPathSteam=%UserProfile%\Documents\My Games\Grim Dawn_Switcher\Grim Dawn_Steam\Grim Dawn\save\main
set charPathGOG=%UserProfile%\Documents\My Games\Grim Dawn_Switcher\Grim Dawn_GOG\Grim Dawn\save\main
set stmGDPath=C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn
set gogGDPath=C:\Program Files (x86)\GOG Galaxy\Games\Grim Dawn
set gdEx=Grim Dawn.exe
set swGOGVer=SwitcherGOGVerify.txt
set swStmVer=SwitcherSteamVerify.txt
set ech[=echo       [
set ifErr=if errorlevel

rem
rem
rem GD Switcher's various menus.
rem
rem

:mainList
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo      Main Menu
echo.
%ech[%1] Close Switcher
%ech[%2] Steam ^& GOG Menu
%ech[%3] Auto Switcher Menu
%ech[%4] Deletion Menu
%ech[%5] Play Steam GD
%ech[%6] Play GOG GD
%ech[%7] Check Switcher Version
echo.

choice /C:1234567 /N /M ......

%ifErr% 7 goto checkVerStart
%ifErr% 6 goto callGOGGD
%ifErr% 5 goto callStmGD
%ifErr% 4 goto delList
%ifErr% 3 goto autoList
%ifErr% 2 goto stmGogList
%ifErr% 1 goto endSwitch

:checkVerStart
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo       Opens default browser and goes to..
echo       %checkVersionWWW%
echo       ..so you may check if you have the latest version.
echo.&echo     Current Switcher Version: %switchDateVer2%
echo.&%ech[%1] Continue&%ech[%2] Cancel&echo.

choice /C:12 /N /M ......

%ifErr% 2 goto mainList
%ifErr% 1 goto checkVerStart2

:checkVerStart2
cls&start %checkVersionWWW%

goto mainList

:stmGogList
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo      Steam ^& GOG Menu
echo.
%ech[%1] Main Menu
%ech[%2] Backup Steam
%ech[%3] Create Backup of Steam Backup
%ech[%4] Backup GOG
%ech[%5] Create Backup of GOG Backup
%ech[%6] Restore Steam Backup
%ech[%7] Restore GOG Backup
echo.

choice /C:1234567 /N /M ......

%ifErr% 7 goto gogRestore
%ifErr% 6 goto stmRestore
%ifErr% 5 goto gogBackupUserIn
%ifErr% 4 goto gogBackup
%ifErr% 3 goto stmBackupUserIn
%ifErr% 2 goto stmBackup
%ifErr% 1 goto mainList

:autoList
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo      Auto Switcher Menu
echo.
%ech[%1] Main Menu
%ech[%2] Verify Active Save
%ech[%3] Switch to Steam
%ech[%4] Switch to GOG
echo.

choice /C:1234 /N /M ......

%ifErr% 4 goto autoGogSwitch
%ifErr% 3 goto autoStmSwitch
%ifErr% 2 goto autoVerify
%ifErr% 1 goto mainList

:delList
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo      Deletion Menu - Deletes instantly!
echo.
%ech[%1] Main Menu
%ech[%2] Steam Backup
%ech[%3] GOG Backup
%ech[%4] Verification Files
%ech[%5] GD Default Save Folder
%ech[%6] Delete ALL
echo.

choice /C:123456 /N /M ......

%ifErr% 6 goto delDefAll
%ifErr% 5 goto delDef
%ifErr% 4 goto delVerify
%ifErr% 3 goto delGog
%ifErr% 2 goto delStm
%ifErr% 1 goto mainList

rem
rem
rem Verify if the active save is for Steam or GOG.
rem
rem

:autoVerify
cls&cd "%gdDefSavePath%"
if exist %swStmVer% goto autoVerify2
if exist %swGOGVer% goto autoVerify3
if not exist *.txt goto autoVerify4

:autoVerify2
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Steam saves are currently ACTIVE!
echo.&pause

goto autoList

:autoVerify3
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG saves are currently ACTIVE!
echo.&pause

goto autoList

:autoVerify4
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Neither Steam or GOG has been confirmed
echo    as active. Backup your saves on each
echo    platform first for verify to work properly.
echo.&pause

goto autoList

rem
rem
rem Back up and then switch out the active save and bring in the other.
rem
rem

:autoStmSwitch
cls&cd "%gdDefSavePath%"
if exist %swStmVer% goto autoStmSwitchWarn
if not exist *.txt goto autoStmSwitchWarn2

cd "%switchBckupDefGOGPath%"
if not exist %swGOGVer% goto autoStmSwitchWarn3

cd "%switchBckupDefStmPath%"
if not exist %swStmVer% goto autoStmSwitchWarn4

rd /S /Q "%switchBckupDefGOGPath%"
xcopy /E /I "%gdDefSavePath%" "%switchBckupDefGOGPath%"

cd "%switchBckupDefGOGPath2%"
if exist GOGBackup_Switcher.zip del GOGBackup_Switcher.zip

cd "%myGamDefSavePath%"
powershell.exe -nologo -noprofile -command Compress-Archive -Path '%gdDefSavePath%' -DestinationPath '%switchBckupDefGOGPath2%\GOGBackup_Switcher'

rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefStmPath%" "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG backup successful.
echo    Steam backup restored and now ACTIVE!
echo.&pause

goto autoList

:autoStmSwitchWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Your Steam save is already ACTIVE! Operation Halted.
echo.&pause

goto autoList

:autoStmSwitchWarn2
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Neither Steam or GOG has been confirmed as active.
echo    You need to backup your saves on each platform
echo    first for Auto Switcher to work properly.
echo.&pause

goto autoList

:autoStmSwitchWarn3
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    A GOG backup folder has not been able to be
echo    confirmed. You need to backup your saves
echo    on each platform first for Auto Switcher
echo    to work properly.
echo.&pause

goto autoList

:autoStmSwitchWarn4
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    A Steam backup folder has not been able to be
echo    confirmed. You need to backup your saves
echo    on each platform first for Auto Switcher
echo    to work properly.
echo.&pause

goto autoList

:autoGogSwitch
cls&cd "%gdDefSavePath%"
if exist %swGOGVer% goto autoGogSwitchWarn
if not exist *.txt goto autoGogSwitchWarn2

cd "%switchBckupDefGOGPath%"
if not exist %swGOGVer% goto autoGogSwitchWarn3

cd "%switchBckupDefStmPath%"
if not exist %swStmVer% goto autoGogSwitchWarn4

rd /S /Q "%switchBckupDefStmPath%"
xcopy /E /I "%gdDefSavePath%" "%switchBckupDefStmPath%"

cls&cd "%switchBckupDefStmPath2%"
if exist SteamBackup_Switcher.zip del SteamBackup_Switcher.zip

cd "%myGamDefSavePath%"
powershell.exe -nologo -noprofile -command Compress-Archive -Path '%gdDefSavePath%' -DestinationPath '%switchBckupDefStmPath2%\SteamBackup_Switcher'

rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefGOGPath%" "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Steam backup successful.
echo    GOG backup restored and now ACTIVE!
echo.&pause

goto autoList

:autoGogSwitchWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Your GOG save is already ACTIVE! Operation Halted.
echo.&pause

goto autoList

:autoGogSwitchWarn2
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Neither Steam or GOG has been confirmed as active.
echo    You need to backup your saves on each platform
echo    first for Auto Switcher to work properly.
echo.&pause

goto autoList

:autoGogSwitchWarn3
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    A GOG backup folder has not been able to be
echo    confirmed. You need to backup your saves
echo    on each platform first for Auto Switcher
echo    to work properly.
echo.&pause

goto autoList

:autoGogSwitchWarn4
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    A Steam backup folder has not been able to be
echo    confirmed. You need to backup your saves
echo    on each platform first for Auto Switcher
echo    to work properly.
echo.&pause

goto autoList

rem
rem
rem Steam/GOG menu's functionality.
rem
rem

:stmBackup
cls&cd "%gdDefSavePath%"
if not exist *.txt goto stmBackup2
if exist %swStmVer% goto stmBackup2
if exist %swGOGVer% goto stmBackupWarn

:stmBackupUserIn
cls&cd "%gdDefSavePath%"
if exist %swGOGVer% goto stmBackupWarn

cd "%switchBckupDefStmPath2%"
if not exist SteamBackup_Switcher.zip goto stmBackupUserInWarn

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Creating a backup of the current backup..
echo    DO NOT use forward or backward slashes in name: \ , /
echo.

set INPUT= 
set /P INPUT=......Type name of your backup copy: %=%

cls&cd "%switchBckupDefStmPath2%"
copy "%switchBckupDefStmPath2%\SteamBackup_Switcher.zip" "%INPUT%.zip"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    %INPUT%.zip created in..
echo    %switchBckupDefStmPath2%
echo.&pause

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Check that your backup was created in the list..
echo.&dir *.zip /O:N&pause

goto stmGogList

:stmBackupUserInWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    SteamBackup_Switcher.zip does not exist.
echo    Create Steam Backup first!
echo.&pause

goto stmGogList

:stmBackup2
cd "%gdDefSavePath%"
@echo>"%gdDefSavePath%\%swStmVer%"
echo Auto Verify for Switcher > %swStmVer%

rd /S /Q "%switchBckupDefStmPath%" 
xcopy /E /I "%gdDefSavePath%" "%switchBckupDefStmPath%"

cls&cd "%switchBckupDefStmPath2%"
if exist SteamBackup_Switcher.zip del SteamBackup_Switcher.zip

cd "%myGamDefSavePath%"
powershell.exe -nologo -noprofile -command Compress-Archive -Path '%gdDefSavePath%' -DestinationPath '%switchBckupDefStmPath2%\SteamBackup_Switcher' -Force

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Steam backup successful...
echo.&pause

goto stmGogList

:stmBackupWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Your GOG save is the ACTIVE save! Operation Halted.
echo.&pause

goto stmGogList

:stmRestore
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
%ech[%1] Restore Steam Default Backup
%ech[%2] Restore User-made Steam Backup
echo.

choice /C:12 /N /M ......

%ifErr% 2 goto stmRestore3
%ifErr% 1 goto stmRestore2

:stmRestore2
cls&rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefStmPath%" "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Steam backup restored and now ACTIVE!
echo.&pause

goto stmGogList

:stmRestore3
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo       Extracting user-made backup..
echo.

cd "%switchBckupDefStmPath2%"
dir *.zip /O:N

echo.
echo       Only type the file name, NOT the ".zip" extension!
echo.

set INPUT3= 
set /P INPUT3=......Type name: %=%

rd /S /Q "%switchBckupDefStmPath%"

powershell.exe -nologo -noprofile -command Expand-Archive -Path '%switchBckupDefStmPath2%\%INPUT3%.zip' -DestinationPath '%switchBckupDefStmPath2%' -Force

%ifErr% 1 goto stmRestore3

rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefStmPath%" "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Steam backup restored and now ACTIVE!
echo.&pause

goto stmBackup2

:gogBackup
cls&cd "%gdDefSavePath%"
if not exist *.txt goto gogBackup2
if exist %swGOGVer% goto gogBackup2
if exist %swStmVer% goto gogBackupWarn

:gogBackupUserIn
cls&cd "%gdDefSavePath%"
if exist %swStmVer% goto gogBackupWarn

cd "%switchBckupDefGOGPath2%
if not exist GOGBackup_Switcher.zip goto gogBackupUserInWarn

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Creating a backup of the current default backup..
echo    Try to use normal letters and numbers when typing a name.
echo.

set INPUT= 
set /P INPUT=......Name your backup copy: %=%

cd "%switchBckupDefGOGPath2%"
copy "%switchBckupDefGOGPath2%\GOGBackup_Switcher.zip" "%INPUT%.zip"
%ifErr% 1 goto gogBackupUserIn

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    %INPUT%.zip created in..
echo    %switchBckupDefGOGPath2%
echo.&pause

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Check that your backup was created in the list..
echo.&dir *.zip /O:N&pause

goto stmGogList

:gogBackupUserInWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOGBackup_Switcher.zip does not exist.
echo    Create GOG Backup first!
echo.&pause

goto stmGogList

:gogBackup2
cls&cd "%gdDefSavePath%"
@echo>"%gdDefSavePath%\%swGOGVer%"
echo Auto Verify for Switcher > %swGOGVer%

rd /S /Q "%switchBckupDefGOGPath%"
xcopy /E /I "%gdDefSavePath%" "%switchBckupDefGOGPath%"

cls&cd "%switchBckupDefGOGPath2%"
if exist GOGBackup_Switcher.zip del GOGBackup_Switcher.zip

cd "%myGamDefSavePath%"
powershell.exe -nologo -noprofile -command Compress-Archive -Path '%gdDefSavePath%' -DestinationPath '%switchBckupDefGOGPath2%\GOGBackup_Switcher'

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG backup successful...
echo.&pause

goto stmGogList

:gogBackupWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Your Steam save is the ACTIVE save! Operation Halted.
echo.&pause

goto stmGogList

:gogRestore
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
%ech[%1] Restore GOG Default Backup
%ech[%2] Restore User-made GOG Backup
echo.

choice /C:12 /N /M ......

%ifErr% 2 goto gogRestore3
%ifErr% 1 goto gogRestore2

:gogRestore2
cls&rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefGOGPath%" "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG backup restored and now ACTIVE!
echo.&pause

goto stmGogList

:gogRestore3
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo       Extracting user-made backup..
echo.

cd "%switchBckupDefGOGPath2%"
dir *.zip /O:N

echo.
echo       Only type the file name, NOT the ".zip" extension!
echo.

set INPUT2= 
set /P INPUT2=......Type name: %=%

rd /S /Q "%switchBckupDefGOGPath%"

powershell.exe -nologo -noprofile -command Expand-Archive -Path '%switchBckupDefGOGPath2%\%INPUT2%.zip' -DestinationPath '%switchBckupDefGOGPath2%'

%ifErr% 1 goto gogRestore3

rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefGOGPath%" "%gdDefSavePath%"

goto gogBackup2

rem
rem
rem Handles deletions.
rem
rem

:delStm
cls&rd /S /Q "%switchBckupDefStmPath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Steam backup directory DELETED!
echo.&pause

goto delList

:delGog
cls&rd /S /Q "%switchBckupDefGOGPath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG backup directory DELETED!
echo.&pause

goto delList

:delVerify
cls&cd "%gdDefSavePath%"
del /Q %swStmVer%
del /Q %swGOGVer%

cd "%switchBckupDefStmPath%"
del /Q %swStmVer%

cd "%switchBckupDefGOGPath%"
del /Q %swGOGVer%

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    All Verification Files DELETED!
echo.&pause

goto delList

:delDef
cls&rd /S /Q "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Grim Dawn default save folder DELETED!
echo.&pause

goto delList

:delDefAll
cls&cd "%myGamDefSavePath%"
rd /S /Q "%gdDefSavePath%"

cd "%myGamDefSavePath%"
rd /S /Q "%switchBckupDefPath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    ALL default save and backup folders DELETED!
echo.&pause

goto delList

rem
rem
rem Calls Grim Dawn clients, performs autoswitching operations.
rem
rem

:callStmGD
cls&cd "%stmGDPath%"
if not exist "%gdEx%" goto callStmGDWarn

cd "%gdDefSavePath%"
if exist "%swStmVer%" goto callStmGD2
if exist "%swGOGVer%" goto callStmGD3
if not exist "%swGOGVer%" goto callStmGDNext

:callStmGDWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Cannot locate the Grim Dawn executable.
echo.&pause

goto mainList

:callStmGDNext
if not exist "%swStmVer%" goto callStmGD3NoActive

:callStmGD2
cls&cd "%stmGDPath%"
call "%gdEx%"

goto callStmGD4BackupList

:callStmGD3
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Your GOG Save is ACTIVE! Checking for
echo    Steam Backup...
echo.&pause

goto callStmGD3ChkBckupGogAct

:callStmGD3NoActive
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    No saves VERIFIED as ACTIVE! Checking for
echo    Steam Backup...
echo.&pause

:callStmGD3ChkBckup
cls&cd "%switchBckupDefStmPath%"
if exist "%swStmVer%" goto callStmGD3Restore
if not exist "%swStmVer%" goto callStmGD4

:callStmGD3ChkBckupGogAct
cls&cd "%switchBckupDefStmPath%"
if exist "%swStmVer%" goto callStmGD3RestoreStmAct
if not exist "%swStmVer%" goto callStmGD4

:callStmGD3Restore
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo     Steam Backup found! Restoring now...
echo.&pause

cls&cd "%myGamDefSavePath%"
rd /S /Q "%gdDefSavePath%"

cd "%myGamDefSavePath%"
xcopy /E /I "%switchBckupDefStmPath%" "%gdDefSavePath%"

goto callStmGD

:callStmGD3RestoreStmAct
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo     Steam Backup found! Restoring now...
echo.&pause

cls&cd "%switchBckupDefGOGPath2%"
rd /S /Q "%switchBckupDefGOGPath%"

cd "%myGamDefSavePath%"
xcopy /E /I "%gdDefSavePath%" "%switchBckupDefGOGPath%"

cd "%switchBckupDefGOGPath2%"
if exist GOGBackup_Switcher.zip del GOGBackup_Switcher.zip

cd "%myGamDefSavePath%"
powershell.exe -nologo -noprofile -command Compress-Archive -Path '%gdDefSavePath%' -DestinationPath '%switchBckupDefGOGPath2%\GOGBackup_Switcher'

rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefStmPath%" "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG Backup successful...
echo    Steam Backup restored!
echo.&pause

goto callStmGD2

:callStmGD4
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    No Verified backups exist! After game start
echo    please exit and create a Steam Backup.
echo.&pause

cls&cd "%myGamDefSavePath%"
rd /S /Q "%gdDefSavePath%"

goto callStmGD2

:callStmGD4BackupList
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
%ech[%1] Main Menu
%ech[%2] Create Steam Backup
echo.

choice /C:12 /N /M ......

%ifErr% 2 goto stmBackup
%ifErr% 1 goto mainList

:callGOGGD
cls&cd "%gogGDPath%"
if not exist "%gdEx%" goto callGOGGDWarn

cd "%gdDefSavePath%"
if exist "%swGOGVer%" goto callGOGGD2
if exist "%swStmVer%" goto callGOGGD3
if not exist "%swStmVer%" goto callGOGGDNext

:callGOGGDWarn
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Cannot locate the Grim Dawn executable.
echo.&pause

goto mainList

:callGOGGDNext
if not exist "%swGOGVer%" goto callGOGGD3NoActive

:callGOGGD2
cls&cd "%gogGDPath%"
call "%gdEx%"

goto callGOGGD4BckupList

:callGOGGD3
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Your Steam Save is ACTIVE! Checking for
echo    GOG Backup...
echo.&pause

goto callGOGGD3ChkBckupStmAct

:callGOGGD3NoActive
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    No saves VERIFIED as ACTIVE! Checking for
echo    GOG Backup...
echo.&pause

:callGOGGD3ChkBckup
cls&cd "%switchBckupDefGOGPath%"
if exist "%swGOGVer%" goto callGOGGD3Restore
if not exist "%swGOGVer%" goto callGOGGD4

:callGOGGD3ChkBckupStmAct
cls&cd "%switchBckupDefGOGPath%"
if exist "%swGOGVer%" goto callGOGGD3RestoreStmAct
if not exist "%swGOGVer%" goto callGOGGD4

:callGOGGD3Restore
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG Backup found! Restoring now...
echo.&pause

cls&cd "%myGamDefSavePath%"
rd /S /Q "%gdDefSavePath%"

cd "%myGamDefSavePath%"
xcopy /E /I "%switchBckupDefGOGPath%" "%gdDefSavePath%"

goto callGOGGD

:callGOGGD3RestoreStmAct
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    GOG Backup found! Restoring now...
echo.&pause

cls&cd "%switchBckupDefStmPath2%"
rd /S /Q "%switchBckupDefStmPath%"

cd "%myGamDefSavePath%"
xcopy /E /I "%gdDefSavePath%" "%switchBckupDefStmPath%"

cd "%switchBckupDefStmPath2%"
if exist SteamBackup_Switcher.zip del SteamBackup_Switcher.zip

cd "%myGamDefSavePath%"
powershell.exe -nologo -noprofile -command Compress-Archive -Path '%gdDefSavePath%' -DestinationPath '%switchBckupDefStmPath2%\SteamBackup_Switcher'

cd "%myGamDefSavePath%"
rd /S /Q "%gdDefSavePath%"
xcopy /E /I "%switchBckupDefGOGPath%" "%gdDefSavePath%"

cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    Steam Backup successful...
echo    GOG Backup restored!
echo.&pause

goto callGOGGD2

:callGOGGD4
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
echo    No Verified backups exist! After game start
echo    please exit and create a GOG Backup.
echo.&pause

cls&cd "%myGamDefSavePath%"
rd /S /Q "%gdDefSavePath%"

goto callGOGGD2

:callGOGGD4BckupList
cls&echo.&%switchDateVer%&echo.&%switchHeader%&echo.
%ech[%1] Main Menu
%ech[%2] Create GOG Backup
echo.

choice /C:12 /N /M ......

%ifErr% 2 goto gogBackup
%ifErr% 1 goto mainList

:endSwitch
exit
__________________
powbam is like a forum vulture, when he shows up, the thread is close to death. ~jiaco

Last edited by powbam; 05-26-2018 at 10:55 PM.
Reply With Quote
  #4  
Old 05-26-2018, 07:33 PM
powbam's Avatar
powbam powbam is offline
Praetorian
 
Join Date: Nov 2013
Posts: 6,326
Default

Switcher Updated. OP updated with relevant info.

Quote:
Originally Posted by powbam View Post
Current Version
ver.5-26-2018
  • Decided to add a "sort" of versioning. It's still based off the date and displays at the top of the script, ie. ver.5-26-2018. There is an option at the bottom of the Main Menu to bring you here to check the version.

  • Finished expanding the ability of the script to create .zip's whenever it makes a backup during any switching operation in the script. This means that when you use Auto Switcher or when you select Play Steam/GOG and it initiates an autoswitch it will also create a default backup .zip which is deleted and recreated everytime a backup occurs to keep it current. This default .zip file is what the "Create a backup of a backup" option in the Steam & GOG Menu pulls from when you use this option to create your own backups.

  • The Restore Steam/GOG Backup options in the Steam & GOG Menu now each bring you to a further sub menu where you can choose to either restore the current default backup OR you can choose to extract one of your User-made backups and restore it. Be mindful that doing so deletes (and replaces) the current default backup. If you don't want to lose it for good be sure to create a User-made backup of it first.
__________________
powbam is like a forum vulture, when he shows up, the thread is close to death. ~jiaco

Last edited by powbam; 05-26-2018 at 08:11 PM.
Reply With Quote
  #5  
Old 05-27-2018, 07:15 AM
GlockenGerda's Avatar
GlockenGerda GlockenGerda is offline
Counsel
 
Join Date: Dec 2015
Posts: 382
Default

Hi powbam,

I'm using the steam and gog version of the game, so your batch file could be handy for me! I'm testing it right now.

One note: the batch file don't find "grim dawn.exe" if the user had Grim Dawn installed in a different location than the batch file is assuming.

I had to edit line 18 and line 19 in your batch file.
Perhaps you should mention that in your description.
Or have I overlooked that?

Thank you!
Reply With Quote
  #6  
Old 05-27-2018, 08:21 AM
powbam's Avatar
powbam powbam is offline
Praetorian
 
Join Date: Nov 2013
Posts: 6,326
Default

Quote:
Originally Posted by GlockenGerda View Post
Hi powbam,

I'm using the steam and gog version of the game, so your batch file could be handy for me! I'm testing it right now.

One note: the batch file don't find "grim dawn.exe" if the user had Grim Dawn installed in a different location than the batch file is assuming.

I had to edit line 18 and line 19 in your batch file.
Perhaps you should mention that in your description.
Or have I overlooked that?

Thank you!
Hi Glocken.. yeah I have it only check for the default Steam/GOG install locations so if you custom install you'd have to edit that.

This is my first program or script or whatever you want to call it so you'll have to bear with me. And maybe backup your saves out of the way manually before letting me have my way with them, just in case. You are probably way more experienced at this stuff than I am

Thanks for the tip tho and I'll definitely try to look into doing something for those with custom paths.
__________________
powbam is like a forum vulture, when he shows up, the thread is close to death. ~jiaco

Last edited by powbam; 05-27-2018 at 08:23 AM.
Reply With Quote
Reply

Tags
fools, gd switcher, niche, tool

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Grim Dawn ©2018 Crate Entertainment, LLC.
vBulletin® 3.8.4 ©2000-2014, Jelsoft Enterprises Ltd.