Beispiel #1
0
        static void Main(string[] args)
        {
            runOnce(); // Setup application icon for "Add remove programs"

            Application.ApplicationExit += new EventHandler(OnApplicationExit);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (args.Length > 1 && "reset".Equals(args[0]))
            {
                ReaderConfig config = ReaderConfig.getInstance();
                config.ContentPath     = args[1];
                config.PythonPath      = @"lib\WinPython\python\python.exe";
                config.PdfminerPath    = @"lib\WinPython\python\Scripts\pdf2txt.py";
                config.UseAdobeReader  = true;
                config.EnableOCR       = false;
                config.GhostscriptPath = @"lib\Ghostscript\bin\gswin32.exe";
                config.TesseractPath   = @"lib\Tesseract-ocr\tesseract.exe";
                config.DBPath          = @"Y:\rsdiconversion\db\ethesis2016.db3";
                config.StoragePath     = @"Y:\rsdiconversion\contents";
                config.SaveSettings();
            }

            Form mainForm = new MainForm();

            // Initialize PDF viewer component
            PdfReaderHelper.getInstance().init(ReaderConfig.getInstance().UseAdobeReader);

            // Map network drive
            DriveHelper.connectStorageDrive();

            // Start file monitor thread
            Thread readCDThread = new Thread(new ThreadStart(m.start));

            readCDThread.SetApartmentState(ApartmentState.STA);
            readCDThread.Start();

            Application.Run(mainForm);
        }