From: <che...@us...> - 2008-03-25 09:14:37
|
Revision: 1517 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1517&view=rev Author: chef_koch Date: 2008-03-25 02:13:01 -0700 (Tue, 25 Mar 2008) Log Message: ----------- renamed header file with common macros Modified Paths: -------------- trunk/plugins/IR Server Suite/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup-CommonMPMacros.nsh Removed Paths: ------------- trunk/plugins/IR Server Suite/setup-RememberSections.nsh Copied: trunk/plugins/IR Server Suite/setup-CommonMPMacros.nsh (from rev 1508, trunk/plugins/IR Server Suite/setup-RememberSections.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup-CommonMPMacros.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup-CommonMPMacros.nsh 2008-03-25 09:13:01 UTC (rev 1517) @@ -0,0 +1,89 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +#**********************************************************************************************************# +# +# This original header file is taken from: http://nsis.sourceforge.net/Add/Remove_Functionality +# and modified for our needs. +# +#**********************************************************************************************************# + +#Var AR_SecFlags +#Var AR_RegFlags + +# registry +# ${MEMENTO_REGISTRY_ROOT} +# ${MEMENTO_REGISTRY_KEY} +# ${MEMENTO_REGISTRY_KEY} +#ReadRegDWORD $AR_RegFlags ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection_${__MementoSectionLastSectionId}` + + /* not needed anymore ----- done by MementoSectionRestore +!macro InitSection SecName + ;This macro reads component installed flag from the registry and + ;changes checked state of the section on the components page. + ;Input: section index constant name specified in Section command. + + ClearErrors + ;Reading component status from registry + ReadRegDWORD $AR_RegFlags "${MEMENTO_REGISTRY_ROOT}" "${MEMENTO_REGISTRY_KEY}" "${SecName}" + IfErrors "default_${SecName}" + + ;Status will stay default if registry value not found + ;(component was never installed) + IntOp $AR_RegFlags $AR_RegFlags & 0x0001 ;Turn off all other bits + SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags + IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off + IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit + + ;Writing modified flags + SectionSetFlags ${${SecName}} $AR_SecFlags + + "default_${SecName}:" +!macroend +*/ + +!macro FinishSection SecName + ;This macro reads section flag set by user and removes the section + ;if it is not selected. + ;Then it writes component installed flag to registry + ;Input: section index constant name specified in Section command. + + ${IfNot} ${SectionIsSelected} "${${SecName}}" + ClearErrors + ReadRegDWORD $R0 ${MEMENTO_REGISTRY_ROOT} '${MEMENTO_REGISTRY_KEY}' 'MementoSection_${SecName}' + + ${If} $R0 = 1 + !insertmacro "Remove_${${SecName}}" + ${EndIf} + ${EndIf} +!macroend + +!macro RemoveSection SecName + ;This macro is used to call section's Remove_... macro + ;from the uninstaller. + ;Input: section index constant name specified in Section command. + + !insertmacro "Remove_${${SecName}}" +!macroend \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/setup-RememberSections.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup-RememberSections.nsh 2008-03-25 08:07:17 UTC (rev 1516) +++ trunk/plugins/IR Server Suite/setup-RememberSections.nsh 2008-03-25 09:13:01 UTC (rev 1517) @@ -1,89 +0,0 @@ -#region Copyright (C) 2005-2008 Team MediaPortal - -/* - * Copyright (C) 2005-2008 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - -#**********************************************************************************************************# -# -# This original header file is taken from: http://nsis.sourceforge.net/Add/Remove_Functionality -# and modified for our needs. -# -#**********************************************************************************************************# - -#Var AR_SecFlags -#Var AR_RegFlags - -# registry -# ${MEMENTO_REGISTRY_ROOT} -# ${MEMENTO_REGISTRY_KEY} -# ${MEMENTO_REGISTRY_KEY} -#ReadRegDWORD $AR_RegFlags ${MEMENTO_REGISTRY_ROOT} `${MEMENTO_REGISTRY_KEY}` `MementoSection_${__MementoSectionLastSectionId}` - - /* not needed anymore ----- done by MementoSectionRestore -!macro InitSection SecName - ;This macro reads component installed flag from the registry and - ;changes checked state of the section on the components page. - ;Input: section index constant name specified in Section command. - - ClearErrors - ;Reading component status from registry - ReadRegDWORD $AR_RegFlags "${MEMENTO_REGISTRY_ROOT}" "${MEMENTO_REGISTRY_KEY}" "${SecName}" - IfErrors "default_${SecName}" - - ;Status will stay default if registry value not found - ;(component was never installed) - IntOp $AR_RegFlags $AR_RegFlags & 0x0001 ;Turn off all other bits - SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags - IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off - IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit - - ;Writing modified flags - SectionSetFlags ${${SecName}} $AR_SecFlags - - "default_${SecName}:" -!macroend -*/ - -!macro FinishSection SecName - ;This macro reads section flag set by user and removes the section - ;if it is not selected. - ;Then it writes component installed flag to registry - ;Input: section index constant name specified in Section command. - - ${IfNot} ${SectionIsSelected} "${${SecName}}" - ClearErrors - ReadRegDWORD $R0 ${MEMENTO_REGISTRY_ROOT} '${MEMENTO_REGISTRY_KEY}' 'MementoSection_${SecName}' - - ${If} $R0 = 1 - !insertmacro "Remove_${${SecName}}" - ${EndIf} - ${EndIf} -!macroend - -!macro RemoveSection SecName - ;This macro is used to call section's Remove_... macro - ;from the uninstaller. - ;Input: section index constant name specified in Section command. - - !insertmacro "Remove_${${SecName}}" -!macroend \ No newline at end of file Modified: trunk/plugins/IR Server Suite/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup.nsi 2008-03-25 08:07:17 UTC (rev 1516) +++ trunk/plugins/IR Server Suite/setup.nsi 2008-03-25 09:13:01 UTC (rev 1517) @@ -51,7 +51,7 @@ !include Memento.nsh !include setup-AddRemovePage.nsh -!include setup-RememberSections.nsh +!include setup-CommonMPMacros.nsh !include setup-languages.nsh ; FileFunc macros This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |