Beispiel #1
0
        public async Task Execute()
        {
            var efiEspVolume = await phone.GetVolumeByPartitionName(PartitionName.EfiEsp);

            efiEspPath        = efiEspVolume.Root;
            destinationFolder = Path.Combine(efiEspVolume.Root, "Windows", "System32", "BOOT");
            bcdPath           = efiEspVolume.Root.CombineRelativeBcdPath();
            bcdInvoker        = bcdInvokerFactory.Create(bcdPath);

            var shouldInstall = !IsAlreadyInstalled();

            if (shouldInstall)
            {
                await CopyDevMenuFiles();
            }

            ConfigureBcd();

            if (shouldInstall)
            {
                await prompt.PickOptions(Resources.DeveloperMenuInstalled, new List <Option>()
                {
                    new Option("Continue", DialogValue.OK),
                });
            }
        }
        public async Task Execute()
        {
            var efiEsp = await phone.GetVolumeByPartitionName(PartitionName.EfiEsp);

            var bcdPath    = efiEsp.Root.CombineRelativeBcdPath();
            var bcdInvoker = bcdInvokerFactory.Create(bcdPath);

            new BcdConfigurator(bcdInvoker, efiEsp).SetupBcd();
        }
        public async Task <string> Replace(string str)
        {
            IDictionary <string, Func <Task <string> > > mappings = new Dictionary <string, Func <Task <string> > >()
            {
                { @"\[EFIESP\]", async() => (await phone.GetVolumeByPartitionName(PartitionName.EfiEsp)).Root },
                { @"\[DPP\]", async() => (await phone.GetVolumeByPartitionName(PartitionName.Dpp)).Root },
                { @"\[Windows\]", async() => (await phone.GetWindowsVolume()).Root },
                { @"\[System\]", async() => (await phone.GetSystemVolume()).Root },
            };

            foreach (var mapping in mappings)
            {
                if (Regex.IsMatch(str, mapping.Key))
                {
                    var mappingValue = await mapping.Value();

                    str = Regex.Replace(str, $"^{mapping.Key}", mappingValue, RegexOptions.IgnoreCase);
                    str = Regex.Replace(str, $@"\\+", @"\", RegexOptions.IgnoreCase);
                }
            }

            return(str);
        }