diff --git a/functions/ToolScripts/emuDeckSaveSync.ps1 b/functions/ToolScripts/emuDeckSaveSync.ps1 index 80aadf3d..a3c91c62 100644 --- a/functions/ToolScripts/emuDeckSaveSync.ps1 +++ b/functions/ToolScripts/emuDeckSaveSync.ps1 @@ -160,6 +160,15 @@ $scriptContent = @" function cloud_sync_install($cloud_sync_provider){ #startLog($MyInvocation.MyCommand.Name) + $batFilePath = "$env:APPDATA\EmuDeck\backend\tools\cloudSync\cloud_sync_force.bat" + $shortcutPath = "$env:USERPROFILE\Desktop\Force CloudSync.lnk" + $iconPath = "$env:USERPROFILE/AppData/Local/Programs/EmuDeck/EmuDeck.exe" + $wshShell = New-Object -ComObject WScript.Shell + $shortcut = $wshShell.CreateShortcut($shortcutPath) + $shortcut.TargetPath = $batFilePath + $shortcut.IconLocation = $iconPath + $shortcut.Save() + confirmDialog -TitleText "Administrator Privileges needed" -MessageText "During the installation of CloudSync you'll get several windows asking for elevated permissions. This is so we can create symlinks, a background service and set its proper permissions. Please accept all of them" @@ -616,7 +625,7 @@ function cloud_sync_downloadEmu($emuName, $mode){ if (Test-Path "$cloud_sync_bin") { #We check for internet connection if ( check_internet_connection -eq 'true' ){ - + Stop-Process -Name "Rclone" -Force -ErrorAction SilentlyContinue #Do we have a pending upload? if (Test-Path "$savesPath/$emuName/.pending_upload") { @@ -700,6 +709,7 @@ function cloud_sync_uploadEmu{ if (Test-Path "$cloud_sync_bin") { #We check for internet connection if ( check_internet_connection -eq 'true' ){ + Stop-Process -Name "Rclone" -Force -ErrorAction SilentlyContinue #Do we have a failed download? if (Test-Path "$savesPath/$emuName/.fail_upload") { $date = Get-Content "$savesPath/$emuName/.fail_upload" diff --git a/functions/cloudSyncHealth.ps1 b/functions/cloudSyncHealth.ps1 index a19ac8c7..6b5e4c8b 100644 --- a/functions/cloudSyncHealth.ps1 +++ b/functions/cloudSyncHealth.ps1 @@ -1,84 +1,137 @@ -function cloud_sync_download_test($emuName){ - if ((Test-Path "$cloud_sync_bin") -and ($cloud_sync_status -eq $true)) { - - $target = "$emulationPath\saves\$emuName\" - if ( Test-Path "$target" ){ - "test" | Set-Content "$target\.temp" -ErrorAction SilentlyContinue -Encoding UTF8 - $fileHash = "$target\.temp" - - - & $cloud_sync_bin -q --log-file "$userFolder/EmuDeck/logs/rclone.log" copyto --fast-list --checkers=50 --transfers=50 --low-level-retries 1 --retries 1 "$cloud_sync_provider`:Emudeck\saves\$emuName\.temp" "$fileHash" - if ($?) { - echo "$elemento download Status: Success" - }else{ - echo "$elemento download Status: Failure" - rm -fo -r "$target\.temp" -ErrorAction SilentlyContinue - exit - } - rm -fo -r "$target\.temp" -ErrorAction SilentlyContinue - } +function cloudSyncHealth(){ - } -} + Write-Host "