Пример #1
0
        public override void Commit(IDictionary savedState)
        {
            MDShowEventLog.Install();

            string   oldDirectory = Directory.GetCurrentDirectory();
            FileInfo fi           = new FileInfo(Assembly.GetExecutingAssembly().Location);

            Directory.SetCurrentDirectory(fi.Directory.FullName);

            try
            {
                RegisterCxpRtpFilters();
            }
            catch (DllNotFoundException)
            {
                RtlAwareMessageBox.Show(null, Strings.MissingCxpRtpFiltersError, Strings.FileNotFound,
                                        MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }

            try
            {
                RegisterScreenScraperFilter();
            }
            catch (DllNotFoundException)
            {
                RtlAwareMessageBox.Show(null, Strings.MissingScreenScraperFilterError, Strings.FileNotFound,
                                        MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
            }

            Directory.SetCurrentDirectory(oldDirectory);
        }
Пример #2
0
        public override void Install(IDictionary savedState)
        {
            // First, uninstall in case we weren't uninstalled cleanly before
            IDictionary state = new Hashtable();

            Uninstall(state);
            if (state.Count != 0)
            {
                Commit(state);
            }
            state = null;

            base.Install(savedState);

            MDShowEventLog.Install();

            string   oldDirectory = Directory.GetCurrentDirectory();
            FileInfo fi           = new FileInfo(Assembly.GetExecutingAssembly().Location);

            Directory.SetCurrentDirectory(fi.Directory.FullName);

            try
            {
                RegisterCxpRtpFilters();
            }
            catch (DllNotFoundException)
            {
                MessageBox.Show("Unable to find CxpRtpFilters.ax in the local directory.", "File not found");
            }

            try
            {
                RegisterScreenScraperFilter();
            }
            catch (DllNotFoundException)
            {
                MessageBox.Show("Unable to find ScreenScraperFilter.ax in the local directory.", "File not found");
            }

            Directory.SetCurrentDirectory(oldDirectory);
        }