Beispiel #1
0
        public static ActionResult UninstallDriver(Session session)
        {
            SetupApi.Log = msg => session.Log(msg);

            //MessageBox.Show($"Uninstall {infPath} {File.Exists(infPath)}");
            //return ActionResult.Success;
            var result = SetupApi.UninstallDevice(HardwareId);

            return(result ? ActionResult.Success : ActionResult.Failure);
        }
Beispiel #2
0
        public static ActionResult InstallDriver(Session session)
        {
            SetupApi.Log = msg => session.Log(msg);

            //MessageBox.Show($"Install {infPath} {File.Exists(infPath)}");
            //return ActionResult.Success;
            var installDir = session.CustomActionData["INSTALLDIR"];
            var infPath    = Path.Combine(installDir, @"Driver\Micser.Vac.Driver.inf");

            if (!File.Exists(infPath))
            {
                session.Log($"File '{infPath}' does not exist.");
                return(ActionResult.Failure);
            }

            var result = SetupApi.InstallDevice(infPath, HardwareId);

            return(result ? ActionResult.Success : ActionResult.Failure);
        }