ShareX/ShareX/Program.cs

675 lines
23 KiB
C#
Raw Normal View History

2013-11-03 23:53:49 +13:00
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
2016-01-04 04:16:01 +13:00
Copyright (c) 2007-2016 ShareX Team
2013-11-03 23:53:49 +13:00
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
2014-12-11 09:25:20 +13:00
using ShareX.HelpersLib;
using ShareX.Properties;
2014-12-11 12:19:28 +13:00
using ShareX.UploadersLib;
2013-11-03 23:53:49 +13:00
using System;
2016-06-25 03:33:45 +12:00
using System.Collections.Generic;
2013-11-03 23:53:49 +13:00
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace ShareX
{
internal static class Program
{
2015-09-12 12:09:05 +12:00
public static ShareXBuild Build
{
get
{
#if STEAM
2015-09-12 12:09:05 +12:00
return ShareXBuild.Steam;
#elif RELEASE
return ShareXBuild.Release;
#elif DEBUG
2015-09-12 12:09:05 +12:00
return ShareXBuild.Debug;
#else
return ShareXBuild.Unknown;
#endif
}
}
2014-09-14 01:50:44 +12:00
public static string Title
{
get
{
Version version = Version.Parse(Application.ProductVersion);
string title = string.Format("ShareX {0}.{1}", version.Major, version.Minor);
if (version.Build > 0) title += "." + version.Build;
2016-06-25 03:33:45 +12:00
if (version.Revision > 0) title += "." + version.Revision;
if (Portable) title += " Portable";
if (Beta) title += " Beta";
2014-09-14 01:50:44 +12:00
return title;
}
}
public static string TitleLong
{
get
{
2016-06-25 03:33:45 +12:00
return $"{Title} ({Build})";
}
}
public static bool Beta { get; } = true;
public static bool MultiInstance { get; private set; }
public static bool Portable { get; private set; }
public static bool PortableApps { get; private set; }
public static bool SilentRun { get; private set; }
public static bool Sandbox { get; private set; }
public static bool SteamFirstTimeConfig { get; private set; }
public static bool NoHotkeyMode { get; private set; }
public static bool PuushMode { get; private set; }
2014-09-14 01:50:44 +12:00
public static ApplicationConfig Settings { get; private set; }
public static TaskSettings DefaultTaskSettings { get; private set; }
public static UploadersConfig UploadersConfig { get; private set; }
public static HotkeysConfig HotkeysConfig { get; private set; }
public static ManualResetEvent UploaderSettingsResetEvent { get; private set; }
public static ManualResetEvent HotkeySettingsResetEvent { get; private set; }
public static MainForm MainForm { get; private set; }
public static Stopwatch StartTimer { get; private set; }
public static HotkeyManager HotkeyManager { get; set; }
public static WatchFolderManager WatchFolderManager { get; set; }
2016-06-25 03:33:45 +12:00
public static CLIManager CLI { get; private set; }
2014-09-14 01:50:44 +12:00
2015-10-27 15:03:24 +13:00
private static bool restarting;
private static FileSystemWatcher uploaderConfigWatcher;
private static WatchFolderDuplicateEventTimer uploaderConfigWatcherTimer;
2013-11-03 23:53:49 +13:00
2015-10-27 15:03:24 +13:00
#region Paths
2013-11-03 23:53:49 +13:00
private const string AppName = "ShareX";
private const string PersonalPathConfigFileName = "PersonalPath.cfg";
public static readonly string DefaultPersonalFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), AppName);
private static readonly string PortablePersonalFolder = Helpers.GetAbsolutePath(AppName);
private static readonly string PortableAppsPersonalFolder = Helpers.GetAbsolutePath("../../Data");
private static string PersonalPathConfigFilePath
{
get
{
string oldPath = Helpers.GetAbsolutePath(PersonalPathConfigFileName);
if (Portable || File.Exists(oldPath))
{
return oldPath;
}
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), AppName, PersonalPathConfigFileName);
}
}
2015-10-27 15:03:24 +13:00
private static readonly string PortableCheckFilePath = Helpers.GetAbsolutePath("Portable");
private static readonly string PortableAppsCheckFilePath = Helpers.GetAbsolutePath("PortableApps");
2015-10-27 15:03:24 +13:00
public static readonly string ChromeHostFilePath = Helpers.GetAbsolutePath("ShareX_Chrome.exe");
public static readonly string SteamInAppFilePath = Helpers.GetAbsolutePath("Steam");
2013-11-03 23:53:49 +13:00
2015-10-27 15:03:24 +13:00
private static string CustomPersonalPath { get; set; }
2013-11-03 23:53:49 +13:00
2015-10-27 15:03:24 +13:00
public static string PersonalFolder
2013-11-03 23:53:49 +13:00
{
get
{
2014-10-05 06:59:46 +13:00
if (!string.IsNullOrEmpty(CustomPersonalPath))
2013-11-03 23:53:49 +13:00
{
return Helpers.ExpandFolderVariables(CustomPersonalPath);
2013-11-03 23:53:49 +13:00
}
2015-10-27 15:03:24 +13:00
return DefaultPersonalFolder;
2013-11-03 23:53:49 +13:00
}
}
public static string ApplicationConfigFilePath
{
get
{
if (!Sandbox)
2013-11-03 23:53:49 +13:00
{
2015-10-27 15:03:24 +13:00
return Path.Combine(PersonalFolder, "ApplicationConfig.json");
2013-11-03 23:53:49 +13:00
}
return null;
}
}
public static string UploadersConfigFilePath
{
get
{
if (!Sandbox)
2013-11-03 23:53:49 +13:00
{
2015-10-27 15:03:24 +13:00
string uploadersConfigFolder;
2013-11-03 23:53:49 +13:00
2015-10-27 15:03:24 +13:00
if (Settings != null && !string.IsNullOrEmpty(Settings.CustomUploadersConfigPath))
{
uploadersConfigFolder = Helpers.ExpandFolderVariables(Settings.CustomUploadersConfigPath);
2015-10-27 15:03:24 +13:00
}
else
{
uploadersConfigFolder = PersonalFolder;
}
2013-11-03 23:53:49 +13:00
2015-10-27 15:03:24 +13:00
return Path.Combine(uploadersConfigFolder, "UploadersConfig.json");
2014-03-29 01:22:16 +13:00
}
2015-10-27 15:03:24 +13:00
return null;
2014-03-29 01:22:16 +13:00
}
}
2013-11-03 23:53:49 +13:00
public static string HotkeysConfigFilePath
{
get
{
if (!Sandbox)
2013-11-03 23:53:49 +13:00
{
2015-10-27 15:03:24 +13:00
string hotkeysConfigFolder;
if (Settings != null && !string.IsNullOrEmpty(Settings.CustomHotkeysConfigPath))
{
hotkeysConfigFolder = Helpers.ExpandFolderVariables(Settings.CustomHotkeysConfigPath);
2015-10-27 15:03:24 +13:00
}
else
{
hotkeysConfigFolder = PersonalFolder;
}
return Path.Combine(hotkeysConfigFolder, "HotkeysConfig.json");
2013-11-03 23:53:49 +13:00
}
return null;
}
}
public static string HistoryFilePath
{
get
{
if (!Sandbox)
2013-11-03 23:53:49 +13:00
{
2015-10-27 15:03:24 +13:00
return Path.Combine(PersonalFolder, "History.xml");
2013-11-03 23:53:49 +13:00
}
return null;
2013-11-03 23:53:49 +13:00
}
}
2016-02-10 14:13:40 +13:00
public static string LogsFolder => Path.Combine(PersonalFolder, "Logs");
2014-03-29 01:22:16 +13:00
public static string LogsFilePath
2013-11-03 23:53:49 +13:00
{
get
{
2015-10-27 15:03:24 +13:00
string filename = string.Format("ShareX-Log-{0:yyyy-MM}.txt", DateTime.Now);
2016-02-10 14:13:40 +13:00
return Path.Combine(LogsFolder, filename);
2013-11-03 23:53:49 +13:00
}
}
public static string ScreenshotsParentFolder
2013-11-03 23:53:49 +13:00
{
get
{
if (Settings != null && Settings.UseCustomScreenshotsPath && !string.IsNullOrEmpty(Settings.CustomScreenshotsPath))
{
return Helpers.ExpandFolderVariables(Settings.CustomScreenshotsPath);
2013-11-03 23:53:49 +13:00
}
2015-10-27 15:03:24 +13:00
return Path.Combine(PersonalFolder, "Screenshots");
2013-11-03 23:53:49 +13:00
}
}
public static string ScreenshotsFolder
2013-11-03 23:53:49 +13:00
{
get
{
string subFolderName = NameParser.Parse(NameParserType.FolderPath, Settings.SaveImageSubFolderPattern);
return Path.Combine(ScreenshotsParentFolder, subFolderName);
2013-11-03 23:53:49 +13:00
}
}
2016-02-10 14:13:40 +13:00
public static string BackupFolder => Path.Combine(PersonalFolder, "Backup");
public static string ToolsFolder => Path.Combine(PersonalFolder, "Tools");
public static string GreenshotImageEditorConfigFilePath => Path.Combine(PersonalFolder, "GreenshotImageEditor.ini");
2015-10-27 15:03:24 +13:00
public static string ScreenRecorderCacheFilePath => Path.Combine(PersonalFolder, "ScreenRecorder.avi");
public static string DefaultFFmpegFilePath => Path.Combine(ToolsFolder, "ffmpeg.exe");
public static string ChromeHostManifestFilePath => Path.Combine(ToolsFolder, "Chrome-host-manifest.json");
2015-10-01 23:28:08 +13:00
2013-11-03 23:53:49 +13:00
#endregion Paths
[STAThread]
private static void Main(string[] args)
{
Application.ThreadException += Application_ThreadException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
StartTimer = Stopwatch.StartNew(); // For be able to show startup time
2014-11-07 00:27:23 +13:00
CLI = new CLIManager(args);
2014-11-07 01:40:42 +13:00
CLI.ParseCommands();
2014-09-07 07:13:21 +12:00
2015-09-12 11:05:31 +12:00
#if STEAM
if (CheckUninstall()) return; // Steam will run ShareX with -Uninstall when uninstalling
#endif
2014-09-07 07:13:21 +12:00
if (CheckAdminTasks()) return; // If ShareX opened just for be able to execute task as Admin
UpdatePersonalPath();
DebugHelper.Init(LogsFilePath);
MultiInstance = CLI.IsCommandExist("multi", "m");
using (ApplicationInstanceManager instanceManager = new ApplicationInstanceManager(!MultiInstance, args, SingleInstanceCallback))
{
Run();
}
if (restarting)
{
Process.Start(Application.ExecutablePath);
}
2013-11-03 23:53:49 +13:00
}
private static void Run()
2013-11-03 23:53:49 +13:00
{
2014-10-05 06:59:46 +13:00
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
2016-06-25 03:33:45 +12:00
DebugHelper.WriteLine(Title);
DebugHelper.WriteLine("Build: " + Build);
DebugHelper.WriteLine("Command line: " + Environment.CommandLine);
DebugHelper.WriteLine("Personal path: " + PersonalFolder);
DebugHelper.WriteLine("Operating system: " + Helpers.GetWindowsProductName());
2016-06-25 03:33:45 +12:00
SilentRun = CLI.IsCommandExist("silent", "s");
2013-11-03 23:53:49 +13:00
2015-09-30 05:58:38 +13:00
#if STEAM
SteamFirstTimeConfig = CLI.IsCommandExist("SteamConfig");
2015-09-30 05:58:38 +13:00
#endif
NoHotkeyMode = CLI.IsCommandExist("NoHotkeys");
2015-09-11 12:45:40 +12:00
2016-06-25 03:33:45 +12:00
CheckPuushMode();
DebugWriteActiveFlags();
LoadProgramSettings();
2014-09-14 01:50:44 +12:00
UploaderSettingsResetEvent = new ManualResetEvent(false);
HotkeySettingsResetEvent = new ManualResetEvent(false);
2014-10-19 10:48:47 +13:00
TaskEx.Run(LoadSettings);
2013-11-03 23:53:49 +13:00
LanguageHelper.ChangeLanguage(Settings.Language);
2014-09-14 01:50:44 +12:00
DebugHelper.WriteLine("MainForm init started");
MainForm = new MainForm();
DebugHelper.WriteLine("MainForm init finished");
2013-11-03 23:53:49 +13:00
2014-09-14 01:50:44 +12:00
Application.Run(MainForm);
if (WatchFolderManager != null) WatchFolderManager.Dispose();
SaveAllSettings();
2014-09-14 01:50:44 +12:00
BackupSettings();
2015-10-10 10:12:10 +13:00
DebugHelper.Logger.Async = false;
2014-09-14 01:50:44 +12:00
DebugHelper.WriteLine("ShareX closing");
}
public static void Restart()
{
restarting = true;
Application.Exit();
}
2014-09-14 01:50:44 +12:00
private static void SingleInstanceCallback(object sender, InstanceCallbackEventArgs args)
{
if (WaitFormLoad(5000))
{
Action d = () =>
2013-11-03 23:53:49 +13:00
{
2014-09-14 01:50:44 +12:00
if (args.CommandLineArgs == null || args.CommandLineArgs.Length < 1)
{
if (MainForm.niTray != null && MainForm.niTray.Visible)
{
// Workaround for Windows startup tray icon bug
MainForm.niTray.Visible = false;
MainForm.niTray.Visible = true;
}
MainForm.ForceActivate();
2014-09-14 01:50:44 +12:00
}
else if (MainForm.Visible)
{
MainForm.ForceActivate();
2014-09-14 01:50:44 +12:00
}
2014-11-07 00:27:23 +13:00
CLIManager cli = new CLIManager(args.CommandLineArgs);
2014-11-07 01:40:42 +13:00
cli.ParseCommands();
2014-11-07 00:27:23 +13:00
MainForm.UseCommandLineArgs(cli.Commands);
2014-09-14 01:50:44 +12:00
};
MainForm.InvokeSafe(d);
}
}
2013-11-03 23:53:49 +13:00
2014-09-14 01:50:44 +12:00
private static bool WaitFormLoad(int wait)
{
Stopwatch timer = Stopwatch.StartNew();
2014-08-07 14:22:45 +12:00
2014-09-14 01:50:44 +12:00
while (timer.ElapsedMilliseconds < wait)
{
if (MainForm != null && MainForm.IsReady) return true;
2014-08-07 14:22:45 +12:00
2014-09-14 01:50:44 +12:00
Thread.Sleep(10);
2014-08-07 14:22:45 +12:00
}
2014-09-14 01:50:44 +12:00
return false;
}
2013-11-03 23:53:49 +13:00
public static void LoadSettings()
{
LoadUploadersConfig();
UploaderSettingsResetEvent.Set();
LoadHotkeySettings();
HotkeySettingsResetEvent.Set();
ConfigureUploadersConfigWatcher();
2013-11-03 23:53:49 +13:00
}
public static void LoadProgramSettings()
{
Settings = ApplicationConfig.Load(ApplicationConfigFilePath);
DefaultTaskSettings = Settings.DefaultTaskSettings;
}
public static void LoadUploadersConfig()
{
UploadersConfig = UploadersConfig.Load(UploadersConfigFilePath);
}
public static void LoadHotkeySettings()
{
HotkeysConfig = HotkeysConfig.Load(HotkeysConfigFilePath);
}
public static void LoadAllSettings()
{
LoadProgramSettings();
LoadUploadersConfig();
LoadHotkeySettings();
}
public static void SaveAllSettings()
2013-11-03 23:53:49 +13:00
{
if (Settings != null) Settings.Save(ApplicationConfigFilePath);
if (UploadersConfig != null) UploadersConfig.Save(UploadersConfigFilePath);
if (HotkeysConfig != null) HotkeysConfig.Save(HotkeysConfigFilePath);
}
public static void SaveAllSettingsAsync()
{
if (Settings != null) Settings.SaveAsync(ApplicationConfigFilePath);
UploadersConfigSaveAsync();
if (HotkeysConfig != null) HotkeysConfig.SaveAsync(HotkeysConfigFilePath);
}
2013-11-03 23:53:49 +13:00
public static void BackupSettings()
{
Helpers.BackupFileWeekly(ApplicationConfigFilePath, BackupFolder);
Helpers.BackupFileWeekly(HotkeysConfigFilePath, BackupFolder);
Helpers.BackupFileWeekly(UploadersConfigFilePath, BackupFolder);
Helpers.BackupFileWeekly(HistoryFilePath, BackupFolder);
}
private static void UpdatePersonalPath()
{
Sandbox = CLI.IsCommandExist("sandbox");
if (!Sandbox)
{
Portable = CLI.IsCommandExist("portable", "p");
if (Portable)
{
CustomPersonalPath = PortablePersonalFolder;
}
else
{
PortableApps = File.Exists(PortableAppsCheckFilePath);
Portable = PortableApps || File.Exists(PortableCheckFilePath);
CheckPersonalPathConfig();
}
if (!Directory.Exists(PersonalFolder))
{
try
{
Directory.CreateDirectory(PersonalFolder);
}
catch (Exception e)
{
MessageBox.Show(Resources.Program_Run_Unable_to_create_folder_ + string.Format(" \"{0}\"\r\n\r\n{1}", PersonalFolder, e),
"ShareX - " + Resources.Program_Run_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
CustomPersonalPath = "";
}
}
}
}
2013-11-03 23:53:49 +13:00
private static void CheckPersonalPathConfig()
{
string customPersonalPath = ReadPersonalPathConfig();
if (!string.IsNullOrEmpty(customPersonalPath))
{
2016-01-17 01:15:27 +13:00
customPersonalPath = Helpers.ExpandFolderVariables(customPersonalPath);
CustomPersonalPath = Helpers.GetAbsolutePath(customPersonalPath);
2015-10-27 15:03:24 +13:00
}
else if (PortableApps)
{
CustomPersonalPath = PortableAppsPersonalFolder;
}
else if (Portable)
2015-10-27 15:03:24 +13:00
{
CustomPersonalPath = PortablePersonalFolder;
}
}
public static string ReadPersonalPathConfig()
2013-11-03 23:53:49 +13:00
{
2015-10-27 15:03:24 +13:00
if (File.Exists(PersonalPathConfigFilePath))
2013-11-03 23:53:49 +13:00
{
2015-10-27 15:03:24 +13:00
return File.ReadAllText(PersonalPathConfigFilePath, Encoding.UTF8).Trim();
}
2013-11-03 23:53:49 +13:00
2016-05-25 06:15:45 +12:00
return "";
}
public static void WritePersonalPathConfig(string path)
{
if (path == null)
{
2016-05-25 06:15:45 +12:00
path = "";
}
else
{
path = path.Trim();
}
2015-10-27 15:03:24 +13:00
bool isDefaultPath = string.IsNullOrEmpty(path) && !File.Exists(PersonalPathConfigFilePath);
if (!isDefaultPath)
{
string currentPath = ReadPersonalPathConfig();
if (!path.Equals(currentPath, StringComparison.InvariantCultureIgnoreCase))
{
try
{
Helpers.CreateDirectoryFromFilePath(PersonalPathConfigFilePath);
2015-10-27 15:03:24 +13:00
File.WriteAllText(PersonalPathConfigFilePath, path, Encoding.UTF8);
}
catch (UnauthorizedAccessException)
{
2015-10-27 15:03:24 +13:00
MessageBox.Show(string.Format(Resources.Program_WritePersonalPathConfig_Cant_access_to_file, PersonalPathConfigFilePath),
"ShareX", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
2013-11-03 23:53:49 +13:00
}
}
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
OnError(e.Exception);
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
2013-11-03 23:53:49 +13:00
{
OnError((Exception)e.ExceptionObject);
}
private static void OnError(Exception e)
{
using (ErrorForm errorForm = new ErrorForm(e.Message, $"{e}\r\n\r\n{TitleLong}", LogsFilePath, Links.URL_ISSUES))
2013-11-03 23:53:49 +13:00
{
errorForm.ShowDialog();
}
}
public static void ConfigureUploadersConfigWatcher()
{
2014-10-19 10:48:47 +13:00
if (Settings.DetectUploaderConfigFileChanges && uploaderConfigWatcher == null)
{
2014-10-19 10:48:47 +13:00
uploaderConfigWatcher = new FileSystemWatcher(Path.GetDirectoryName(UploadersConfigFilePath), Path.GetFileName(UploadersConfigFilePath));
2014-04-16 07:30:46 +12:00
uploaderConfigWatcher.Changed += uploaderConfigWatcher_Changed;
2014-10-19 10:48:47 +13:00
uploaderConfigWatcherTimer = new WatchFolderDuplicateEventTimer(UploadersConfigFilePath);
2014-04-16 07:30:46 +12:00
uploaderConfigWatcher.EnableRaisingEvents = true;
}
2014-04-16 07:30:46 +12:00
else if (uploaderConfigWatcher != null)
{
2014-04-16 07:30:46 +12:00
uploaderConfigWatcher.Dispose();
uploaderConfigWatcher = null;
}
}
private static void uploaderConfigWatcher_Changed(object sender, FileSystemEventArgs e)
{
if (!uploaderConfigWatcherTimer.IsDuplicateEvent(e.FullPath))
{
2014-06-01 18:59:40 +12:00
Action onCompleted = () => ReloadUploadersConfig(e.FullPath);
Helpers.WaitWhileAsync(() => Helpers.IsFileLocked(e.FullPath), 250, 5000, onCompleted, 1000);
uploaderConfigWatcherTimer = new WatchFolderDuplicateEventTimer(e.FullPath);
}
}
private static void ReloadUploadersConfig(string filePath)
{
2014-06-01 18:59:40 +12:00
UploadersConfig = UploadersConfig.Load(filePath);
}
public static void UploadersConfigSaveAsync()
{
if (UploadersConfig != null)
{
if (uploaderConfigWatcher != null) uploaderConfigWatcher.EnableRaisingEvents = false;
TaskEx.Run(() =>
{
UploadersConfig.Save(UploadersConfigFilePath);
},
() =>
{
if (uploaderConfigWatcher != null) uploaderConfigWatcher.EnableRaisingEvents = true;
});
}
}
2014-09-07 07:13:21 +12:00
private static bool CheckAdminTasks()
{
2014-11-07 00:27:23 +13:00
if (CLI.IsCommandExist("dnschanger"))
2014-09-07 07:13:21 +12:00
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new DNSChangerForm());
return true;
}
return false;
}
2015-09-12 11:05:31 +12:00
private static bool CheckUninstall()
{
2015-09-12 11:38:10 +12:00
if (CLI.IsCommandExist("uninstall"))
2015-09-12 11:05:31 +12:00
{
try
{
IntegrationHelpers.Uninstall();
}
catch
{
}
return true;
}
return false;
}
2016-06-20 18:44:21 +12:00
private static bool CheckPuushMode()
{
string puushPath = Helpers.GetAbsolutePath("puush");
PuushMode = File.Exists(puushPath);
return PuushMode;
2016-06-20 18:44:21 +12:00
}
2016-06-25 03:33:45 +12:00
private static void DebugWriteActiveFlags()
{
List<string> flags = new List<string>();
if (Beta) flags.Add(nameof(Beta));
if (MultiInstance) flags.Add(nameof(MultiInstance));
if (Portable) flags.Add(nameof(Portable));
if (PortableApps) flags.Add(nameof(PortableApps));
if (SilentRun) flags.Add(nameof(SilentRun));
if (Sandbox) flags.Add(nameof(Sandbox));
if (SteamFirstTimeConfig) flags.Add(nameof(SteamFirstTimeConfig));
if (NoHotkeyMode) flags.Add(nameof(NoHotkeyMode));
if (PuushMode) flags.Add(nameof(PuushMode));
2016-06-25 03:33:45 +12:00
string output = string.Join(", ", flags);
if (!string.IsNullOrEmpty(output))
{
DebugHelper.WriteLine("Active flags: " + output);
}
}
2013-11-03 23:53:49 +13:00
}
}