public async Task ExtractToFolder(Stream stream, string folderPath)
        {
            var temp = FileUtils.GetTempDirectoryName();

            await Observable.Start(() =>
            {
                using (var zip = new ZipArchive(stream, ZipArchiveMode.Read, false))
                {
                    zip.ExtractToDirectory(temp);
                }
            });

            var folderName = Path.GetFileName(folderPath);

            if (fileSystemOperations.DirectoryExists(folderPath))
            {
                await fileSystemOperations.DeleteDirectory(folderPath);
            }

            var firstChild = Path.Combine(temp, folderName);

            await fileSystemOperations.CopyDirectory(firstChild, folderPath);

            await fileSystemOperations.DeleteDirectory(temp);
        }
Exemple #2
0
        public async Task Execute()
        {
            var efiespVolume = await phone.GetEfiespVolume();

            var rootDir    = efiespVolume.RootDir.Name;
            var bcdInvoker = bcdInvokerFactory.Create(Path.Combine(rootDir, "EFI", "Microsoft", "Boot", "BCD"));

            var destination = Path.Combine(rootDir, "Windows", "System32", "BOOT");
            await fileSystemOperations.CopyDirectory(Path.Combine(rootFilesPath), destination);

            var guid = FormattingUtils.GetGuid(bcdInvoker.Invoke(@"/create /d ""Developer Menu"" /application BOOTAPP"));

            bcdInvoker.Invoke($@"/set {{{guid}}} path \Windows\System32\BOOT\developermenu.efi");
            bcdInvoker.Invoke($@"/set {{{guid}}} device partition={rootDir}");
            bcdInvoker.Invoke($@"/set {{{guid}}} testsigning on");
            bcdInvoker.Invoke($@"/set {{{guid}}} nointegritychecks on");
            bcdInvoker.Invoke($@"/displayorder {{{guid}}} /addlast");
        }
Exemple #3
0
 private async Task CopyDevMenuFiles()
 {
     await fileSystemOperations.CopyDirectory(Path.Combine(rootFilesPath), destinationFolder);
 }
 protected override Task ExecuteCore()
 {
     return(fileSystemOperations.CopyDirectory(origin, destination));
 }
Exemple #5
0
 public Task Execute(string origin, string destination)
 {
     return(fileSystemOperations.CopyDirectory(origin, destination));
 }
 private async Task CopyDevMenuFiles(string mainOsPath)
 {
     var destinationFolder = Path.Combine(mainOsPath, PartitionName.EfiEsp, "Windows", "System32", "BOOT");
     await fileSystemOperations.CopyDirectory(Path.Combine(rootFilesPath), destinationFolder);
 }