From: <an...@us...> - 2008-03-11 03:30:04
|
Revision: 1444 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1444&view=rev Author: and-81 Date: 2008-03-10 20:29:59 -0700 (Mon, 10 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Keyboard Input Relay.csproj trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/KeyboardInputRelay.exe.manifest trunk/plugins/IR Server Suite/IR Server Suite.nsi trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Technotrend/ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Technotrend/Technotrend.xml Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi Modified: trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/Applications/HCW PVR Tuner/HCW PVR Tuner.csproj 2008-03-11 03:29:59 UTC (rev 1444) @@ -37,7 +37,7 @@ </ItemGroup> <ItemGroup> <Content Include="HcwPvrTuner.exe.manifest"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> <ItemGroup> Modified: trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Keyboard Input Relay.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Keyboard Input Relay.csproj 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Keyboard Input Relay.csproj 2008-03-11 03:29:59 UTC (rev 1444) @@ -70,6 +70,11 @@ <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <Content Include="KeyboardInputRelay.exe.manifest"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Content> + </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/Applications/Keyboard Input Relay/KeyboardInputRelay.exe.manifest =================================================================== --- trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/KeyboardInputRelay.exe.manifest (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/KeyboardInputRelay.exe.manifest 2008-03-11 03:29:59 UTC (rev 1444) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > + <assemblyIdentity version="1.0.4.2" processorArchitecture="X86" name="KeyboardInputRelay" type="win32" /> + <description>Relays keyboard input to the input service to use like remote button presses</description> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="requireAdministrator" /> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-11 03:29:59 UTC (rev 1444) @@ -105,6 +105,9 @@ #region Constructor + /// <summary> + /// Initializes a new instance of the <see cref="MainForm"/> class. + /// </summary> public MainForm() { InitializeComponent(); @@ -361,27 +364,28 @@ { if (MessageBox.Show(this, String.Format("Do you want to use the default settings for {0} ({1})?", progSettings.Name, programFile), "Default settings available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - List<ButtonMapping> mappings = LoadDefaultSettings(settingsFile); + AppProfile appProfile = LoadDefaultSettings(settingsFile); - if (mappings != null) + if (appProfile != null) { - progSettings.ButtonMappings.AddRange(mappings); + progSettings.ButtonMappings.AddRange(appProfile.ButtonMappings); RefreshButtonList(); } } } */ + } } - List<ButtonMapping> LoadDefaultSettings(string settingsFile) + AppProfile LoadDefaultSettings(string settingsFile) { try { - XmlSerializer reader = new XmlSerializer(typeof(List<ButtonMapping>)); + XmlSerializer reader = new XmlSerializer(typeof(AppProfile)); using (StreamReader file = new StreamReader(settingsFile)) - return (List<ButtonMapping>)reader.Deserialize(file); + return (AppProfile)reader.Deserialize(file); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-03-11 03:29:59 UTC (rev 1444) @@ -336,10 +336,10 @@ item.Tag = Menus.Power; listViewMenu.Items.Add(item); - //item = new ListViewItem(UITextAudio, 2); - //item.ToolTipText = DescAudio; - //item.Tag = Menus.Audio; - //listViewMenu.Items.Add(item); + item = new ListViewItem(UITextAudio, 2); + item.ToolTipText = DescAudio; + item.Tag = Menus.Audio; + listViewMenu.Items.Add(item); item = new ListViewItem(UITextEject, 3); item.ToolTipText = DescEject; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-03-11 03:29:59 UTC (rev 1444) @@ -47,6 +47,7 @@ static ClientMessageSink _handleMessage; static bool _inConfiguration; + static bool _menuFormVisible; static IRServerInfo _irServerInfo = new IRServerInfo(); @@ -79,7 +80,6 @@ static NotifyIcon _notifyIcon; static MainForm _mainForm; - static MenuForm _menuForm; static Client _client; static Configuration _config; static CopyDataWM _copyDataWM; @@ -133,7 +133,8 @@ IrssLog.Warn(String.Format("Failed to load configuration file ({0}), creating new configuration", ConfigFile)); _config = new Configuration(); } - + + /* foreach (ProgramSettings progSettings in _config.Programs) { AppProfile profile = new AppProfile(); @@ -145,21 +146,19 @@ AppProfile.Save(profile, "C:\\" + profile.Name + ".xml"); } + */ + // Setup the main form ... + _mainForm = new MainForm(); + // Setup notify icon ... _notifyIcon = new NotifyIcon(); - _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); + _notifyIcon.ContextMenuStrip = new ContextMenuStrip(_mainForm.Container); _notifyIcon.Icon = Properties.Resources.Icon16Connecting; _notifyIcon.Text = "Translator - Connecting ..."; _notifyIcon.DoubleClick += new EventHandler(ClickSetup); _notifyIcon.Visible = false; - // Setup the Translator Menu ... - _menuForm = new MenuForm(); - - // Setup the main form ... - _mainForm = new MainForm(); - // Start server communications ... bool clientStarted = false; @@ -321,7 +320,7 @@ { IrssLog.Info("Show OSD"); - if (_menuForm.Visible) + if (_menuFormVisible) { IrssLog.Info("OSD already visible"); } @@ -337,7 +336,12 @@ { try { - _menuForm.ShowDialog(); + _menuFormVisible = true; + + using (MenuForm menuForm = new MenuForm()) + menuForm.ShowDialog(); + + _menuFormVisible = false; } catch (Exception ex) { @@ -521,26 +525,26 @@ case "Volume Up": // TODO: Replace with Volume Commands Win32.SendWindowsMessage( - Win32.ForegroundWindow(), + Win32.GetDesktopWindowHandle(), (int)Win32.WindowsMessage.WM_APPCOMMAND, - (int)Win32.AppCommand.APPCOMMAND_VOLUME_UP, - 0); + 0, + 65536 * (int)Win32.AppCommand.APPCOMMAND_VOLUME_UP); break; case "Volume Down": Win32.SendWindowsMessage( - Win32.ForegroundWindow(), + Win32.GetDesktopWindowHandle(), (int)Win32.WindowsMessage.WM_APPCOMMAND, - (int)Win32.AppCommand.APPCOMMAND_VOLUME_DOWN, - 0); + 0, + 65536 * (int)Win32.AppCommand.APPCOMMAND_VOLUME_DOWN); break; case "Volume Mute": Win32.SendWindowsMessage( - Win32.ForegroundWindow(), + Win32.GetDesktopWindowHandle(), (int)Win32.WindowsMessage.WM_APPCOMMAND, - (int)Win32.AppCommand.APPCOMMAND_VOLUME_MUTE, - 0); + 0, + 65536 * (int)Win32.AppCommand.APPCOMMAND_VOLUME_MUTE); break; default: Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-03-11 03:29:59 UTC (rev 1444) @@ -158,10 +158,16 @@ /// </returns> public override bool Detect() { - InitDeviceList(); + try + { + InitDeviceList(); - if (_deviceList.Count != 0) - return true; + if (_deviceList.Count != 0) + return true; + } + catch + { + } return false; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2008-03-11 03:29:59 UTC (rev 1444) @@ -60,6 +60,7 @@ /// <summary> /// Detect the presence of this device. Devices that cannot be detected will always return false. + /// This method should not throw exceptions. /// </summary> /// <returns><c>true</c> if the device is present, otherwise <c>false</c>.</returns> public virtual bool Detect() { return false; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2008-03-11 03:29:59 UTC (rev 1444) @@ -243,17 +243,21 @@ /// </returns> public override bool Detect() { - LoadSettings(); + try + { + LoadSettings(); - if (Connect(_irTransServerAddress, _irTransServerPort)) - { - _socket.Close(); - return true; + if (Connect(_irTransServerAddress, _irTransServerPort)) + { + _socket.Close(); + return true; + } } - else + catch { - return false; } + + return false; } /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.cs 2008-03-11 03:29:59 UTC (rev 1444) @@ -7,10 +7,7 @@ using System.Drawing; using System.IO; using System.Runtime.InteropServices; -using System.Windows.Forms; -using Microsoft.Win32.SafeHandles; - namespace InputService.Plugin { @@ -22,11 +19,6 @@ #region Debug - static void xRemote(string deviceName, string code) - { - Console.WriteLine("Remote: {0}", code); - } - [STAThread] static void Main() { @@ -36,11 +28,12 @@ //c.Configure(null); - c.RemoteCallback += new RemoteHandler(xRemote); + //c.RemoteCallback += new RemoteHandler(xRemote); c.Start(); - Application.Run(); + Console.ReadKey(); + //System.Windows.Forms.Application.Run(); c.Stop(); c = null; @@ -82,7 +75,11 @@ /// <summary> /// USB 2.0 Pinnacle. /// </summary> - USB_2_PINNACLE + USB_2_PINNACLE, + /// <summary> + /// USB 2.0 DSS. + /// </summary> + USB_2_DSS, } /// <summary> @@ -153,43 +150,48 @@ /// <summary> /// f operation finished with ilegal pointer. /// </summary> - RET_ERROR_POINTER + RET_ERROR_POINTER, } #endregion Enumerations #region Delegates - delegate void PIRCBFCN(IntPtr Context, ref int Buf); + /// <summary> + /// Called by the Technotrend api dll to signal a remote button has been received. + /// </summary> + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + unsafe delegate void CallbackDef(int context, uint* buffer); #endregion Delegates #region Interop [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiEnumerate")] - static extern UInt32 bdaapiEnumerate(DEVICE_CAT DevType); + static extern UInt32 bdaapiEnumerate(DEVICE_CAT deviceType); [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiOpen")] - static extern IntPtr bdaapiOpen(DEVICE_CAT DevType, uint uiDevID); + static extern IntPtr bdaapiOpen(DEVICE_CAT deviceType, uint deviceId); [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiClose")] - static extern void bdaapiClose(IntPtr hOpen); + static extern void bdaapiClose(IntPtr handle); [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiOpenIR")] - static extern TYPE_RET_VAL bdaapiOpenIR(IntPtr hOpen, PIRCBFCN CallbackFcn, IntPtr Context); + static extern TYPE_RET_VAL bdaapiOpenIR(IntPtr handle, IntPtr callback, int context); [DllImport("ttBdaDrvApi_Dll.dll", EntryPoint = "bdaapiCloseIR")] - static extern TYPE_RET_VAL bdaapiCloseIR(IntPtr hOpen); + static extern TYPE_RET_VAL bdaapiCloseIR(IntPtr handle); #endregion Interop #region Variables - RemoteHandler _remoteButtonHandler; - List<IntPtr> _handles; - PIRCBFCN _callback; + CallbackDef _callback; + IntPtr _callbackPtr; + RemoteHandler _remoteButtonHandler; + int _lastTrigger = -1; int _lastCode = -1; DateTime _lastCodeTime = DateTime.Now; @@ -203,8 +205,13 @@ /// </summary> public TechnotrendReceiver() { - _handles = new List<IntPtr>(); - _callback = new PIRCBFCN(OnIRCode); + _handles = new List<IntPtr>(); + + unsafe + { + _callback = new CallbackDef(OnIRCode); + _callbackPtr = Marshal.GetFunctionPointerForDelegate(_callback); + } } #endregion Constructor @@ -246,29 +253,35 @@ IntPtr handle; TYPE_RET_VAL error; - for (DEVICE_CAT cat = DEVICE_CAT.UNKNOWN; cat <= DEVICE_CAT.USB_2_PINNACLE; cat++) + try { - if (bdaapiEnumerate(cat) > 0) + for (DEVICE_CAT cat = DEVICE_CAT.UNKNOWN; cat <= DEVICE_CAT.USB_2_DSS; cat++) { - handle = bdaapiOpen(cat, 0); - try + if (bdaapiEnumerate(cat) > 0) { - if ((handle != IntPtr.Zero) && (handle.ToInt32() != -1)) + handle = bdaapiOpen(cat, 0); + try { - error = bdaapiOpenIR(handle, _callback, IntPtr.Zero); + if ((handle != IntPtr.Zero) && (handle.ToInt32() != -1)) + { + error = bdaapiOpenIR(handle, _callbackPtr, 0); - bdaapiClose(handle); + bdaapiClose(handle); - if (error == TYPE_RET_VAL.RET_SUCCESS) - return true; + if (error == TYPE_RET_VAL.RET_SUCCESS) + return true; + } } + catch + { + bdaapiClose(handle); + } } - catch - { - bdaapiClose(handle); - } } } + catch + { + } return false; } @@ -281,14 +294,14 @@ IntPtr handle; TYPE_RET_VAL error; - for (DEVICE_CAT cat = DEVICE_CAT.UNKNOWN; cat <= DEVICE_CAT.USB_2_PINNACLE; cat++) + for (DEVICE_CAT cat = DEVICE_CAT.UNKNOWN; cat <= DEVICE_CAT.USB_2_DSS; cat++) { if (bdaapiEnumerate(cat) > 0) { handle = bdaapiOpen(cat, 0); if ((handle != IntPtr.Zero) && (handle.ToInt32() != -1)) { - error = bdaapiOpenIR(handle, _callback, IntPtr.Zero); + error = bdaapiOpenIR(handle, _callbackPtr, 0); if (error == TYPE_RET_VAL.RET_SUCCESS) { _handles.Add(handle); @@ -331,7 +344,7 @@ bdaapiCloseIR(handle); bdaapiClose(handle); } - + _handles.Clear(); } @@ -346,63 +359,37 @@ } /// <summary> - /// Called when an IR Command is received. + /// Called when an IR code is received. /// </summary> - /// <param name="Context">The context.</param> - /// <param name="Buf">The buffer.</param> - void OnIRCode(IntPtr Context, ref int Buf) + /// <param name="context">The context.</param> + /// <param name="buffer">The code.</param> + unsafe void OnIRCode(int context, uint *buffer) { - //if (Buf == IntPtr.Zero) - //return; - try { - int code = Buf; - /* - try - { - code = Marshal.ReadInt32(Buf); - } - catch (Exception ex) - { - Console.WriteLine("Marshal.ReadInt32(Buf) failed, trying ToInt32 method ..."); - Console.WriteLine(ex.ToString()); - } + int code = ((int)buffer[0]) & 0x00FF; + int trigger = ((int)buffer[0]) & 0x0800; - try - { - code = Buf.ToInt32(); - } - catch (Exception ex) - { - Console.WriteLine("Buf.ToInt32() method failed."); - Console.WriteLine(ex.ToString()); - } - */ - int trigger = code & 0x800; - code = code & 0x3F; - DateTime now = DateTime.Now; TimeSpan timeSpan = now - _lastCodeTime; if (code != _lastCode || trigger != _lastTrigger || timeSpan.Milliseconds >= 250) { if (_remoteButtonHandler != null) - _remoteButtonHandler(this.Name, code.ToString()); + _remoteButtonHandler("Technotrend", code.ToString()); _lastCodeTime = now; } _lastCode = code; _lastTrigger = trigger; - } - catch (Exception ex) + catch { - Console.WriteLine(ex.ToString()); + //MessageBox.Show(ex.ToString()); } } - + #endregion Implementation } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Technotrend Receiver/Technotrend Receiver.csproj 2008-03-11 03:29:59 UTC (rev 1444) @@ -25,6 +25,7 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> <DocumentationFile>bin\Debug\Technotrend Receiver.XML</DocumentationFile> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> @@ -36,6 +37,7 @@ <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> @@ -60,7 +62,6 @@ <ItemGroup> <Reference Include="System" /> <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" /> Deleted: trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-03-11 03:29:59 UTC (rev 1444) @@ -1,839 +0,0 @@ -;====================================== -; IR Server Suite - Debug.nsi -; -; (C) Copyright Aaron Dinnage, 2008 -;====================================== - -!include "x64.nsh" -!include "MUI.nsh" - -!define PRODUCT_NAME "IR Server Suite" -!define PRODUCT_VERSION "1.0.4.2" -!define PRODUCT_PUBLISHER "and-81" -!define PRODUCT_WEB_SITE "http://forum.team-mediaportal.com/mce_replacement_plugin-f165.html" - -Name "${PRODUCT_NAME}" -OutFile "${PRODUCT_NAME} - ${PRODUCT_VERSION}.exe" -InstallDir "" -ShowInstDetails show -ShowUninstDetails show -BrandingText "${PRODUCT_NAME} by Aaron Dinnage" -SetCompressor /SOLID /FINAL lzma -CRCCheck On - -; Variables -var DIR_INSTALL -var DIR_MEDIAPORTAL -var DIR_TVSERVER - -!define MUI_ABORTWARNING -!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico" -!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico" - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "Documentation\LICENSE.GPL" -!insertmacro MUI_PAGE_COMPONENTS - -; Main app install path -!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShowApp -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveApp -!insertmacro MUI_PAGE_DIRECTORY - -; MediaPortal install path -!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreMP -!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShowMP -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveMP -!insertmacro MUI_PAGE_DIRECTORY - -; TV Server install path -!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreTV -!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShowTV -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveTV -!insertmacro MUI_PAGE_DIRECTORY - -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - -!insertmacro MUI_UNPAGE_INSTFILES - -!insertmacro MUI_LANGUAGE "English" - -;====================================== -;====================================== - -!macro initRegKeys - ${If} ${RunningX64} - - SetRegView 64 - - ${DisableX64FSRedirection} - - ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" - ${If} $DIR_INSTALL == "" - StrCpy '$DIR_INSTALL' '$PROGRAMFILES\${PRODUCT_NAME}' - ${Endif} - - ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" - ${If} $DIR_MEDIAPORTAL == "" - StrCpy '$DIR_MEDIAPORTAL' '$PROGRAMFILES\Team MediaPortal\MediaPortal' - ${Endif} - - ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" - ${If} $DIR_TVSERVER == "" - StrCpy '$DIR_TVSERVER' '$PROGRAMFILES\Team MediaPortal\MediaPortal TV Server' - ${Endif} - - ${EnableX64FSRedirection} - - ${Else} - - SetRegView 32 - - ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" - ${If} $DIR_INSTALL == "" - StrCpy '$DIR_INSTALL' '$PROGRAMFILES\${PRODUCT_NAME}' - ${Endif} - - ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" - ${If} $DIR_MEDIAPORTAL == "" - StrCpy '$DIR_MEDIAPORTAL' '$PROGRAMFILES\Team MediaPortal\MediaPortal' - ${Endif} - - ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" - ${If} $DIR_TVSERVER == "" - StrCpy '$DIR_TVSERVER' '$PROGRAMFILES\Team MediaPortal\MediaPortal TV Server' - ${Endif} - - ${Endif} -!macroend - -;====================================== -;====================================== - -Function .onInit - -!insertmacro initRegKeys - -FunctionEnd - -;====================================== - -Function .onInstSuccess - - IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" StartInputService SkipStartInputService - -StartInputService: - Exec '"$DIR_INSTALL\Input Service\Input Service.exe" /start' - -SkipStartInputService: - -FunctionEnd - -;====================================== - -Function DirectoryPreMP - SectionGetFlags 3 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreMP - - SectionGetFlags 4 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreMP - - SectionGetFlags 5 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreMP - - Abort - -EndDirectoryPreMP: -FunctionEnd - -;====================================== - -Function DirectoryPreTV - SectionGetFlags 6 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreTV - - Abort - -EndDirectoryPreTV: -FunctionEnd - -;====================================== - -Function DirectoryShowApp - !insertmacro MUI_HEADER_TEXT "Choose ${PRODUCT_NAME} Location" "Choose the folder in which to install ${PRODUCT_NAME}." - !insertmacro MUI_INNERDIALOG_TEXT 1041 "${PRODUCT_NAME} Folder" - !insertmacro MUI_INNERDIALOG_TEXT 1019 "$DIR_INSTALL" - !insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install ${PRODUCT_NAME} in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Next to continue." -FunctionEnd - -;====================================== - -Function DirectoryShowMP - !insertmacro MUI_HEADER_TEXT "Choose MediaPortal Location" "Choose the folder in which to install MediaPortal plugins." - !insertmacro MUI_INNERDIALOG_TEXT 1041 "MediaPortal Folder" - !insertmacro MUI_INNERDIALOG_TEXT 1019 "$DIR_MEDIAPORTAL" - !insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install MediaPortal plugins in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Install to start the installation." -FunctionEnd - -;====================================== - -Function DirectoryShowTV - !insertmacro MUI_HEADER_TEXT "Choose TV Server Location" "Choose the folder in which to install TV Server plugins." - !insertmacro MUI_INNERDIALOG_TEXT 1041 "TV Server Folder" - !insertmacro MUI_INNERDIALOG_TEXT 1019 "$DIR_TVSERVER" - !insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install TV Server plugins in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Install to start the installation." -FunctionEnd - -;====================================== - -Function DirectoryLeaveApp - StrCpy $DIR_INSTALL $INSTDIR -FunctionEnd - -;====================================== - -Function DirectoryLeaveMP - StrCpy $DIR_MEDIAPORTAL $INSTDIR -FunctionEnd - -;====================================== - -Function DirectoryLeaveTV - StrCpy $DIR_TVSERVER $INSTDIR -FunctionEnd - -;====================================== -;====================================== - -Section "-Prepare" - - DetailPrint "Preparing to install ..." - - ; Use the all users context - SetShellVarContext all - - ; Kill running Programs - DetailPrint "Terminating processes ..." - ExecWait '"taskkill" /F /IM Translator.exe' - ExecWait '"taskkill" /F /IM TrayLauncher.exe' - ExecWait '"taskkill" /F /IM WebRemote.exe' - ExecWait '"taskkill" /F /IM VirtualRemote.exe' - ExecWait '"taskkill" /F /IM VirtualRemoteSkinEditor.exe' - ExecWait '"taskkill" /F /IM IRFileTool.exe' - ExecWait '"taskkill" /F /IM DebugClient.exe' - ExecWait '"taskkill" /F /IM KeyboardInputRelay.exe' - - IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" StopInputService SkipStopInputService - -StopInputService: - ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /stop' - -SkipStopInputService: - Sleep 100 - -SectionEnd - -;====================================== - -Section "-Core" - - DetailPrint "Setting up paths and installing core files ..." - - ; Use the all users context - SetShellVarContext all - - CreateDirectory "$APPDATA\${PRODUCT_NAME}" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Logs" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\IR Commands" - - ; Copy known set top boxes - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" - SetOutPath "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" - SetOverwrite ifnewer - File /r /x .svn "Set Top Boxes\*.*" - - ; Create a start menu shortcut folder - CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" - -SectionEnd - -;====================================== - -Section "Input Service" SectionInputService - - DetailPrint "Installing Input Service ..." - - ; Use the all users context - SetShellVarContext all - - ; Uninstall current Input Service ... - IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" UninstallInputService SkipUninstallInputService - -UninstallInputService: - ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /uninstall' - -SkipUninstallInputService: - Sleep 100 - - ; Installing Input Service - CreateDirectory "$DIR_INSTALL\Input Service" - SetOutPath "$DIR_INSTALL\Input Service" - SetOverwrite ifnewer - File "Input Service\Input Service\bin\Debug\*.*" - - ; Installing Input Service Configuration - CreateDirectory "$DIR_INSTALL\Input Service Configuration" - SetOutPath "$DIR_INSTALL\Input Service Configuration" - SetOverwrite ifnewer - File "Input Service\Input Service Configuration\bin\Debug\*.*" - - ; Install IR Server Plugins ... - DetailPrint "Installing IR Server Plugins ..." - CreateDirectory "$DIR_INSTALL\IR Server Plugins" - SetOutPath "$DIR_INSTALL\IR Server Plugins" - SetOverwrite ifnewer - - File "IR Server Plugins\Ads Tech PTV-335 Receiver\bin\Debug\Ads Tech PTV-335 Receiver.*" - File "IR Server Plugins\CoolCommand Receiver\bin\Debug\CoolCommand Receiver.*" - File "IR Server Plugins\Custom HID Receiver\bin\Debug\Custom HID Receiver.*" - File "IR Server Plugins\Direct Input Receiver\bin\Debug\Direct Input Receiver.*" - File "IR Server Plugins\FusionRemote Receiver\bin\Debug\FusionRemote Receiver.*" - File "IR Server Plugins\Girder Plugin\bin\Debug\Girder Plugin.*" - File "IR Server Plugins\HCW Receiver\bin\Debug\HCW Receiver.*" - File "IR Server Plugins\IgorPlug Receiver\bin\Debug\IgorPlug Receiver.*" - ;File "IR Server Plugins\IR501 Receiver\bin\Debug\IR501 Receiver.*" - File "IR Server Plugins\IR507 Receiver\bin\Debug\IR507 Receiver.*" - ;File "IR Server Plugins\Ira Transceiver\bin\Debug\Ira Transceiver.*" - File "IR Server Plugins\IRMan Receiver\bin\Debug\IRMan Receiver.*" - File "IR Server Plugins\IRTrans Transceiver\bin\Debug\IRTrans Transceiver.*" - ;File "IR Server Plugins\Keyboard Input\bin\Debug\Keyboard Input.*" - File "IR Server Plugins\LiveDrive Receiver\bin\Debug\LiveDrive Receiver.*" - File "IR Server Plugins\MacMini Receiver\bin\Debug\MacMini Receiver.*" - File "IR Server Plugins\Microsoft MCE Transceiver\bin\Debug\Microsoft MCE Transceiver.*" - ;File "IR Server Plugins\RC102 Receiver\bin\Debug\RC102 Receiver.*" - File "IR Server Plugins\RedEye Blaster\bin\Debug\RedEye Blaster.*" - File "IR Server Plugins\Serial IR Blaster\bin\Debug\Serial IR Blaster.*" - ;File "IR Server Plugins\Speech Receiver\bin\Debug\Speech Receiver.*" - File "IR Server Plugins\Technotrend Receiver\bin\Debug\Technotrend Receiver.*" - ;File "IR Server Plugins\Tira Transceiver\bin\Debug\Tira Transceiver.*" - File "IR Server Plugins\USB-UIRT Transceiver\bin\Debug\USB-UIRT Transceiver.*" - File "IR Server Plugins\Wii Remote Receiver\bin\Debug\Wii Remote Receiver.*" - File "IR Server Plugins\WiimoteLib\bin\Debug\WiimoteLib.*" - File "IR Server Plugins\Windows Message Receiver\bin\Debug\Windows Message Receiver.*" - File "IR Server Plugins\WinLirc Transceiver\bin\Debug\WinLirc Transceiver.*" - File "IR Server Plugins\X10 Transceiver\bin\Debug\X10 Transceiver.*" - File "IR Server Plugins\X10 Transceiver\bin\Debug\Interop.X10.dll" - File "IR Server Plugins\XBCDRC Receiver\bin\Debug\XBCDRC Receiver.*" - - ; Create App Data Folder for IR Server configuration files. - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Input Service" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Input Service\Abstract Remote Maps" - SetOutPath "$APPDATA\${PRODUCT_NAME}\Input Service\Abstract Remote Maps" - SetOverwrite ifnewer - File /r /x .svn "Input Service\Input Service\Abstract Remote Maps\*.*" - File "Input Service\Input Service\RemoteTable.xsd" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Input Service Configuration.lnk" "$DIR_INSTALL\Input Service Configuration\Input Service Configuration.exe" "" "$DIR_INSTALL\Input Service Configuration\Input Service Configuration.exe" 0 - - ; Launch Input Service - DetailPrint "Starting Input Service ..." - ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /install' - -SectionEnd - -;====================================== - -Section "MP Control Plugin" SectionMPControlPlugin - - DetailPrint "Installing MP Control Plugin ..." - - ; Use the all users context - SetShellVarContext all - - ; Write plugin dll - SetOutPath "$DIR_MEDIAPORTAL\Plugins\Process" - SetOverwrite ifnewer - File "MediaPortal Plugins\MP Control Plugin\bin\Debug\MPUtils.dll" - File "MediaPortal Plugins\MP Control Plugin\bin\Debug\IrssComms.dll" - File "MediaPortal Plugins\MP Control Plugin\bin\Debug\IrssUtils.dll" - File "MediaPortal Plugins\MP Control Plugin\bin\Debug\MPControlPlugin.dll" - - ; Write input mapping - SetOutPath "$DIR_MEDIAPORTAL\InputDeviceMappings\defaults" - SetOverwrite ifnewer - File "MediaPortal Plugins\MP Control Plugin\InputMapping\MPControlPlugin.xml" - - ; Write app data - CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Control Plugin" - SetOutPath "$APPDATA\${PRODUCT_NAME}\MP Control Plugin" - SetOverwrite ifnewer - File /r /x .svn "MediaPortal Plugins\MP Control Plugin\AppData\*.*" - - ; Create Macro folder - CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Control Plugin\Macro" - -SectionEnd - -;====================================== - -Section "MP Blast Zone Plugin" SectionMPBlastZonePlugin - - DetailPrint "Installing MP Blast Zone Plugin ..." - - ; Use the all users context - SetShellVarContext all - - ; Write plugin dll - SetOutPath "$DIR_MEDIAPORTAL\Plugins\Windows" - SetOverwrite ifnewer - File "MediaPortal Plugins\MP Blast Zone Plugin\bin\Debug\MPUtils.dll" - File "MediaPortal Plugins\MP Blast Zone Plugin\bin\Debug\IrssComms.dll" - File "MediaPortal Plugins\MP Blast Zone Plugin\bin\Debug\IrssUtils.dll" - File "MediaPortal Plugins\MP Blast Zone Plugin\bin\Debug\MPBlastZonePlugin.dll" - - ; Write app data - CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin" - SetOutPath "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin" - SetOverwrite off - File "MediaPortal Plugins\MP Blast Zone Plugin\AppData\Menu.xml" - - ; Write skin files - SetOutPath "$DIR_MEDIAPORTAL\Skin\BlueTwo" - SetOverwrite on - File /r /x .svn "MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" - - SetOutPath "$DIR_MEDIAPORTAL\Skin\BlueTwo wide" - SetOverwrite on - File /r /x .svn "MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" - - ; Create Macro folder - CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin\Macro" - -SectionEnd - -;====================================== - -Section "TV2 Blaster Plugin" SectionTV2BlasterPlugin - - DetailPrint "Installing TV2 Blaster Plugin ..." - - ; Use the all users context - SetShellVarContext all - - ; Write plugin dll - SetOutPath "$DIR_MEDIAPORTAL\Plugins\Process" - SetOverwrite ifnewer - File "MediaPortal Plugins\TV2 Blaster Plugin\bin\Debug\MPUtils.dll" - File "MediaPortal Plugins\TV2 Blaster Plugin\bin\Debug\IrssComms.dll" - File "MediaPortal Plugins\TV2 Blaster Plugin\bin\Debug\IrssUtils.dll" - File "MediaPortal Plugins\TV2 Blaster Plugin\bin\Debug\TV2BlasterPlugin.dll" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV2 Blaster Plugin" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV2 Blaster Plugin\Macro" - -SectionEnd - -;====================================== - -Section /o "TV3 Blaster Plugin" SectionTV3BlasterPlugin - - DetailPrint "Installing TV3 Blaster Plugin ..." - - ; Use the all users context - SetShellVarContext all - - ; Write plugin dll - SetOutPath "$DIR_TVSERVER\Plugins" - SetOverwrite ifnewer - File "MediaPortal Plugins\TV3 Blaster Plugin\bin\Debug\MPUtils.dll" - File "MediaPortal Plugins\TV3 Blaster Plugin\bin\Debug\IrssComms.dll" - File "MediaPortal Plugins\TV3 Blaster Plugin\bin\Debug\IrssUtils.dll" - File "MediaPortal Plugins\TV3 Blaster Plugin\bin\Debug\TV3BlasterPlugin.dll" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV3 Blaster Plugin" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV3 Blaster Plugin\Macro" - -SectionEnd - -;====================================== - -Section "Translator" SectionTranslator - - DetailPrint "Installing Translator ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing Translator - CreateDirectory "$DIR_INSTALL\Translator" - SetOutPath "$DIR_INSTALL\Translator" - SetOverwrite ifnewer - File "Applications\Translator\bin\Debug\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Translator" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Translator\Macro" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Translator\Default Settings" - - ; Copy in default settings files - SetOutPath "$APPDATA\${PRODUCT_NAME}\Translator\Default Settings" - SetOverwrite ifnewer - File "Applications\Translator\Default Settings\*.xml" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" "$DIR_INSTALL\Translator\Translator.exe" "" "$DIR_INSTALL\Translator\Translator.exe" 0 - -SectionEnd - -;====================================== - -Section "Tray Launcher" SectionTrayLauncher - - DetailPrint "Installing Tray Launcher ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing Translator - CreateDirectory "$DIR_INSTALL\Tray Launcher" - SetOutPath "$DIR_INSTALL\Tray Launcher" - SetOverwrite ifnewer - File "Applications\Tray Launcher\bin\Debug\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Tray Launcher" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Tray Launcher.lnk" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" "" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" 0 - -SectionEnd - -;====================================== - -Section "Virtual Remote" SectionVirtualRemote - - DetailPrint "Installing Virtual Remote, Skin Editor, Smart Device versions, and Web Remote..." - - ; Use the all users context - SetShellVarContext all - - ; Installing Virtual Remote and Web Remote - CreateDirectory "$DIR_INSTALL\Virtual Remote" - SetOutPath "$DIR_INSTALL\Virtual Remote" - SetOverwrite ifnewer - File "Applications\Virtual Remote\bin\Debug\*.*" - File "Applications\Web Remote\bin\Debug\WebRemote.*" - File "Applications\Virtual Remote Skin Editor\bin\Debug\VirtualRemoteSkinEditor.*" - - ; Installing skins - CreateDirectory "$DIR_INSTALL\Virtual Remote\Skins" - SetOutPath "$DIR_INSTALL\Virtual Remote\Skins" - SetOverwrite ifnewer - File "Applications\Virtual Remote\Skins\*.*" - - ; Installing Virtual Remote for Smart Devices - CreateDirectory "$DIR_INSTALL\Virtual Remote\Smart Devices" - SetOutPath "$DIR_INSTALL\Virtual Remote\Smart Devices" - SetOverwrite ifnewer - File "Applications\Virtual Remote (PocketPC2003) Installer\Debug\*.cab" - File "Applications\Virtual Remote (Smartphone2003) Installer\Debug\*.cab" - File "Applications\Virtual Remote (WinCE5) Installer\Debug\*.cab" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Virtual Remote" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote.lnk" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" "" "$DIR_INSTALL\Virtual Remote\VirtualRemote.exe" 0 - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote Skin Editor.lnk" "$DIR_INSTALL\Virtual Remote\VirtualRemoteSkinEditor.exe" "" "$DIR_INSTALL\Virtual Remote\VirtualRemoteSkinEditor.exe" 0 - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote for Smart Devices.lnk" "$DIR_INSTALL\Virtual Remote\Smart Devices" - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Web Remote.lnk" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" "" "$DIR_INSTALL\Virtual Remote\WebRemote.exe" 0 - -SectionEnd - -;====================================== - -Section "IR Blast" SectionIRBlast - - DetailPrint "Installing IR Blast ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing IR Server - CreateDirectory "$DIR_INSTALL\IR Blast" - SetOutPath "$DIR_INSTALL\IR Blast" - SetOverwrite ifnewer - File "Applications\IR Blast (No Window)\bin\Debug\*.*" - File "Applications\IR Blast\bin\Debug\IRBlast.exe" - -SectionEnd - -;====================================== - -Section "IR File Tool" SectionIRFileTool - - DetailPrint "Installing IR File Tool ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing IR Server - CreateDirectory "$DIR_INSTALL\IR File Tool" - SetOutPath "$DIR_INSTALL\IR File Tool" - SetOverwrite ifnewer - File "Applications\IR File Tool\bin\Debug\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\IR File Tool" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\IR File Tool.lnk" "$DIR_INSTALL\IR File Tool\IRFileTool.exe" "" "$DIR_INSTALL\IR File Tool\IRFileTool.exe" 0 - -SectionEnd - -;====================================== - -Section "Keyboard Input Relay" SectionKeyboardInputRelay - - DetailPrint "Installing Keyboard Input Relay ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing IR Server - CreateDirectory "$DIR_INSTALL\Keyboard Input Relay" - SetOutPath "$DIR_INSTALL\Keyboard Input Relay" - SetOverwrite ifnewer - File "Applications\Keyboard Input Relay\bin\Debug\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Keyboard Input Relay" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Keyboard Input Relay.lnk" "$DIR_INSTALL\Keyboard Input Relay\KeyboardInputRelay.exe" "" "$DIR_INSTALL\Keyboard Input Relay\KeyboardInputRelay.exe" 0 - -SectionEnd - -;====================================== - -Section "Dbox Tuner" SectionDboxTuner - - DetailPrint "Installing Dbox Tuner ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing IR Server - CreateDirectory "$DIR_INSTALL\Dbox Tuner" - SetOutPath "$DIR_INSTALL\Dbox Tuner" - SetOverwrite ifnewer - File "Applications\Dbox Tuner\bin\Debug\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Dbox Tuner" - -SectionEnd - -;====================================== - -Section "HCW PVR Tuner" SectionHcwPvrTuner - - DetailPrint "Installing HCW PVR Tuner ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing IR Server - CreateDirectory "$DIR_INSTALL\HCW PVR Tuner" - SetOutPath "$DIR_INSTALL\HCW PVR Tuner" - SetOverwrite ifnewer - File "Applications\HCW PVR Tuner\bin\Debug\*.*" - -SectionEnd - -;====================================== - -Section "Debug Client" SectionDebugClient - - DetailPrint "Installing Debug Client ..." - - ; Use the all users context - SetShellVarContext all - - ; Installing Debug Client - CreateDirectory "$DIR_INSTALL\Debug Client" - SetOutPath "$DIR_INSTALL\Debug Client" - SetOverwrite ifnewer - File "Applications\Debug Client\bin\Debug\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Debug Client" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Debug Client.lnk" "$DIR_INSTALL\Debug Client\DebugClient.exe" "" "$DIR_INSTALL\Debug Client\DebugClient.exe" 0 - -SectionEnd - -;====================================== - -Section "-Complete" - - DetailPrint "Completing install ..." - - ; Use the all users context - SetShellVarContext all - - ; Write documentation - SetOutPath "$DIR_INSTALL" - SetOverwrite ifnewer - File "Documentation\${PRODUCT_NAME}.chm" - - ; Create website link file - WriteIniStr "$DIR_INSTALL\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" - - ; Write the uninstaller - WriteUninstaller "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" - - ; Create start menu shortcuts - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Documentation.lnk" "$DIR_INSTALL\${PRODUCT_NAME}.chm" - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Website.lnk" "$DIR_INSTALL\${PRODUCT_NAME}.url" - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Log Files.lnk" "$APPDATA\${PRODUCT_NAME}\Logs" - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" "" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" - - ; Write the installation paths into the registry - WriteRegStr HKLM "Software\${PRODUCT_NAME}" "Install_Dir" "$DIR_INSTALL" - WriteRegStr HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" "$DIR_MEDIAPORTAL" - WriteRegStr HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" "$DIR_TVSERVER" - - ; Write the uninstall keys for Windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayVersion" "${PRODUCT_VERSION}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "Publisher" "${PRODUCT_PUBLISHER}" - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoModify" 1 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1 - - SetAutoClose false - -SectionEnd - -;====================================== -;====================================== - -; Section descriptions -!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SectionInputService} "A windows service that provides access to your IR devices." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "Connects to the Input Service to control MediaPortal." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "Lets you control your IR devices from within the MediaPortal GUI." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "For tuning external channels (on Set Top Boxes) with the default MediaPortal TV engine." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "Control your whole PC." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "Simple tray application to launch an application of your choosing when a particular button is pressed." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "Simulated remote control, works as an application or as a web hosted remote control (with included Web Remote). Also includes a Skin Editor and Smart Device versions of Virtual Remote." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRBlast} "Command line tools for blasting IR codes." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRFileTool} "Tool for learning, modifying, testing, correcting and converting IR command files." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionKeyboardInputRelay} "Relays keyboard input to the Input Service to act on keypresses like remote buttons." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionDboxTuner} "Command line tuner for Dreambox devices." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionHcwPvrTuner} "Command line tuner for Hauppauge PVR devices." - !insertmacro MUI_DESCRIPTION_TEXT ${SectionDebugClient} "Very simple testing tool for troubleshooting input and communications problems." -!insertmacro MUI_FUNCTION_DESCRIPTION_END - -;====================================== -;====================================== - -Function un.onInit - - !insertmacro initRegKeys - - MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 - Abort -FunctionEnd - -;====================================== -;====================================== - -Section "Uninstall" - - ; Use the all users context - SetShellVarContext all - - ; Kill running Programs - DetailPrint "Terminating processes ..." - ExecWait '"taskkill" /F /IM Translator.exe' - ExecWait '"taskkill" /F /IM TrayLauncher.exe' - ExecWait '"taskkill" /F /IM WebRemote.exe' - ExecWait '"taskkill" /F /IM VirtualRemote.exe' - ExecWait '"taskkill" /F /IM VirtualRemoteSkinEditor.exe' - ExecWait '"taskkill" /F /IM IRFileTool.exe' - ExecWait '"taskkill" /F /IM DebugClient.exe' - ExecWait '"taskkill" /F /IM KeyboardInputRelay.exe' - Sleep 100 - - ; Uninstall current Input Service ... - IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" UninstallInputService SkipUninstallInputService - -UninstallInputService: - ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /uninstall' - -SkipUninstallInputService: - Sleep 100 - - ; Remove files and uninstaller - DetailPrint "Attempting to remove MediaPortal Blast Zone Plugin ..." - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Windows\MPUtils.dll" - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Windows\IrssComms.dll" - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Windows\IrssUtils.dll" - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Windows\MPBlastZonePlugin.dll" - - DetailPrint "Attempting to remove MediaPortal Process Plugin Common Files ..." - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Process\MPUtils.dll" - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Process\IrssComms.dll" - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Process\IrssUtils.dll" - - DetailPrint "Attempting to remove MediaPortal Control Plugin ..." - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Process\MPControlPlugin.dll" - - DetailPrint "Attempting to remove MediaPortal TV2 Plugin ..." - Delete /REBOOTOK "$DIR_MEDIAPORTAL\Plugins\Process\TV2BlasterPlugin.dll" - - DetailPrint "Attempting to remove MediaPortal TV3 Plugin ..." - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\MPUtils.dll" - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\IrssComms.dll" - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\IrssUtils.dll" - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\TV3BlasterPlugin.dll" - - DetailPrint "Removing Set Top Box presets ..." - RMDir /R "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" - - DetailPrint "Removing program files ..." - RMDir /R /REBOOTOK "$DIR_INSTALL" - - DetailPrint "Removing start menu shortcuts ..." - RMDir /R "$SMPROGRAMS\${PRODUCT_NAME}" - - ; Remove registry keys - DetailPrint "Removing registry keys ..." - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" - DeleteRegKey HKLM "Software\${PRODUCT_NAME}" - - ; Remove auto-runs - DetailPrint "Removing application auto-runs ..." - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Tray Launcher" - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Translator" - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Keyboard Input Relay" - - SetAutoClose false - -SectionEnd - -;====================================== -;====================================== \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 2008-03-10 21:48:13 UTC (rev 1443) +++ trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 2008-03-11 03:29:59 UTC (rev 1444) @@ -1,846 +0,0 @@ -;====================================== -; IR Server Suite - Release.nsi -; -; (C) Copyright Aaron Dinnage, 2008 -;====================================== - -!include "x64.nsh" -!include "MUI.nsh" - -!define PRODUCT_NAME "IR Server Suite" -!define PRODUCT_VERSION "1.0.4.2" -!define PRODUCT_PUBLISHER "and-81" -!define PRODUCT_WEB_SITE "http://forum.team-mediaportal.com/mce_replacement_plugin-f165.html" - -Name "${PRODUCT_NAME}" -OutFile "${PRODUCT_NAME} - ${PRODUCT_VERSION}.exe" -InstallDir "" -ShowInstDetails hide -ShowUninstDetails hide -BrandingText "${PRODUCT_NAME} by Aaron Dinnage" -SetCompressor /SOLID /FINAL lzma -CRCCheck On - -; Variables -var DIR_INSTALL -var DIR_MEDIAPORTAL -var DIR_TVSERVER - -!define MUI_ABORTWARNING -!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico" -!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico" - -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "Documentation\LICENSE.GPL" -!insertmacro MUI_PAGE_COMPONENTS - -; Main app install path -!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShowApp -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveApp -!insertmacro MUI_PAGE_DIRECTORY - -; MediaPortal install path -!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreMP -!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShowMP -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveMP -!insertmacro MUI_PAGE_DIRECTORY - -; TV Server install path -!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreTV -!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShowTV -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveTV -!insertmacro MUI_PAGE_DIRECTORY - -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - -!insertmacro MUI_UNPAGE_INSTFILES - -!insertmacro MUI_LANGUAGE "English" - -;====================================== -;====================================== - -!macro initRegKeys - ${If} ${RunningX64} - - SetRegView 64 - - ${DisableX64FSRedirection} - - ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" - ${If} $DIR_INSTALL == "" - StrCpy '$DIR_INSTALL' '$PROGRAMFILES\${PRODUCT_NAME}' - ${Endif} - - ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" - ${If} $DIR_MEDIAPORTAL == "" - StrCpy '$DIR_MEDIAPORTAL' '$PROGRAMFILES\Team MediaPortal\MediaPortal' - ${Endif} - - ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" - ${If} $DIR_TVSERVER == "" - StrCpy '$DIR_TVSERVER' '$PROGRAMFILES\Team MediaPortal\MediaPortal TV Server' - ${Endif} - - ${EnableX64FSRedirection} - - ${Else} - - SetRegView 32 - - ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" - ${If} $DIR_INSTALL == "" - StrCpy '$DIR_INSTALL' '$PROGRAMFILES\${PRODUCT_NAME}' - ${Endif} - - ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" - ${If} $DIR_MEDIAPORTAL == "" - StrCpy '$DIR_MEDIAPORTAL' '$PROGRAMFILES\Team MediaPortal\MediaPortal' - ${Endif} - - ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" - ${If} $DIR_TVSERVER == "" - StrCpy '$DIR_TVSERVER' '$PROGRAMFILES\Team MediaPortal\MediaPortal TV Server' - ${Endif} - - ${Endif} -!macroend - -;====================================== -;====================================== - -Function .onInit - -!insertmacro initRegKeys - -FunctionEnd - -;====================================== - -Function .onInstSuccess - - IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" StartInputService SkipStartInputService - -StartInputService: - Exec '"$DIR_INSTALL\Input Service\Input Service.exe" /start' - -SkipStartInputService: - -FunctionEnd - -;====================================== - -Function DirectoryPreMP - SectionGetFlags 3 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreMP - - SectionGetFlags 4 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreMP - - SectionGetFlags 5 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreMP - - Abort - -EndDirectoryPreMP: -FunctionEnd - -;====================================== - -Function DirectoryPreTV - SectionGetFlags 6 $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - IntCmp $R0 ${SF_SELECTED} EndDirectoryPreTV - - Abort - -EndDirectoryPreTV: -FunctionEnd - -;====================================== - -Function DirectoryShowApp - !insertmacro MUI_HEADER_TEXT "Choose ${PRODUCT_NAME} Location" "Choose the folder in which to install ${PRODUCT_NAME}." - !insertmacro MUI_INNERDIALOG_TEXT 1041 "${PRODUCT_NAME} Folder" - !insertmacro MUI_INNERDIALOG_TEXT 1019 "$DIR_INSTALL" - !insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install ${PRODUCT_NAME} in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Next to continue." -FunctionEnd - -;====================================== - -Function DirectoryShowMP - !insertmacro MUI_HEADER_TEXT "Choose MediaPortal Location" "Choose the folder in which to install MediaPortal plugins." - !insertmacro MUI_INNERDIALOG_TEXT 1041 "MediaPortal Folder" - !insertmacro MUI_INNERDIALOG_TEXT 1019 "$DIR_MEDIAPORTAL" - !insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install MediaPortal plugins in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Install to start the installation." -FunctionEnd - -;====================================== - -Function DirectoryShowTV - !insertmacro MUI_HEADER_TEXT "Choose TV Server Location" "Choose the folder in which ... [truncated message content] |