Esempio n. 1
0
 public static Task <bool> CopyUSMT()
 {
     return(Task.Run(async() => {
         Logger.Information("Uploading USMT to: " + CurrentTarget);
         try
         {
             if (!Directory.Exists(USMTPath))
             {
                 Logger.Warning("Could not find the USMT folder at: " + USMTPath + ".");
                 if (!await DownloadUSMTFromWeb())
                 {
                     return false;
                 }
             }
             if (FileOperations.CopyFolder(
                     USMTPath,
                     PayloadPathTarget
                     ))
             {
                 Logger.Success("USMT uploaded successfully.");
                 return true;
             }
             else
             {
                 Logger.Warning("USMT upload canceled.");
                 return false;
             }
         }
         catch (Exception e)
         {
             Logger.Exception(e, "Error uploading USMT to: " + CurrentTarget);
             return false;
         }
     }));
 }