private static void OnUpdate(dynamic data)
        {
            if (data.action == null)
            {
                return;
            }
            Log.Debug("User Service", data.ToString());

            if (!data.action.ToString().Equals("start"))
            {
                return;
            }

            if (Settings.OS == Settings.OSType.Windows)
            {
                UpdateWaiterHelper.SpawnUpdateWaiter(System.Reflection.Assembly.GetEntryAssembly().Location);
            }
            else if (Settings.OS == Settings.OSType.Mac)
            {
                UpdateWaiterHelper.SpawnUpdateWaiter("launchctl", "load -w /Library/LaunchAgents/org.freeghost.useragent.plist");
            }

            Power.Updating = true;
            Environment.Exit(0);
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            Log.Output   = Log.Mode.Quiet;
            Log.FilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".fog_user.log");
            Log.Output   = Log.Mode.File;

            AppDomain.CurrentDomain.UnhandledException += Log.UnhandledException;
            Eager.Initalize();

            if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "updating.info")))
            {
                Log.Entry(LogName, "Update.info found, exiting program");
                UpdateWaiterHelper.SpawnUpdateWaiter(Settings.Location);
                Environment.Exit(0);
            }

            _fogService = new FOGUserService();
            _fogService.Start();

            if (Settings.Get("Tray").Equals("1"))
            {
                StartTray();
            }
        }