Ejemplo n.º 1
0
        public HomeGenieService()
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
            EnableOutputRedirect();

            InitializeSystem();
            Reload();

            backupManager = new BackupManager(this);
            packageManager = new PackageManager(this);
            updateChecker = new UpdateChecker(this);
            updateChecker.ArchiveDownloadUpdate += (object sender, ArchiveDownloadEventArgs args) =>
            {
                RaiseEvent(
                    Domains.HomeGenie_System,
                    Domains.HomeGenie_UpdateChecker,
                    SourceModule.Master,
                    "HomeGenie Update Checker",
                    Properties.InstallProgressMessage,
                    "= " + args.Status + ": " + args.ReleaseInfo.DownloadUrl
                );
            };
            updateChecker.UpdateProgress += (object sender, UpdateProgressEventArgs args) =>
            {
                RaiseEvent(
                    Domains.HomeGenie_System,
                    Domains.HomeGenie_UpdateChecker,
                    SourceModule.Master,
                    "HomeGenie Update Checker",
                    Properties.InstallProgressUpdate,
                    args.Status.ToString()
                );
            };
            updateChecker.InstallProgressMessage += (object sender, string message) =>
            {
                RaiseEvent(
                    Domains.HomeGenie_System,
                    Domains.HomeGenie_UpdateChecker,
                    SourceModule.Master,
                    "HomeGenie Update Checker",
                    Properties.InstallProgressMessage,
                    message
                );
            };

            statisticsLogger = new StatisticsLogger(this);
            statisticsLogger.Start();

            // Setup local UPnP device
            SetupUpnp();

            // it will check every 24 hours
            updateChecker.Start();

            Thread.Sleep(5000);

            // this is a fix for upgrading from r522 to any new release as the SchedulerItem object has changed in r523
            // de-serializing new object will only work after HomeGenie.exe update and restart
            if (File.Exists("scheduler_update.xml"))
            {
                updateChecker.UpdateScheduler("scheduler_update.xml");
                File.Delete("scheduler_update.xml");
            }

            Start();
        }
Ejemplo n.º 2
0
        public HomeGenieService()
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
            EnableOutputRedirect();

            InitializeSystem();
            Reload();

            backupManager = new BackupManager(this);
            packageManager = new PackageManager(this);
            updateChecker = new UpdateChecker(this);
            updateChecker.ArchiveDownloadUpdate += (object sender, ArchiveDownloadEventArgs args) =>
            {
                RaiseEvent(
                    Domains.HomeGenie_System,
                    Domains.HomeGenie_UpdateChecker,
                    SourceModule.Master,
                    "HomeGenie Update Checker",
                    Properties.InstallProgressMessage,
                    "= " + args.Status + ": " + args.ReleaseInfo.DownloadUrl
                );
            };
            updateChecker.UpdateProgress += (object sender, UpdateProgressEventArgs args) =>
            {
                RaiseEvent(
                    Domains.HomeGenie_System,
                    Domains.HomeGenie_UpdateChecker,
                    SourceModule.Master,
                    "HomeGenie Update Checker",
                    Properties.InstallProgressUpdate,
                    args.Status.ToString()
                );
            };
            updateChecker.InstallProgressMessage += (object sender, string message) =>
            {
                RaiseEvent(
                    Domains.HomeGenie_System,
                    Domains.HomeGenie_UpdateChecker,
                    SourceModule.Master,
                    "HomeGenie Update Checker",
                    Properties.InstallProgressMessage,
                    message
                );
            };

            statisticsLogger = new StatisticsLogger(this);
            statisticsLogger.Start();

            // Setup local UPnP device
            SetupUpnp();

            // it will check every 24 hours
            updateChecker.Start();

            Thread.Sleep(5000);
            Start();
        }