Beispiel #1
0
        public static ActionResult InstallSmartPrint(Session session)
        {
            session.Log("Custom action InstallPrinter - Start");

            try
            {
                PrintDriver.Install();
                PrintMonitor.Install();
                Spool.Restart();
            }
            catch (Exception ex)
            {
                session.Log("Custom action InstallPrinter - Exception: " + ex.Message);
                session.Log("Custom action InstallPrinter - Exit (Failure)");
                return(ActionResult.Failure);
            }
            session.Log("Custom action InstallPrinter - Exit (Success)");
            return(ActionResult.Success);
        }
Beispiel #2
0
        public static ActionResult UninstallSmartPrint(Session session)
        {
            session.Log("Custom action UninstallPrinter - Start");

            try
            {
                //  TODO: Find all SmartPrintDevices installed locally and delete them
                // Deleting PrintMonitor will remove all ports of that PrintMonitor type
                PrintMonitor.Uninstall();
                PrintDriver.Uninstall();
                Spool.Restart();
            }
            catch (Exception ex)
            {
                session.Log("Custom action UninstallPrinter - Exception: " + ex.Message);
                session.Log("Custom action UninstallPrinter - Exit (Failure)");
            }
            session.Log("Custom action UninstallPrinter - Exit (Success)");
            return(ActionResult.Success);
        }