@@ -95,7 +95,13 @@ internal async Task<bool> RestoreBackup(int gameId, string installationDir)
9595 Process process = new Process ( ) ;
9696 ProcessShepherd . Instance . AddProcess ( process ) ;
9797 process . StartInfo = CreateProcessHeader ( ) ;
98- process . StartInfo . Arguments = $ "--config { AppFilePath . CloudSaveConfigDir } restore --force --path \" { extractFolder } \" ";
98+ //process.StartInfo.Arguments = $"--config {AppFilePath.CloudSaveConfigDir} restore --force --path \"{extractFolder}\"";
99+ process . StartInfo . ArgumentList . Add ( "--config" ) ;
100+ process . StartInfo . ArgumentList . Add ( AppFilePath . CloudSaveConfigDir ) ;
101+ process . StartInfo . ArgumentList . Add ( "restore" ) ;
102+ process . StartInfo . ArgumentList . Add ( "--force" ) ;
103+ process . StartInfo . ArgumentList . Add ( "--path" ) ;
104+ process . StartInfo . ArgumentList . Add ( extractFolder ) ;
99105 process . Start ( ) ;
100106 process . WaitForExit ( ) ;
101107 ProcessShepherd . Instance . RemoveProcess ( process ) ;
@@ -167,20 +173,20 @@ internal async Task BackupSaveGamesFromIds(List<int> gameIds)
167173 }
168174 internal async Task < bool > BackupSaveGame ( int gameId )
169175 {
170- if ( ! SettingsViewModel . Instance . License . IsActive ( ) )
176+ if ( ! SettingsViewModel . Instance . CloudSaves || ! SettingsViewModel . Instance . License . IsActive ( ) )
171177 return false ;
172178
173179 var installedGame = InstallViewModel . Instance ? . InstalledGames ? . FirstOrDefault ( g => g . Key ? . ID == gameId ) ;
174180 string gameMetadataTitle = installedGame ? . Key ? . Metadata ? . Title ?? "" ;
175181 string installationDir = installedGame ? . Value ?? "" ;
176182 if ( gameMetadataTitle != "" && installationDir != "" )
177183 {
184+ PrepareConfigFile ( installedGame ? . Value ! , Path . Combine ( AppFilePath . CloudSaveConfigDir , "config.yaml" ) ) ;
178185 string title = await SearchForLudusaviGameTitle ( gameMetadataTitle ) ;
179186 if ( string . IsNullOrEmpty ( title ) )
180187 return false ;
181188 string tempFolder = Path . Combine ( Path . GetTempPath ( ) , Guid . NewGuid ( ) . ToString ( ) ) ;
182189 Directory . CreateDirectory ( tempFolder ) ;
183- PrepareConfigFile ( installedGame ? . Value ! , Path . Combine ( AppFilePath . CloudSaveConfigDir , "config.yaml" ) ) ;
184190 await CreateBackup ( title , tempFolder ) ;
185191 string archive = Path . Combine ( tempFolder , "backup.zip" ) ;
186192 if ( Directory . GetFiles ( tempFolder , "mapping.yaml" , SearchOption . AllDirectories ) . Length == 0 )
@@ -266,7 +272,13 @@ internal async Task<string> SearchForLudusaviGameTitle(string title)
266272 Process process = new Process ( ) ;
267273 ProcessShepherd . Instance . AddProcess ( process ) ;
268274 process . StartInfo = CreateProcessHeader ( true ) ;
269- process . StartInfo . Arguments = $ "find \" { title } \" --fuzzy --api"; //--normalized
275+ //process.StartInfo.Arguments = $"find \"{title}\" --fuzzy --api";//--normalized
276+ process . StartInfo . ArgumentList . Add ( "--config" ) ;
277+ process . StartInfo . ArgumentList . Add ( AppFilePath . CloudSaveConfigDir ) ;
278+ process . StartInfo . ArgumentList . Add ( "find" ) ;
279+ process . StartInfo . ArgumentList . Add ( title ) ;
280+ process . StartInfo . ArgumentList . Add ( "--fuzzy" ) ;
281+ process . StartInfo . ArgumentList . Add ( "--api" ) ;
270282 process . EnableRaisingEvents = true ;
271283
272284 List < string > output = new List < string > ( ) ;
@@ -302,7 +314,17 @@ await Task.Run(() =>
302314 Process process = new Process ( ) ;
303315 ProcessShepherd . Instance . AddProcess ( process ) ;
304316 process . StartInfo = CreateProcessHeader ( ) ;
305- process . StartInfo . Arguments = $ "--config { AppFilePath . CloudSaveConfigDir } backup --force --format \" zip\" --path \" { tempFolder } \" \" { lunusaviTitle } \" ";
317+ //process.StartInfo.Arguments = $"--config {AppFilePath.CloudSaveConfigDir} backup --force --format \"zip\" --path \"{tempFolder}\" \"{lunusaviTitle}\"";
318+ process . StartInfo . ArgumentList . Add ( "--config" ) ;
319+ process . StartInfo . ArgumentList . Add ( AppFilePath . CloudSaveConfigDir ) ;
320+ process . StartInfo . ArgumentList . Add ( "backup" ) ;
321+ process . StartInfo . ArgumentList . Add ( "--force" ) ;
322+ process . StartInfo . ArgumentList . Add ( "--format" ) ;
323+ process . StartInfo . ArgumentList . Add ( "zip" ) ;
324+ process . StartInfo . ArgumentList . Add ( "--path" ) ;
325+ process . StartInfo . ArgumentList . Add ( tempFolder ) ;
326+ process . StartInfo . ArgumentList . Add ( lunusaviTitle ) ;
327+
306328 process . Start ( ) ;
307329 process . WaitForExit ( ) ;
308330 ProcessShepherd . Instance . RemoveProcess ( process ) ;
0 commit comments