Exemple #1
0
 public InfWriter(DeviceItem deviceItem, DriverResource driverResource)
 {
     mDeviceItem = deviceItem;
     mDriverResource = driverResource;
 }
        private static void loadResourcesFromPath(string path)
        {
            // try loading resources from the working directory.
            try
            {

                if (!Directory.Exists(path)) return;

            #if DEBUG
                InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "loading resource(s) from {0}", path);
            #endif
                string[] files = Directory.GetFiles(path, "*.driver.resources");
                foreach (string file in files)
                {
                    DriverResource newDriverResource = new DriverResource(file);
                    if (!ResourceList.Add(newDriverResource))
                    {
            #if DEBUG
                        InfWizardStatus.Log(CategoryType.DriverResource,
                                            StatusType.Warning,
                                            "skipping duplicate driver resource {0} found in {1}",
                                            newDriverResource.DisplayName,
                                            file);
            #endif
                    }
                    else
                    {
                        InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "{0} loaded", newDriverResource.DisplayName);
                    }
                }
                if (ResourceList.Count > 0)
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "failed loading driver resources from working directory :{0}", ex.ToString());
            }
            return;
        }
        private void wizardPageFinished_ShowFromNext(object sender, EventArgs e)
        {
            rtfFinishedSatus.Clear();
            wizardPageFinishedEnable(false);
            labelInstallDriver.Image = null;
            labelInstallDriver.Text = "please wait..";
            mCurrentDriverResource = comboBoxDriverResource.SelectedItem as DriverResource;
            mCurrentInfWriter = new InfWriter(mCurrentDeviceItem, mCurrentDriverResource);

            Thread writeSetupThread = new Thread(writeSetupPackageFn);
            writeSetupThread.Start(null);
        }
        private static void loadResourcesFromAssembly(Assembly assembly)
        {
            // try loading resources from the executing assembly.
            try
            {
                string[] resourceNames = assembly.GetManifestResourceNames();

                foreach (string resourceName in resourceNames)
                {
                    if (resourceName.ToLower().EndsWith(".driver.resources"))
                    {
                        DriverResource newDriverResource = new DriverResource(assembly.GetManifestResourceStream(resourceName));
                        ResourceList.Add(newDriverResource);
                        InfWizardStatus.Log(CategoryType.DriverResource, StatusType.Info, "{0} loaded", newDriverResource.DisplayName);

                    }
                }
            }
            catch (Exception ex)
            {
                InfWizardStatus.Log(CategoryType.DriverResource,
                                    StatusType.Warning,
                                    "Failed loading driver resources from executing assembly: {0}",
                                    ex.Message);
            }
        }
Exemple #5
0
 public InfWriter(DeviceItem deviceItem, DriverResource driverResource)
 {
     mDeviceItem     = deviceItem;
     mDriverResource = driverResource;
 }