Ejemplo n.º 1
0
        public static bool TurnOn()
        {
            DetectUnix();
            FileSystem.AppendDebug("Operating System: " + Environment.OSVersion.VersionString);
            FileSystem.AppendDebug("Product Version: " + mAppInfo.GetApplicationTitleFull());
            DialogResult configResult = DialogResult.OK;

            if (Directory.Exists(Path.Combine(Application.StartupPath, PortableRootFolder)))
            {
                AppConf.PreferSystemFolders = false;
                RootAppFolder    = PortableRootFolder;
                mProductName    += " Portable";
                mAppInfo.AppName = mProductName;
            }
            else
            {
                if (string.IsNullOrEmpty(Program.AppConf.RootDir))
                {
                    RootAppFolder = DefaultRootAppFolder;
                    ConfigWizard cw = new ConfigWizard(DefaultRootAppFolder);
                    configResult = cw.ShowDialog();
                    RunConfig    = true;
                }
                if (!string.IsNullOrEmpty(Program.AppConf.RootDir) && Directory.Exists(Program.AppConf.RootDir))
                {
                    RootAppFolder = Program.AppConf.RootDir;
                }
                else
                {
                    RootAppFolder = Program.AppConf.PreferSystemFolders ? zLocalAppDataFolder : DefaultRootAppFolder;
                }
            }
            if (configResult == DialogResult.OK)
            {
                FileSystem.AppendDebug("Config file: " + AppSettings.AppSettingsFile);
                FileSystem.AppendDebug(string.Format("Root Folder: {0}", AppConf.PreferSystemFolders ? zLocalAppDataFolder : RootAppFolder));
                FileSystem.AppendDebug("Initializing Default folder paths...");
                Program.InitializeDefaultFolderPaths(); // happens before XMLSettings is readed
            }
            mAppInfo.AppName = mProductName;
            return(configResult == DialogResult.OK);
        }
Ejemplo n.º 2
0
 private void tsmiPreferKnownFolders_Click(object sender, EventArgs e)
 {
     ConfigWizard cw = new ConfigWizard(Program.RootAppFolder);
     if (cw.ShowDialog() == DialogResult.OK)
     {
         tsmiPreferKnownFolders.Checked = cw.PreferSystemFolders;
         Program.InitializeDefaultFolderPaths();
     }
 }
Ejemplo n.º 3
0
        public static bool TurnOn()
        {
            DetectUnix();
            FileSystem.AppendDebug("Operating System: " + Environment.OSVersion.VersionString);
            FileSystem.AppendDebug("Product Version: " + mAppInfo.GetApplicationTitleFull());
            DialogResult configResult = DialogResult.OK;

            if (Directory.Exists(Path.Combine(Application.StartupPath, PortableRootFolder)))
            {
                AppConf.PreferSystemFolders = false;
                RootAppFolder = PortableRootFolder;
                mProductName += " Portable";
                mAppInfo.AppName = mProductName;
            }
            else
            {
                if (string.IsNullOrEmpty(Program.AppConf.RootDir))
                {
                    RootAppFolder = DefaultRootAppFolder;
                    ConfigWizard cw = new ConfigWizard(DefaultRootAppFolder);
                    configResult = cw.ShowDialog();
                    RunConfig = true;
                }
                if (!string.IsNullOrEmpty(Program.AppConf.RootDir) && Directory.Exists(Program.AppConf.RootDir))
                {
                    RootAppFolder = Program.AppConf.RootDir;
                }
                else
                {
                    RootAppFolder = Program.AppConf.PreferSystemFolders ? zLocalAppDataFolder : DefaultRootAppFolder;
                }
            }
            if (configResult == DialogResult.OK)
            {
                FileSystem.AppendDebug("Config file: " + AppSettings.AppSettingsFile);
                FileSystem.AppendDebug(string.Format("Root Folder: {0}", AppConf.PreferSystemFolders ? zLocalAppDataFolder : RootAppFolder));
                FileSystem.AppendDebug("Initializing Default folder paths...");
                Program.InitializeDefaultFolderPaths(); // happens before XMLSettings is readed
            }
            mAppInfo.AppName = mProductName;
            return configResult == DialogResult.OK;
        }