From: <che...@us...> - 2009-11-15 02:27:20
|
Revision: 3151 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3151&view=rev Author: chef_koch Date: 2009-11-15 02:26:56 +0000 (Sun, 15 Nov 2009) Log Message: ----------- added new tool to view ir status in tray removed tray icon from configuration Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.exe.manifest trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Settings.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/IR Server Tray.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Resources/ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Resources/iconGray.ico trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Resources/iconGreen.ico Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Resources/iconGray.ico Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2009-11-13 12:21:41 UTC (rev 3150) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2009-11-15 02:26:56 UTC (rev 3151) @@ -323,30 +323,6 @@ #region Properties - public bool AbstractRemoteMode - { - get { return _abstractRemoteMode; } - set { _abstractRemoteMode = value; } - } - - public IRServerMode Mode - { - get { return _mode; } - set { _mode = value; } - } - - public string HostComputer - { - get { return _hostComputer; } - set { _hostComputer = value; } - } - - public string ProcessPriority - { - get { return _processPriority; } - set { _processPriority = value; } - } - public string[] PluginReceive { get @@ -430,6 +406,9 @@ { InitializeComponent(); + Settings.LoadSettings(); + LoadSettings(); + try { _transceivers = BasicFunctions.AvailablePlugins(); @@ -454,13 +433,12 @@ private void buttonOK_Click(object sender, EventArgs e) { - DialogResult = DialogResult.OK; + SaveSettings(); Close(); } private void buttonCancel_Click(object sender, EventArgs e) { - DialogResult = DialogResult.Cancel; Close(); } @@ -571,5 +549,52 @@ #endregion Controls + #region Settings + + private void LoadSettings() + { + _abstractRemoteMode = Settings.AbstractRemoteMode; + _mode = Settings.Mode; + _hostComputer = Settings.HostComputer; + _processPriority = Settings.ProcessPriority; + PluginReceive = Settings.PluginNameReceive; + PluginTransmit = Settings.PluginNameTransmit; + } + + private void SaveSettings() + { + if ((Settings.AbstractRemoteMode != _abstractRemoteMode) || + (Settings.Mode != _mode) || + (Settings.HostComputer != _hostComputer) || + (Settings.ProcessPriority != _processPriority) || + (Settings.PluginNameReceive != PluginReceive) || + (Settings.PluginNameTransmit != PluginTransmit)) + { + if ( + MessageBox.Show("IR Server will now be restarted for configuration changes to take effect", + "Restarting IR Server", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == + DialogResult.OK) + { + // Change settings ... + Settings.AbstractRemoteMode = _abstractRemoteMode; + Settings.Mode = _mode; + Settings.HostComputer = _hostComputer; + Settings.ProcessPriority = _processPriority; + Settings.PluginNameReceive = PluginReceive; + Settings.PluginNameTransmit = PluginTransmit; + + Settings.SaveSettings(); + + // Restart IR Server ... + Program.RestartIRS(); + } + else + { + IrssLog.Info("Canceled settings changes"); + } + } + } + + #endregion } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj 2009-11-13 12:21:41 UTC (rev 3150) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj 2009-11-15 02:26:56 UTC (rev 3151) @@ -39,6 +39,7 @@ <IsWebBootstrapper>false</IsWebBootstrapper> <UseApplicationTrust>false</UseApplicationTrust> <BootstrapperEnabled>true</BootstrapperEnabled> + <ApplicationManifest>IR Server Configuration.exe.manifest</ApplicationManifest> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -114,6 +115,7 @@ <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> + <Compile Include="Settings.cs" /> <EmbeddedResource Include="Advanced.resx"> <DependentUpon>Advanced.cs</DependentUpon> <SubType>Designer</SubType> @@ -149,15 +151,6 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <None Include="Resources\iconGreen.ico" /> - <None Include="Resources\IconGray.ico" /> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework Client Profile</ProductName> - <Install>false</Install> - </BootstrapperPackage> <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> <Visible>False</Visible> <ProductName>.NET Framework 2.0 %28x86%29</ProductName> @@ -179,6 +172,12 @@ <Install>false</Install> </BootstrapperPackage> </ItemGroup> + <ItemGroup> + <Content Include="Resources\iconGreen.ico" /> + </ItemGroup> + <ItemGroup> + <None Include="IR Server Configuration.exe.manifest" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.exe.manifest =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.exe.manifest (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.exe.manifest 2009-11-15 02:26:56 UTC (rev 3151) @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > + <assemblyIdentity name="IR Server Configuration" version="1.4.2.0" publicKeyToken="dc0b77bf2c754d95" processorArchitecture="msil" /> + <description>Configuration tool to change settings for IR Server.</description> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > + <assemblyIdentity name="IR Server Configuration" version="1.4.2.0" publicKeyToken="dc0b77bf2c754d95" processorArchitecture="msil" /> + <description>Configuration tool to change settings for IR Server.</description> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="requireAdministrator" uiAccess="false"></requestedExecutionLevel> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2009-11-13 12:21:41 UTC (rev 3150) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2009-11-15 02:26:56 UTC (rev 3151) @@ -90,11 +90,8 @@ internal const string ServerWindowName = "IRSS - " + ServerName; internal const string ServerDisplayName = "IR Server"; - private static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, @"IR Server\IR Server.xml"); internal static readonly string IRServerFile = Path.Combine(Common.FolderProgramFiles, @"IR Server.exe"); - internal static readonly Icon _iconGray = new Icon(Resources.iconGray, new Size(16, 16)); - internal static readonly Icon _iconGreen = new Icon(Resources.iconGreen, new Size(16, 16)); private static readonly TimeSpan defaultServiceTime = new TimeSpan(0, 0, 30); #endregion Constants @@ -107,9 +104,7 @@ private static string[] _pluginNameReceive; private static string _pluginNameTransmit; private static string _processPriority; - private static NotifyIcon _notifyIcon; private static bool _inConfiguration; - private static Thread thread; private static ServiceController serviceController; private static ServiceController[] serviceControllers; private static IntPtr irsWindow; @@ -128,45 +123,17 @@ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); - // allow only one application instance - if (IrssUtils.ProcessHelper.IsProcessAlreadyRunning()) + if (ProcessHelper.IsProcessAlreadyRunning()) return; IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open("IR Server Configuration.log"); - _notifyIcon = new NotifyIcon(); + Application.Run(new Config()); - _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); - _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripLabel(ServerDisplayName)); - _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripSeparator()); - _notifyIcon.ContextMenuStrip.Items.Add("&Setup", null, OpenConfiguration); - _notifyIcon.ContextMenuStrip.Items.Add("&Quit", null, ClickQuit); - _notifyIcon.DoubleClick += new EventHandler(OpenConfiguration); - _notifyIcon.Icon = new System.Drawing.Icon(Resources.iconGray, new System.Drawing.Size(16, 16)); - _notifyIcon.Text = ServerDisplayName; - _notifyIcon.Visible = true; - - thread = new Thread(new ThreadStart(UpdateIcon)); - thread.IsBackground = true; - thread.Start(); - - Application.Run(); - thread.Abort(); - _notifyIcon.Visible = false; - _notifyIcon = null; + IrssLog.Close(); } - private static void UpdateIcon() - { - while (thread != null && thread.IsAlive) - { - getStatus(); - _notifyIcon.Icon = getIcon(); - Thread.Sleep(1000); - } - } - internal static void getStatus() { _irsStatus = IrsStatus.NotRunning; @@ -191,260 +158,6 @@ catch { } } - private static Icon getIcon() - { - return (_irsStatus == IrsStatus.NotRunning) ? _iconGray : _iconGreen; - } - - private static void ClickQuit(object sender, EventArgs e) - { - Application.Exit(); - } - - private static void OpenConfiguration(object sender, EventArgs e) - { - if (_inConfiguration) - return; - - IrssLog.Info("Setup"); - - LoadSettings(); - - Config config = new Config(); - - config.AbstractRemoteMode = _abstractRemoteMode; - config.Mode = _mode; - config.HostComputer = _hostComputer; - config.ProcessPriority = _processPriority; - config.PluginReceive = _pluginNameReceive; - config.PluginTransmit = _pluginNameTransmit; - - _inConfiguration = true; - - if (config.ShowDialog() == DialogResult.OK) - { - if ((_abstractRemoteMode != config.AbstractRemoteMode) || - (_mode != config.Mode) || - (_hostComputer != config.HostComputer) || - (_processPriority != config.ProcessPriority) || - (_pluginNameReceive != config.PluginReceive) || - (_pluginNameTransmit != config.PluginTransmit)) - { - if ( - MessageBox.Show("IR Server will now be restarted for configuration changes to take effect", - "Restarting IR Server", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == - DialogResult.OK) - { - // Change settings ... - _abstractRemoteMode = config.AbstractRemoteMode; - _mode = config.Mode; - _hostComputer = config.HostComputer; - _processPriority = config.ProcessPriority; - _pluginNameReceive = config.PluginReceive; - _pluginNameTransmit = config.PluginTransmit; - - SaveSettings(); - - // Restart IR Server ... - RestartIRS(); - } - else - { - IrssLog.Info("Canceled settings changes"); - } - } - } - - _inConfiguration = false; - - IrssLog.Close(); - } - - private static void LoadSettings() - { - IrssLog.Info("Loading settings ..."); - - _abstractRemoteMode = true; - _mode = IRServerMode.ServerMode; - _hostComputer = String.Empty; - _processPriority = "No Change"; - _pluginNameReceive = null; - _pluginNameTransmit = String.Empty; - - XmlDocument doc = new XmlDocument(); - - try - { - doc.Load(ConfigurationFile); - } - catch (DirectoryNotFoundException) - { - IrssLog.Error("No configuration file found ({0}), folder not found! Creating default configuration file", - ConfigurationFile); - - Directory.CreateDirectory(Path.GetDirectoryName(ConfigurationFile)); - - CreateDefaultSettings(); - return; - } - catch (FileNotFoundException) - { - IrssLog.Warn("No configuration file found ({0}), creating default configuration file", ConfigurationFile); - - CreateDefaultSettings(); - return; - } - catch (Exception ex) - { - IrssLog.Error(ex); - return; - } - - try - { - _abstractRemoteMode = bool.Parse(doc.DocumentElement.Attributes["AbstractRemoteMode"].Value); - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } - - try - { - _mode = - (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } - - try - { - _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } - - try - { - _processPriority = doc.DocumentElement.Attributes["ProcessPriority"].Value; - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } - - try - { - _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } - - try - { - string receivers = doc.DocumentElement.Attributes["PluginReceive"].Value; - if (!String.IsNullOrEmpty(receivers)) - _pluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } - } - - private static void SaveSettings() - { - IrssLog.Info("Saving settings ..."); - - try - { - using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) - { - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("settings"); // <settings> - - writer.WriteAttributeString("AbstractRemoteMode", _abstractRemoteMode.ToString()); - writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); - writer.WriteAttributeString("HostComputer", _hostComputer); - writer.WriteAttributeString("ProcessPriority", _processPriority); - writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); - - if (_pluginNameReceive != null) - { - StringBuilder receivers = new StringBuilder(); - for (int index = 0; index < _pluginNameReceive.Length; index++) - { - receivers.Append(_pluginNameReceive[index]); - - if (index < _pluginNameReceive.Length - 1) - receivers.Append(','); - } - writer.WriteAttributeString("PluginReceive", receivers.ToString()); - } - else - { - writer.WriteAttributeString("PluginReceive", String.Empty); - } - - writer.WriteEndElement(); // </settings> - writer.WriteEndDocument(); - } - } - catch (Exception ex) - { - IrssLog.Error(ex); - } - } - - private static void CreateDefaultSettings() - { - try - { - string[] blasters = DetectBlasters(); - if (blasters == null) - _pluginNameTransmit = String.Empty; - else - _pluginNameTransmit = blasters[0]; - } - catch (Exception ex) - { - IrssLog.Error(ex); - _pluginNameTransmit = String.Empty; - } - - try - { - string[] receivers = DetectReceivers(); - if (receivers == null) - _pluginNameReceive = null; - else - _pluginNameReceive = receivers; - } - catch (Exception ex) - { - IrssLog.Error(ex); - _pluginNameReceive = null; - } - - try - { - SaveSettings(); - } - catch (Exception ex) - { - IrssLog.Error(ex); - } - } - private static ServiceController getServiceController() { serviceControllers = ServiceController.GetServices(); @@ -593,7 +306,7 @@ } } - private static void RestartIRS() + internal static void RestartIRS() { IrssLog.Info("Restarting IR Server"); Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.Designer.cs 2009-11-13 12:21:41 UTC (rev 3150) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.Designer.cs 2009-11-15 02:26:56 UTC (rev 3151) @@ -60,13 +60,6 @@ } } - internal static System.Drawing.Icon iconGray { - get { - object obj = ResourceManager.GetObject("iconGray", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - internal static System.Drawing.Icon iconGreen { get { object obj = ResourceManager.GetObject("iconGreen", resourceCulture); Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.resx 2009-11-13 12:21:41 UTC (rev 3150) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Properties/Resources.resx 2009-11-15 02:26:56 UTC (rev 3151) @@ -118,10 +118,7 @@ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> - <data name="iconGray" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>..\Resources\IconGray.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> - </data> <data name="iconGreen" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>..\Resources\iconGreen.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + <value>..\resources\icongreen.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> </root> \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Resources/iconGray.ico =================================================================== (Binary files differ) Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Settings.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Settings.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Settings.cs 2009-11-15 02:26:56 UTC (rev 3151) @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; +using IrssUtils; + +namespace IRServer.Configuration +{ + static class Settings + { + private static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, @"IR Server\IR Server.xml"); + + public static bool AbstractRemoteMode { get; set; } + public static IRServerMode Mode { get; set; } + public static string HostComputer { get; set; } + public static string ProcessPriority { get; set; } + public static string[] PluginNameReceive { get; set; } + public static string PluginNameTransmit { get; set; } + + public static void LoadSettings() + { + IrssLog.Info("Loading settings ..."); + + AbstractRemoteMode = true; + Mode = IRServerMode.ServerMode; + HostComputer = String.Empty; + ProcessPriority = "No Change"; + PluginNameReceive = null; + PluginNameTransmit = String.Empty; + + XmlDocument doc = new XmlDocument(); + + try + { + doc.Load(ConfigurationFile); + } + catch (DirectoryNotFoundException) + { + IrssLog.Error("No configuration file found ({0}), folder not found! Creating default configuration file", + ConfigurationFile); + + Directory.CreateDirectory(Path.GetDirectoryName(ConfigurationFile)); + + CreateDefaultSettings(); + return; + } + catch (FileNotFoundException) + { + IrssLog.Warn("No configuration file found ({0}), creating default configuration file", ConfigurationFile); + + CreateDefaultSettings(); + return; + } + catch (Exception ex) + { + IrssLog.Error(ex); + return; + } + + try + { + AbstractRemoteMode = bool.Parse(doc.DocumentElement.Attributes["AbstractRemoteMode"].Value); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + + try + { + Mode = + (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + + try + { + HostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + + try + { + ProcessPriority = doc.DocumentElement.Attributes["ProcessPriority"].Value; + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + + try + { + PluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + + try + { + string receivers = doc.DocumentElement.Attributes["PluginReceive"].Value; + if (!String.IsNullOrEmpty(receivers)) + PluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + } + + public static void SaveSettings() + { + IrssLog.Info("Saving settings ..."); + + try + { + using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("AbstractRemoteMode", AbstractRemoteMode.ToString()); + writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), Mode)); + writer.WriteAttributeString("HostComputer", HostComputer); + writer.WriteAttributeString("ProcessPriority", ProcessPriority); + writer.WriteAttributeString("PluginTransmit", PluginNameTransmit); + + if (PluginNameReceive != null) + { + StringBuilder receivers = new StringBuilder(); + for (int index = 0; index < PluginNameReceive.Length; index++) + { + receivers.Append(PluginNameReceive[index]); + + if (index < PluginNameReceive.Length - 1) + receivers.Append(','); + } + writer.WriteAttributeString("PluginReceive", receivers.ToString()); + } + else + { + writer.WriteAttributeString("PluginReceive", String.Empty); + } + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + } + } + catch (Exception ex) + { + IrssLog.Error(ex); + } + } + + private static void CreateDefaultSettings() + { + try + { + string[] blasters = Program.DetectBlasters(); + if (blasters == null) + PluginNameTransmit = String.Empty; + else + PluginNameTransmit = blasters[0]; + } + catch (Exception ex) + { + IrssLog.Error(ex); + PluginNameTransmit = String.Empty; + } + + try + { + string[] receivers = Program.DetectReceivers(); + if (receivers == null) + PluginNameReceive = null; + else + PluginNameReceive = receivers; + } + catch (Exception ex) + { + IrssLog.Error(ex); + PluginNameReceive = null; + } + + try + { + SaveSettings(); + } + catch (Exception ex) + { + IrssLog.Error(ex); + } + } + } +} \ No newline at end of file Property changes on: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/IR Server Tray.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/IR Server Tray.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/IR Server Tray.csproj 2009-11-15 02:26:56 UTC (rev 3151) @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{5C0DF76E-D1AE-4161-B8D1-843925C8AB58}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>IRServer.Tray</RootNamespace> + <AssemblyName>IR Server Tray</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <StartupObject>IRServer.Tray.Program</StartupObject> + <ApplicationIcon>Resources\iconGreen.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <PlatformTarget>x86</PlatformTarget> + <OutputPath>bin\Debug\</OutputPath> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <PlatformTarget>x86</PlatformTarget> + <OutputPath>bin\Release\</OutputPath> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.ServiceProcess" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> + </EmbeddedResource> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Resources.resx</DependentUpon> + <DesignTime>True</DesignTime> + </Compile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Content Include="Resources\iconGray.ico" /> + <Content Include="Resources\iconGreen.ico" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs 2009-11-15 02:26:56 UTC (rev 3151) @@ -0,0 +1,204 @@ +using System; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.ServiceProcess; +using System.Threading; +using System.Windows.Forms; +using IRServer.Tray.Properties; +using IrssUtils; + +namespace IRServer.Tray +{ + #region Enumerations + + /// <summary> + /// Describes the operation mode of IR Server. + /// </summary> + internal enum IRServerMode + { + /// <summary> + /// Acts as a standard Server (Default). + /// </summary> + ServerMode = 0, + /// <summary> + /// Relays button presses to another IR Server. + /// </summary> + RelayMode = 1, + /// <summary> + /// Acts as a repeater for another IR Server's blasting. + /// </summary> + RepeaterMode = 2, + } + + /// <summary> + /// Describes the actual status of IR Server + /// </summary> + internal enum IrsStatus + { + /// <summary> + /// IR Server is not running. + /// </summary> + NotRunning, + /// <summary> + /// IR Server is running as Service. + /// </summary> + RunningService, + /// <summary> + /// IR Server is running as Application. + /// </summary> + RunningApplication + } + + #endregion Enumerations + + static class Program + { + #region Constants + + internal const string ServerName = "IRServer"; + internal const string ServerWindowName = "IRSS - " + ServerName; + internal const string ServerDisplayName = "IR Server"; + + private static readonly string _configExe = Path.Combine(Common.FolderProgramFiles, @"IR Server Configuration.exe"); + private static readonly string _translatorExe = Path.Combine(Common.FolderProgramFiles, @"Translator.exe"); + private static readonly string _debugClientExe = Path.Combine(Common.FolderProgramFiles, @"DebugClient.exe"); + + #endregion Constants + + #region Variables + + private static NotifyIcon _notifyIcon; + private static Thread thread; + + internal static readonly Icon _iconGray = new Icon(Resources.iconGray, new Size(16, 16)); + internal static readonly Icon _iconGreen = new Icon(Resources.iconGreen, new Size(16, 16)); + + private static ServiceController[] serviceControllers; + private static IntPtr irsWindow; + + internal static IrsStatus _irsStatus; + internal static bool _serviceInstalled; + + #endregion Variables + + /// <summary> + /// Der Haupteinstiegspunkt f\xFCr die Anwendung. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + + if (ProcessHelper.IsProcessAlreadyRunning()) + return; + + _notifyIcon = new NotifyIcon(); + _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); + _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripLabel("IR Server Tray")); + _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripSeparator()); + + _notifyIcon.ContextMenuStrip.Items.Add("&Configuration", GetExeIconAsImage(_configExe), ClickConfiguration); + + if (File.Exists(_translatorExe)) + _notifyIcon.ContextMenuStrip.Items.Add("&Translator", GetExeIconAsImage(_translatorExe), ClickTranslator); + + if (File.Exists(_debugClientExe)) + _notifyIcon.ContextMenuStrip.Items.Add("&Debug Client", GetExeIconAsImage(_debugClientExe), ClickDebugClient); + + _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripSeparator()); + _notifyIcon.ContextMenuStrip.Items.Add("&Exit", null, ClickExit); + //_notifyIcon.DoubleClick += new EventHandler(OpenConfiguration); + _notifyIcon.Icon = new System.Drawing.Icon(Resources.iconGray, new System.Drawing.Size(16, 16)); + _notifyIcon.Text = ServerDisplayName; + _notifyIcon.Visible = true; + + thread = new Thread(new ThreadStart(UpdateIcon)); + thread.IsBackground = true; + thread.Start(); + + Application.Run(); + thread.Abort(); + _notifyIcon.Visible = false; + _notifyIcon = null; + } + + #region EventHandler + + private static void ClickConfiguration(object sender, EventArgs e) + { + Process.Start(_configExe); + } + + private static void ClickTranslator(object sender, EventArgs e) + { + Process.Start(_translatorExe); + } + + private static void ClickDebugClient(object sender, EventArgs e) + { + Process.Start(_debugClientExe); + } + + private static void ClickExit(object sender, EventArgs e) + { + Application.Exit(); + } + + #endregion + + #region Update IR Server Status + + private static void UpdateIcon() + { + while (thread != null && thread.IsAlive) + { + getStatus(); + _notifyIcon.Icon = getIcon(); + Thread.Sleep(1000); + } + } + + internal static void getStatus() + { + _irsStatus = IrsStatus.NotRunning; + _serviceInstalled = false; + serviceControllers = ServiceController.GetServices(); + foreach (ServiceController serviceController in serviceControllers) + { + if (serviceController.ServiceName == ServerName) + { + _serviceInstalled = true; + if (serviceController.Status == ServiceControllerStatus.Running) + _irsStatus = IrsStatus.RunningService; + } + } + + try + { + irsWindow = Win32.FindWindowByTitle(ServerWindowName); + if (irsWindow != IntPtr.Zero) + _irsStatus = IrsStatus.RunningApplication; + } + catch { } + } + + private static Icon getIcon() + { + return (_irsStatus == IrsStatus.NotRunning) ? _iconGray : _iconGreen; + } + + #endregion + + private static Image GetExeIconAsImage(string filepath) + { + if (filepath == null) return null; + + Icon icon = Icon.ExtractAssociatedIcon(filepath); + if (icon == null) return null; + + return icon.ToBitmap(); + } + } +} Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/AssemblyInfo.cs 2009-11-15 02:26:56 UTC (rev 3151) @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen �ber eine Assembly werden �ber die folgenden +// Attribute gesteuert. �ndern Sie diese Attributwerte, um die Informationen zu �ndern, +// die mit einer Assembly verkn�pft sind. +[assembly: AssemblyTitle("IR Server Tray")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IR Server Tray")] +[assembly: AssemblyCopyright("Copyright � 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// f�r COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen m�ssen, legen Sie das ComVisible-Attribut f�r diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt f�r COM verf�gbar gemacht wird +[assembly: Guid("2d93c6b4-c2cd-4b91-a3da-421d4e3eb11a")] + +// Versionsinformationen f�r eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie k�nnen alle Werte angeben oder die standardm��igen Build- und Revisionsnummern +// �bernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.Designer.cs 2009-11-15 02:26:56 UTC (rev 3151) @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:2.0.50727.4927 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace IRServer.Tray.Properties { + using System; + + + /// <summary> + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// </summary> + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IRServer.Tray.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon iconGray { + get { + object obj = ResourceManager.GetObject("iconGray", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + internal static System.Drawing.Icon iconGreen { + get { + object obj = ResourceManager.GetObject("iconGreen", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Properties/Resources.resx 2009-11-15 02:26:56 UTC (rev 3151) @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="iconGray" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\icongray.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="iconGreen" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\resources\icongreen.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Resources/iconGray.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Resources/iconGray.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Resources/iconGreen.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Resources/iconGreen.ico ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Suite.sln 2009-11-13 12:21:41 UTC (rev 3150) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Suite.sln 2009-11-15 02:26:56 UTC (rev 3151) @@ -121,11 +121,13 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pinnacle Serial Receiver", "IR Server Plugins\Pinnacle Serial Receiver\Pinnacle Serial Receiver.csproj", "{EBFA0F67-1EB6-4282-8475-C397B9852B3F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FireDTV Receiver", "IR Server Plugins\FireDTV Receiver\FireDTV Receiver.csproj", "{D88EDBC1-D583-4149-9873-8239FA63F4FE}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR Server", "IR Server\IR Server\IR Server.csproj", "{46F1DB42-F082-4200-B939-6E4B72A8117C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR Server Configuration", "IR Server\IR Server Configuration\IR Server Configuration.csproj", "{1E84C2ED-92FC-43A4-9C12-374B3347F6D7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FireDTV Receiver", "IR Server Plugins\FireDTV Receiver\FireDTV Receiver.csproj", "{D88EDBC1-D583-4149-9873-8239FA63F4FE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR Server Tray", "IR Server\IR Server Tray\IR Server Tray.csproj", "{5C0DF76E-D1AE-4161-B8D1-843925C8AB58}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -575,6 +577,14 @@ {EBFA0F67-1EB6-4282-8475-C397B9852B3F}.Release|Any CPU.Build.0 = Release|Any CPU {EBFA0F67-1EB6-4282-8475-C397B9852B3F}.Release|x86.ActiveCfg = Release|x86 {EBFA0F67-1EB6-4282-8475-C397B9852B3F}.Release|x86.Build.0 = Release|x86 + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|x86.ActiveCfg = Debug|x86 + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|x86.Build.0 = Debug|x86 + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|Any CPU.Build.0 = Release|Any CPU + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|x86.ActiveCfg = Release|x86 + {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|x86.Build.0 = Release|x86 {46F1DB42-F082-4200-B939-6E4B72A8117C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {46F1DB42-F082-4200-B939-6E4B72A8117C}.Debug|Any CPU.Build.0 = Debug|Any CPU {46F1DB42-F082-4200-B939-6E4B72A8117C}.Debug|x86.ActiveCfg = Debug|x86 @@ -591,14 +601,14 @@ {1E84C2ED-92FC-43A4-9C12-374B3347F6D7}.Release|Any CPU.Build.0 = Release|Any CPU {1E84C2ED-92FC-43A4-9C12-374B3347F6D7}.Release|x86.ActiveCfg = Release|x86 {1E84C2ED-92FC-43A4-9C12-374B3347F6D7}.Release|x86.Build.0 = Release|x86 - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|x86.ActiveCfg = Debug|x86 - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Debug|x86.Build.0 = Debug|x86 - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|Any CPU.Build.0 = Release|Any CPU - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|x86.ActiveCfg = Release|x86 - {D88EDBC1-D583-4149-9873-8239FA63F4FE}.Release|x86.Build.0 = Release|x86 + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Debug|x86.ActiveCfg = Debug|x86 + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Debug|x86.Build.0 = Debug|x86 + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Release|Any CPU.Build.0 = Release|Any CPU + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Release|x86.ActiveCfg = Release|x86 + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -659,6 +669,7 @@ {28098574-D22E-457C-AFFA-560554499EAC} = {E757F80C-23C5-4AD6-B178-16799E337E03} {46F1DB42-F082-4200-B939-6E4B72A8117C} = {DEE5AAD1-0110-4681-8FF9-662CEA72FD94} {1E84C2ED-92FC-43A4-9C12-374B3347F6D7} = {DEE5AAD1-0110-4681-8FF9-662CEA72FD94} + {5C0DF76E-D1AE-4161-B8D1-843925C8AB58} = {DEE5AAD1-0110-4681-8FF9-662CEA72FD94} {21E04B17-D850-43E7-AAD3-876C0E062BDB} = {F0D3A774-FE5E-4419-B9B6-C11FF1C4BB50} {106A69D2-670C-4DE5-A81C-A3CD5D3F21EB} = {F0D3A774-FE5E-4419-B9B6-C11FF1C4BB50} {D1BAC7A9-FFB6-44BA-825F-32506831DC3D} = {F0D3A774-FE5E-4419-B9B6-C11FF1C4BB50} Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-11-13 12:21:41 UTC (rev 3150) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-11-15 02:26:56 UTC (rev 3151) @@ -359,6 +359,7 @@ ${StopService} "IRServer" ${KILLPROCESS} "IR Server.exe" ${KILLPROCESS} "IR Server Configuration.exe" + ${KILLPROCESS} "IR Server Tray.exe" ; Use the all users context SetShellVarContext all @@ -381,6 +382,9 @@ File "..\IR Server Suite\IR Server\SourceGrid\DevAge*" File "..\IR Server Suite\IR Server\SourceGrid\SourceGrid*" + ${LOG_TEXT} "INFO" "Installing IR Server Tray..." + File "..\IR Server Suite\IR Server\IR Server Tray\bin\${Build_Type}\IR Server Tray.*" + File "..\IR Server Suite\IR Server Plugins\IR Server Plugin Interface\bin\${Build_Type}\IRServerPluginInterface.*" ${LOG_TEXT} "INFO" "Installing IR Server Plugins..." @@ -435,6 +439,7 @@ ; Create start menu shortcut CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\IR Server Configuration.lnk" "$DIR_INSTALL\IR Server Configuration.exe" "" "$DIR_INSTALL\IR Server Configuration.exe" 0 + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\IR Server Tray.lnk" "$DIR_INSTALL\IR Server Tray.exe" "" "$DIR_INSTALL\IR Server Tray.exe" 0 ; Install Server/Service ${If} $ServerServiceMode == "IRServerAsApplication" @@ -444,7 +449,8 @@ ${LOG_TEXT} "INFO" "Installing IR Server as Service..." ExecWait '"$DIR_INSTALL\IR Server.exe" /install' ${EndIf} - !insertmacro SetAutoRun "IR Server Configuration" '"$DIR_INSTALL\IR Server Configuration.exe"' + ${LOG_TEXT} "INFO" "Adding IR Server Tray to Autostart..." + !insertmacro SetAutoRun "IR Server Tray" '"$DIR_INSTALL\IR Server Tray.exe"' ${MementoSectionEnd} !macro Remove_${SectionIRServer} @@ -452,15 +458,18 @@ ${StopService} "IRServer" ${KILLPROCESS} "IR Server.exe" ${KILLPROCESS} "IR Server Configuration.exe" + ${KILLPROCESS} "IR Server Tray.exe" ${LOG_TEXT} "INFO" "Removing IR Server from Autostart..." !insertmacro RemoveAutoRun "IR Server" ${LOG_TEXT} "INFO" "Uninstalling IR Server as Service..." ExecWait '"$DIR_INSTA... [truncated message content] |