Exemple #1
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new Settings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (Settings)obj;
     }
     String oldPath = this.settingObject.PlayerPath;
     // Recheck after installer update if auto config is not disabled
     if (!this.settingObject.DisableAutoConfig && PluginBase.MainForm.RefreshConfig)
     {
         this.settingObject.PlayerPath = null;
     }
     // Try to find player path from AppMan archive
     if (String.IsNullOrEmpty(this.settingObject.PlayerPath))
     {
         String appManDir = Path.Combine(PathHelper.BaseDir, @"Apps\flashsa");
         if (Directory.Exists(appManDir))
         {
             String[] exeFiles = Directory.GetFiles(appManDir, "*.exe", SearchOption.AllDirectories);
             foreach (String exeFile in exeFiles)
             {
                 this.settingObject.PlayerPath = exeFile;
             }
         }
     }
     // Try to find player path from: Tools/flexlibs/
     if (String.IsNullOrEmpty(this.settingObject.PlayerPath))
     {
         String playerPath11 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.0\win\FlashPlayerDebugger.exe");
         String playerPath111 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.1\win\FlashPlayerDebugger.exe");
         String playerPath112 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.2\win\FlashPlayerDebugger.exe");
         String playerPath113 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.3\win\FlashPlayerDebugger.exe");
         String playerPath114 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.4\win\FlashPlayerDebugger.exe");
         String playerPath115 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.5\win\FlashPlayerDebugger.exe");
         String playerPath116 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.6\win\FlashPlayerDebugger.exe");
         String playerPath117 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.7\win\FlashPlayerDebugger.exe");
         String playerPath118 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.8\win\FlashPlayerDebugger.exe");
         String playerPath119 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.9\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath119)) this.settingObject.PlayerPath = playerPath119;
         else if (File.Exists(playerPath118)) this.settingObject.PlayerPath = playerPath118;
         else if (File.Exists(playerPath117)) this.settingObject.PlayerPath = playerPath117;
         else if (File.Exists(playerPath116)) this.settingObject.PlayerPath = playerPath116;
         else if (File.Exists(playerPath115)) this.settingObject.PlayerPath = playerPath115;
         else if (File.Exists(playerPath114)) this.settingObject.PlayerPath = playerPath114;
         else if (File.Exists(playerPath113)) this.settingObject.PlayerPath = playerPath113;
         else if (File.Exists(playerPath112)) this.settingObject.PlayerPath = playerPath112;
         else if (File.Exists(playerPath111)) this.settingObject.PlayerPath = playerPath111;
         else if (File.Exists(playerPath11)) this.settingObject.PlayerPath = playerPath11;
     }
     // Try to find player path from: Tools/flexsdk/
     if (String.IsNullOrEmpty(this.settingObject.PlayerPath))
     {
         String playerPath10 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10\win\FlashPlayer.exe");
         String playerPath101 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10.1\win\FlashPlayerDebugger.exe");
         String playerPath102 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10.2\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath102)) this.settingObject.PlayerPath = playerPath102;
         else if (File.Exists(playerPath101)) this.settingObject.PlayerPath = playerPath101;
         else if (File.Exists(playerPath10)) this.settingObject.PlayerPath = playerPath10;
     }
     // Try to find player path from: FlexSDK
     if (String.IsNullOrEmpty(this.settingObject.PlayerPath))
     {
         String compiler = PluginBase.MainForm.ProcessArgString("$(CompilerPath)");
         String playerPath10 = Path.Combine(compiler, @"runtimes\player\10\win\FlashPlayer.exe");
         String playerPath101 = Path.Combine(compiler, @"runtimes\player\10.1\win\FlashPlayerDebugger.exe");
         String playerPath102 = Path.Combine(compiler, @"runtimes\player\10.2\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath102)) this.settingObject.PlayerPath = playerPath102;
         else if (File.Exists(playerPath101)) this.settingObject.PlayerPath = playerPath101;
         else if (File.Exists(playerPath10)) this.settingObject.PlayerPath = playerPath10;
     }
     // After detection, if the path is incorrect, keep old valid path or clear it
     if (this.settingObject.PlayerPath == null || !File.Exists(this.settingObject.PlayerPath))
     {
         if (!String.IsNullOrEmpty(oldPath) && File.Exists(oldPath)) this.settingObject.PlayerPath = oldPath;
         else this.settingObject.PlayerPath = String.Empty;
     }
 }
Exemple #2
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new Settings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (Settings)obj;
     }
     // Try to find player path from: Tools/flexsdk/
     if (this.settingObject.PlayerPath == null || this.settingObject.PlayerPath == String.Empty)
     {
         String playerPath10 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10\win\FlashPlayer.exe");
         String playerPath101 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10.1\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath101)) this.settingObject.PlayerPath = playerPath101;
         else if (File.Exists(playerPath10)) this.settingObject.PlayerPath = playerPath10;
     }
     // Try to find player path from: FlexSDK
     if (!this.settingObject.DisableAutoConfig && this.settingObject.PlayerPath == null || this.settingObject.PlayerPath == String.Empty)
     {
         String compiler = PluginBase.MainForm.ProcessArgString("$(CompilerPath)");
         String playerPath10 = Path.Combine(compiler, @"runtimes\player\10\win\FlashPlayer.exe");
         String playerPath101 = Path.Combine(compiler, @"runtimes\player\10.1\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath101)) this.settingObject.PlayerPath = playerPath101;
         else if (File.Exists(playerPath10)) this.settingObject.PlayerPath = playerPath10;
     }
 }
Exemple #3
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new Settings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (Settings)obj;
     }
     // Recheck after installer update if auto config is not disabled
     if (!this.settingObject.DisableAutoConfig && PluginBase.MainForm.RefreshConfig)
     {
         this.settingObject.PlayerPath = null;
     }
     // Try to find player path from: Tools/flexlibs/
     if (String.IsNullOrEmpty(this.settingObject.PlayerPath))
     {
         String playerPath11 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.0\win\FlashPlayerDebugger.exe");
         String playerPath111 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.1\win\FlashPlayerDebugger.exe");
         String playerPath112 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.2\win\FlashPlayerDebugger.exe");
         String playerPath113 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.3\win\FlashPlayerDebugger.exe");
         String playerPath114 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.4\win\FlashPlayerDebugger.exe");
         String playerPath115 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.5\win\FlashPlayerDebugger.exe");
         String playerPath116 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.6\win\FlashPlayerDebugger.exe");
         String playerPath117 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.7\win\FlashPlayerDebugger.exe");
         String playerPath118 = Path.Combine(PathHelper.ToolDir, @"flexlibs\runtimes\player\11.8\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath118)) this.settingObject.PlayerPath = playerPath118;
         else if (File.Exists(playerPath117)) this.settingObject.PlayerPath = playerPath117;
         else if (File.Exists(playerPath116)) this.settingObject.PlayerPath = playerPath116;
         else if (File.Exists(playerPath115)) this.settingObject.PlayerPath = playerPath115;
         else if (File.Exists(playerPath114)) this.settingObject.PlayerPath = playerPath114;
         else if (File.Exists(playerPath113)) this.settingObject.PlayerPath = playerPath113;
         else if (File.Exists(playerPath112)) this.settingObject.PlayerPath = playerPath112;
         else if (File.Exists(playerPath111)) this.settingObject.PlayerPath = playerPath111;
         else if (File.Exists(playerPath11)) this.settingObject.PlayerPath = playerPath11;
     }
     // Try to find player path from: Tools/flexsdk/
     if (String.IsNullOrEmpty(this.settingObject.PlayerPath))
     {
         String playerPath10 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10\win\FlashPlayer.exe");
         String playerPath101 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10.1\win\FlashPlayerDebugger.exe");
         String playerPath102 = Path.Combine(PathHelper.ToolDir, @"flexsdk\runtimes\player\10.2\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath102)) this.settingObject.PlayerPath = playerPath102;
         else if (File.Exists(playerPath101)) this.settingObject.PlayerPath = playerPath101;
         else if (File.Exists(playerPath10)) this.settingObject.PlayerPath = playerPath10;
     }
     // Try to find player path from: FlexSDK
     if (!this.settingObject.DisableAutoConfig && String.IsNullOrEmpty(this.settingObject.PlayerPath))
     {
         String compiler = PluginBase.MainForm.ProcessArgString("$(CompilerPath)");
         String playerPath10 = Path.Combine(compiler, @"runtimes\player\10\win\FlashPlayer.exe");
         String playerPath101 = Path.Combine(compiler, @"runtimes\player\10.1\win\FlashPlayerDebugger.exe");
         String playerPath102 = Path.Combine(compiler, @"runtimes\player\10.2\win\FlashPlayerDebugger.exe");
         if (File.Exists(playerPath102)) this.settingObject.PlayerPath = playerPath102;
         else if (File.Exists(playerPath101)) this.settingObject.PlayerPath = playerPath101;
         else if (File.Exists(playerPath10)) this.settingObject.PlayerPath = playerPath10;
     }
     // After detection, if the path is incorrect clear it
     if (this.settingObject.PlayerPath == null || !File.Exists(this.settingObject.PlayerPath))
     {
         this.settingObject.PlayerPath = String.Empty;
     }
 }