From: <che...@us...> - 2009-02-10 22:55:28
|
Revision: 2631 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2631&view=rev Author: chef_koch Date: 2009-02-10 22:07:21 +0000 (Tue, 10 Feb 2009) Log Message: ----------- removed obsolete/not used files updated common mpMacros header file added new component groups to the installer (tools and cmdline tools) TVService is stopped before installing/removing the blaster plugin and started after job is done MediaPortal, MPConfig and SetupTv are closed before installing plugins for those added IR Server to the installer added Abstractor to the installer Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Removed Paths: ------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-DotNetFramework.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-WinVerEx.nsh Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi 2009-02-10 22:00:46 UTC (rev 2630) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi 2009-02-10 22:07:21 UTC (rev 2631) @@ -1,288 +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 - - -# DEFINES -!define svn_ROOT "..\.." -!define svn_MP "${svn_ROOT}\mediaportal" -!define svn_TVServer "${svn_ROOT}\TvEngine3\TVLibrary" -!define svn_DeployTool "${svn_ROOT}\Tools\MediaPortal.DeployTool" -!define svn_InstallScripts "${svn_ROOT}\Tools\InstallationScripts" - - - - -; TEST APP FOR MP STUFF - -; The name of the installer -Name "test-helpmacros" - -; The file to write -OutFile "${__FILE__}.exe" - -; The default installation directory -InstallDir $DESKTOP\Example1 - -; Request application privileges for Windows Vista -RequestExecutionLevel user -ShowInstDetails show - -;-------------------------------- - -Page license -Page instfiles - -;-------------------------------- - -!define INSTALL_LOG_FILE "$DESKTOP\install_$(^Name).log" - -#!include "x64.nsh" -#!include Sections.nsh -#!include LogicLib.nsh -#!include Library.nsh -#!include FileFunc.nsh -#!include Memento.nsh - -!include LogicLib.nsh - -!include include-CommonMPMacros.nsh - -;-------------------------------- - -; The stuff to install -Section "" ;No components page, name is not important - -SectionEnd ; end the section - -;-------------------------------- - -!macro MediaPortalInstallation - DetailPrint "" - DetailPrint "--------------------------------------" - DetailPrint "- MediaPortal Installation" - DetailPrint "--------------------------------------" - - ${If} ${MP023IsInstalled} - !insertmacro MP_GET_INSTALL_DIR $R0 - DetailPrint "X MP 0.2.3.0 InstDir: $R0" - ${Else} - DetailPrint "! MP 0.2.3.0 is not installed" - ${EndIf} - - ${If} ${MPIsInstalled} - !insertmacro MP_GET_INSTALL_DIR $R0 - DetailPrint "X MediaPortal InstDir: $R0" - ${Else} - DetailPrint "! MediaPortal is not installed" - ${EndIf} - - ${If} ${TVServerIsInstalled} - !insertmacro TVSERVER_GET_INSTALL_DIR $R0 - DetailPrint "X TVServer InstDir: $R0" - ${Else} - DetailPrint "! TVServer is not installed" - ${EndIf} - - - ${If} ${MSI_TVServerIsInstalled} - DetailPrint "X old MSI-based TVServer is installed" - ${Else} - DetailPrint "! old MSI-based TVServer is not installed" - ${EndIf} - - ${If} ${MSI_TVClientIsInstalled} - DetailPrint "X old MSI-based TVClient is installed" - ${Else} - DetailPrint "! old MSI-based TVClient is not installed" - ${EndIf} - -!macroend - -!macro OperationSystemInformation - DetailPrint "" - DetailPrint "--------------------------------------" - DetailPrint "- Operation System Information" - DetailPrint "--------------------------------------" - - GetVersion::WindowsName - Pop $R0 - DetailPrint "GetVersion::WindowsName: $R0" - - !insertmacro GetServicePack $R1 $R2 - DetailPrint "GetServicePack major: $R1" - DetailPrint "GetServicePack minor: $R2" - - ${Switch} $R0 - - ${Case} 'Win32s' - ${Case} '95 OSR2' - ${Case} '95' - ${Case} '98 SE' - ${Case} '98' - ${Case} 'ME' - ${Case} 'NT' - ${Case} 'CE' - ${Case} '2000' - ${Case} 'XP x64' - StrCpy $0 "OSabort" - ${Break} - - ${Case} 'Server 2003' - ${Case} 'Server 2003 R2' - ${Case} 'Server Longhorn' ; Server 2008 - StrCpy $0 "OSwarn" - ${Break} - - ${Case} 'XP' - ${If} $R2 > 0 - StrCpy $0 "OSwarnBetaSP" - ${ElseIf} $R1 < 2 - StrCpy $0 "OSabort" - ${Else} - StrCpy $0 "OSok" - ${EndIf} - ${Break} - - ${Case} 'Vista' - ${If} $R2 > 0 - StrCpy $0 "OSwarnBetaSP" - ${ElseIf} $R1 < 1 - StrCpy $0 "OSwarn" - ${Else} - StrCpy $0 "OSok" - ${EndIf} - ${Break} - - ${Default} - DetailPrint "unknown OS" - StrCpy $0 "OSabort" - ${Break} - - ${EndSwitch} - - ; show warnings for some OS - ${If} $0 == "OSabort" - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_WIN)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" - Abort - ${ElseIf} $0 == "OSwarn" - ${If} $DeployMode == 0 - MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" - ${EndIf} - ${ElseIf} $0 == "OSwarnBetaSP" - ${If} $DeployMode == 0 - MessageBox MB_YESNO|MB_ICONEXCLAMATION "You are using a beta Service Pack! $(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" - ${EndIf} - ${Else} - ; do nothing - ${EndIf} - -!macroend - -!macro AdditionalInformation - DetailPrint "" - DetailPrint "--------------------------------------" - DetailPrint "- Additional Information" - DetailPrint "--------------------------------------" - - ${If} ${VCRedistIsInstalled} - DetailPrint "X Visual C++ Redistributable is installed" - ${Else} - DetailPrint "! Visual C++ Redistributable is not installed" - ${EndIf} -!macroend - -!macro MediaPortalDirs - DetailPrint "" - DetailPrint "--------------------------------------" - DetailPrint "- Read MediaPortal directories" - DetailPrint "--------------------------------------" - - ${IfNot} ${MP023IsInstalled} - ${AndIfNot} ${MPIsInstalled} - DetailPrint "no MPIsInstalled" - ${else} - !insertmacro MP_GET_INSTALL_DIR $MPdir.Base - ${ReadMediaPortalDirs} $MPdir.Base - ${EndIf} - - DetailPrint "Found the following Entries:" - DetailPrint " Base: $MPdir.Base" - DetailPrint " Config: $MPdir.Config" - DetailPrint " Plugins: $MPdir.Plugins" - DetailPrint " Log: $MPdir.Log" - DetailPrint " CustomInputDevice: $MPdir.CustomInputDevice" - DetailPrint " CustomInputDefault: $MPdir.CustomInputDefault" - DetailPrint " Skin: $MPdir.Skin" - DetailPrint " Language: $MPdir.Language" - DetailPrint " Database: $MPdir.Database" - DetailPrint " Thumbs: $MPdir.Thumbs" - DetailPrint " Weather: $MPdir.Weather" - DetailPrint " Cache: $MPdir.Cache" - DetailPrint " BurnerSupport: $MPdir.BurnerSupport" - -!macroend - - - - -Section - ${LOG_OPEN} - - !insertmacro OperationSystemInformation - !insertmacro AdditionalInformation - - !insertmacro MediaPortalInstallation - !insertmacro MediaPortalDirs - - - - - MessageBox MB_ICONINFORMATION|MB_YESNO "Do kill process test?" IDNO noKillProcess - - ${KILLPROCESS} "MPInstaller.exe" - ${KILLPROCESS} "makensisw.exe" - ${KILLPROCESS} "Input Service Configuration.exe" - - DetailPrint "KillProcess FINISHED" - - noKillProcess: - - - - - -SectionEnd - -Function .onInstFailed - ${LOG_CLOSE} -FunctionEnd - -Function .onInstSuccess - ${LOG_CLOSE} -FunctionEnd - Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh 2009-02-10 22:00:46 UTC (rev 2630) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh 2009-02-10 22:07:21 UTC (rev 2631) @@ -1 +0,0 @@ -!define SVN_REVISION "$WCREV$" \ No newline at end of file Modified: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh 2009-02-10 22:00:46 UTC (rev 2630) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh 2009-02-10 22:07:21 UTC (rev 2631) @@ -23,37 +23,48 @@ #endregion -!ifndef svn_InstallScripts - !error "$\r$\n$\r$\n The DEFINE -> svn_InstallScripts <-- was not found.$\r$\n$\r$\n Please set the relative Path from your setup.nsi to the CommonNSIS script directory to the DEFINE svn_InstallScripts .$\r$\n$\r$\n" -!endif -# references to additional plugins, if not used, these won't be included -!AddPluginDir "${svn_InstallScripts}\GetVersion-plugin\Plugins" -!AddPluginDir "${svn_InstallScripts}\XML-plugin\Plugin" -!include "${svn_InstallScripts}\XML-plugin\Include\XML.nsh" +!ifndef ___COMMON_MP_MACROS__NSH___ +!define ___COMMON_MP_MACROS__NSH___ +!include LogicLib.nsh -!insertmacro GetRoot -!insertmacro un.GetRoot +!ifndef COMPANY + !define COMPANY "Team MediaPortal" +!endif +!ifndef URL + !define URL "www.team-mediaportal.com" +!endif +!ifndef WEB_REQUIREMENTS + !define WEB_REQUIREMENTS "http://wiki.team-mediaportal.com/GeneralRequirements/OperatingSystems" +!endif -!include WordFunc.nsh -!insertmacro WordFind -!insertmacro un.WordFind -!insertmacro WordReplace -!insertmacro un.WordReplace +!ifndef MP_REG_UNINSTALL + !define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" +!endif +!ifndef TV3_REG_UNINSTALL + !define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" +!endif -!include "${svn_InstallScripts}\include-FileAssociation.nsh" -#**********************************************************************************************************# + +# references to additional plugins, if not used, these won't be included +!AddPluginDir "${svn_InstallScripts}\GetVersion-plugin\Plugins" +!AddPluginDir "${svn_InstallScripts}\XML-plugin\Plugin" +!include "${svn_InstallScripts}\XML-plugin\Include\XML.nsh" + + +#--------------------------------------------------------------------------- +# NSIS logging system # -# logging system -# -#**********************************************************************************************************# -!ifdef INSTALL_LOG +# enable it by defining USE_INSTALL_LOG in parent script +#--------------------------------------------------------------------------- +!ifdef USE_INSTALL_LOG + !include FileFunc.nsh !insertmacro GetTime !insertmacro un.GetTime @@ -117,10 +128,10 @@ !if "${LEVEL}" != "INFO" !error "$\r$\n$\r$\nYou call macro LOG_TEXT with wrong LogLevel. Only 'DEBUG', 'ERROR' and 'INFO' are valid!$\r$\n$\r$\n" !else - DetailPrint "${prefix${LEVEL}}${TEXT}$\r$\n" + DetailPrint "${prefix${LEVEL}}${TEXT}" !endif !else - DetailPrint "${prefix${LEVEL}}${TEXT}$\r$\n" + DetailPrint "${prefix${LEVEL}}${TEXT}" !endif !endif @@ -128,7 +139,7 @@ !macroend -!else +!else #!USE_INSTALL_LOG !define LOG_OPEN `!insertmacro LOG_OPEN` !macro LOG_OPEN @@ -144,13 +155,9 @@ !endif - - -#**********************************************************************************************************# -# -# killing a process -# -#**********************************************************************************************************# +#--------------------------------------------------------------------------- +# KILL Process macro for common usage +#--------------------------------------------------------------------------- !define KILLPROCESS `!insertmacro KILLPROCESS` !macro KILLPROCESS PROCESS /* @@ -173,14 +180,6 @@ - - - - - - - - #Var AR_SecFlags #Var AR_RegFlags @@ -255,12 +254,6 @@ # #**********************************************************************************************************# -!ifndef MP_REG_UNINSTALL - !define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" -!endif -!ifndef TV3_REG_UNINSTALL - !define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" -!endif #**********************************************************************************************************# # LOGICLIB EXPRESSIONS @@ -442,6 +435,7 @@ SetRegView 32 ${If} ${TVServerIsInstalled} + ${OrIf} ${TVClientIsInstalled} ReadRegStr ${_var} HKLM "${TV3_REG_UNINSTALL}" "InstallPath" ${Else} StrCpy ${_var} "" @@ -449,6 +443,38 @@ !macroend +!macro MP_GET_VERSION _var + SetRegView 32 + + ${If} ${MPIsInstalled} + ReadRegDWORD $R0 HKLM "${MP_REG_UNINSTALL}" "VersionMajor" + ReadRegDWORD $R1 HKLM "${MP_REG_UNINSTALL}" "VersionMinor" + ReadRegDWORD $R2 HKLM "${MP_REG_UNINSTALL}" "VersionRevision" + ReadRegDWORD $R3 HKLM "${MP_REG_UNINSTALL}" "VersionBuild" + StrCpy ${_var} $R0.$R1.$R2.$R3 + ${Else} + StrCpy ${_var} "" + ${EndIf} + +!macroend + +!macro TVSERVER_GET_VERSION _var + SetRegView 32 + + ${If} ${TVServerIsInstalled} + ${OrIf} ${TVClientIsInstalled} + ReadRegDWORD $R0 HKLM "${TV3_REG_UNINSTALL}" "VersionMajor" + ReadRegDWORD $R1 HKLM "${TV3_REG_UNINSTALL}" "VersionMinor" + ReadRegDWORD $R2 HKLM "${TV3_REG_UNINSTALL}" "VersionRevision" + ReadRegDWORD $R3 HKLM "${TV3_REG_UNINSTALL}" "VersionBuild" + StrCpy ${_var} $R0.$R1.$R2.$R3 + ${Else} + StrCpy ${_var} "" + ${EndIf} + +!macroend + +!include FileFunc.nsh !insertmacro GetTime !macro GET_BACKUP_POSTFIX _var @@ -489,8 +515,12 @@ LangString TEXT_MSGBOX_ERROR_ON_UNINSTALL ${LANG_ENGLISH} "An error occured while trying to uninstall old version!$\r$\nDo you still want to continue the installation?" LangString TEXT_MSGBOX_ERROR_REBOOT_REQUIRED ${LANG_ENGLISH} "A reboot is required after a previous action. Reboot you system and try it again." +LangString UPDATE_ERROR_WRONGEXE ${LANG_ENGLISH} "updating $(^Name) is only allowed by starting MediaPortalUpdater!" +LangString UPDATE_ERROR_UNKNOWN ${LANG_ENGLISH} "strange / unknown error, please use full installer" +LangString UPDATE_ERROR_NOTHING_INSTALLED ${LANG_ENGLISH} "Nothing to do, nothing installed, please use the full installer" +LangString UPDATE_ERROR_VERSION_MP ${LANG_ENGLISH} "wrong version of MediaPortal is installed or svn, please use the full installer" +LangString UPDATE_ERROR_VERSION_TVSERVER ${LANG_ENGLISH} "wrong version or TVServer or Client plugin is installed or svn, please use the full installer" - /* ; Section flag test !macro _MPIsInstalled _a _b _t _f @@ -522,11 +552,13 @@ !define MPIsInstalled "!insertmacro _MPIsInstalled" */ +#--------------------------------------------------------------------------- +# Read Special MediaPortal directories from xml +# +# enable it by defining USE_READ_MP_DIRS in parent script +#--------------------------------------------------------------------------- +!ifdef USE_READ_MP_DIRS - -#*************************** -#*************************** - Var MyDocs Var UserAppData Var CommonAppData @@ -613,6 +645,12 @@ #*************************** #*************************** +!include FileFunc.nsh +!insertmacro GetRoot +!insertmacro un.GetRoot +!include WordFunc.nsh +!insertmacro WordReplace +!insertmacro un.WordReplace !macro ReadMPdir UNINSTALL_PREFIX DIR ${LOG_TEXT} "DEBUG" "macro: ReadMPdir | DIR: ${DIR}" @@ -715,9 +753,6 @@ !macroend -#*************************** -#*************************** - !define ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs ""` !define un.ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs "un."` !macro ReadMediaPortalDirs UNINSTALL_PREFIX INSTDIR @@ -772,46 +807,165 @@ ${LOG_TEXT} "INFO" " BurnerSupport: $MPdir.BurnerSupport" !macroend -!ifdef WINVER++ - !include "${svn_InstallScripts}\include-WinVerEx.nsh" +!endif # !USE_READ_MP_DIRS + + +#--------------------------------------------------------------------------- +# COMPLETE MEDIAPORTAL CLEANUP +#--------------------------------------------------------------------------- +!macro CompleteMediaPortalCleanup + +# make and uninstallation of the other app, which may be still installed +!if "${NAME}" == "MediaPortal" + !insertmacro NSISuninstall "${TV3_REG_UNINSTALL}" !else + !if "${NAME}" == "MediaPortal TV Server / Client" + !insertmacro NSISuninstall "${MP_REG_UNINSTALL}" + !endif +!endif -!macro GetServicePack _major _minor - Push $0 - Push $1 +SetShellVarContext all +# Delete new MediaPortal ( >= 0.2.3 RC3 ) and TVengine 3 directories +RMDir /r /REBOOTOK "$PROGRAMFILES\Team MediaPortal" +RMDir /r /REBOOTOK "$APPDATA\Team MediaPortal" +RMDir /r /REBOOTOK "$LOCALAPPDATA\VirtualStore\Program Files\Team MediaPortal" +RMDir /r /REBOOTOK "$LOCALAPPDATA\VirtualStore\ProgramData\Team MediaPortal" - ; result is: - ; "Service Pack 3" for final Service Packs - ; "Service Pack 3, v.3311" for beta Service Packs +# Delete old MediaPortal ( <= 0.2.3 RC2 ) directories +RMDir /r /REBOOTOK "$PROGRAMFILES\MediaPortal" +RMDir /r /REBOOTOK "$APPDATA\MediaPortal" +RMDir /r /REBOOTOK "$LOCALAPPDATA\VirtualStore\Program Files\MediaPortal" +RMDir /r /REBOOTOK "$LOCALAPPDATA\VirtualStore\ProgramData\MediaPortal" - GetVersion::WindowsServicePack - Pop $0 - ${LOG_TEXT} "INFO" "GetVersion::WindowsServicePack: $0" +# Delete old TV3 engine directories +RMDir /r /REBOOTOK "$PROGRAMFILES\MediaPortal TV Engine" +RMDir /r /REBOOTOK "$APPDATA\MediaPortal TV Engine" +RMDir /r /REBOOTOK "$LOCALAPPDATA\VirtualStore\Program Files\MediaPortal TV Engine" +RMDir /r /REBOOTOK "$LOCALAPPDATA\VirtualStore\ProgramData\MediaPortal TV Engine" - ;uncomment for testing - ;StrCpy $0 "Service Pack 3" - ;StrCpy $0 "Service Pack 3, v.3311" +# Delete menu shortcut icons +SetShellVarContext all +RMDir /r /REBOOTOK "$APPDATA\Microsoft\Windows\Start Menu\Programs\Team MediaPortal" +RMDir /r /REBOOTOK "$APPDATA\Microsoft\Windows\Start Menu\Programs\MediaPortal" +SetShellVarContext current +RMDir /r /REBOOTOK "$APPDATA\Microsoft\Windows\Start Menu\Programs\Team MediaPortal" +RMDir /r /REBOOTOK "$APPDATA\Microsoft\Windows\Start Menu\Programs\MediaPortal" +RMDir /r /REBOOTOK "$LOCALAPPDATA\Microsoft\Windows\Start Menu\Programs\Team MediaPortal" +RMDir /r /REBOOTOK "$LOCALAPPDATA\Microsoft\Windows\Start Menu\Programs\MediaPortal" - ; split the string by "." and save the word count in $2 - ; if no . is found in $2 the input string (was $0) is saved - ${WordFind} "$0" "." "#" $1 +# Remove registry keys +DeleteRegKey HKLM "Software\Team MediaPortal" +DeleteRegKey HKCU "Software\Team MediaPortal" - ; if $0 = $2 -> no "." was found -> no beta - ${If} "$0" == "$1" - StrCpy ${_major} $0 1 -1 ; "Service Pack 3" - StrCpy ${_minor} 0 +DeleteRegKey HKLM "Software\MediaPortal" +DeleteRegKey HKCU "Software\MediaPortal" + +!macroend + +!include FileFunc.nsh +!insertmacro un.GetParent +!macro NSISuninstall REG_KEY + + ReadRegStr $R0 HKLM "${REG_KEY}" UninstallString + ${If} ${FileExists} "$R0" + ; get parent folder of uninstallation EXE (RO) and save it to R1 + ${un.GetParent} $R0 $R1 + ; start uninstallation of installed MP, from tmp folder, so it will delete itself + ;HideWindow + ClearErrors + CopyFiles $R0 "$TEMP\uninstall-temp.exe" + ExecWait '"$TEMP\uninstall-temp.exe" _?=$R1 /RemoveAll' + ;BringToFront + + /* + ; if an error occured, ask to cancel installation + ${If} ${Errors} + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_ON_UNINSTALL)" IDYES +2 + Quit + ${EndIf} + */ + ${EndIf} +!macroend + + +#--------------------------------------------------------------------------- +# MediaPortal specific OS SystemCheck +#--------------------------------------------------------------------------- +!macro MediaPortalOperatingSystemCheck HideWarnings +# HideWarnings is used to disable some Warning MessageBoxes if needed, for example: if $DeployMode = 1 + + ; show error that the OS is not supported and abort the installation + ${If} ${AtMostWin2000Srv} + StrCpy $0 "OSabort" + ${ElseIf} ${IsWinXP} + !insertmacro GetServicePack $R1 $R2 + ${If} $R2 > 0 + StrCpy $0 "OSwarnBetaSP" + ${ElseIf} $R1 < 2 + StrCpy $0 "OSabort" + ${Else} + StrCpy $0 "OSok" + ${EndIf} + + ${ElseIf} ${IsWinXP64} + StrCpy $0 "OSabort" + + ${ElseIf} ${IsWin2003} + StrCpy $0 "OSwarn" + + ${ElseIf} ${IsWinVISTA} + !insertmacro GetServicePack $R1 $R2 + ${If} $R2 > 0 + StrCpy $0 "OSwarnBetaSP" + ${ElseIf} $R1 < 1 + StrCpy $0 "OSwarn" + ${Else} + StrCpy $0 "OSok" + ${EndIf} + + ${ElseIf} ${IsWin2008} + StrCpy $0 "OSwarn" + ${Else} - ${WordFind} "$0" "." "+1" $1 ; "Service Pack 3, v.3311" - StrCpy ${_major} $1 1 -4 ; "Service Pack 3, v" + StrCpy $0 "OSabort" + ${EndIf} - ;split again, and use the second word as minorVer - ${WordFind} "$0" "." "+2" ${_minor} ; "Service Pack 3, v.3311" + ; show warnings for some OS + ${If} $0 == "OSabort" + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_WIN)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${ElseIf} $0 == "OSwarn" + ${If} ${HideWarnings} == 0 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + ${EndIf} + ${ElseIf} $0 == "OSwarnBetaSP" + ${If} ${HideWarnings} == 0 + MessageBox MB_YESNO|MB_ICONEXCLAMATION "You are using a beta Service Pack! $(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + ${EndIf} + ${Else} + ; do nothing ${EndIf} - ;MessageBox MB_OK|MB_ICONEXCLAMATION "Service Pack: >${_major}< >${_minor}<" + ; check if current user is admin + UserInfo::GetOriginalAccountType + Pop $0 + #StrCmp $0 "Admin" 0 +3 + ${IfNot} $0 == "Admin" + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_ADMIN)" + Abort + ${EndIf} - pop $1 - pop $0 + ; check if VC Redist 2005 SP1 is installed + ${IfNot} ${VCRedistIsInstalled} + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_VCREDIST)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + !macroend -!endif \ No newline at end of file +!endif # !___COMMON_MP_MACROS__NSH___ + Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-DotNetFramework.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-DotNetFramework.nsh 2009-02-10 22:00:46 UTC (rev 2630) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-DotNetFramework.nsh 2009-02-10 22:07:21 UTC (rev 2631) @@ -1,191 +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 - -#**********************************************************************************************************# -# -# .NET Framework Detection -# -# code was taken from: -# http://nsis.sourceforge.net/How_to_Detect_any_.NET_Framework -# -#**********************************************************************************************************# - -# USAGE: - -;!define MIN_FRA_MAJOR "3" -;!define MIN_FRA_MINOR "0" -;!define MIN_FRA_BUILD "*" -;;NB Use an asterisk to match anything. -;Call AbortIfBadFramework -;; No pops. It just aborts inside the function, or returns if all is well. -;; Change this if you like. - -#**********************************************************************************************************# - -Function AbortIfBadFramework - - ;Save the variables in case something else is using them - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $R1 - Push $R2 - Push $R3 - Push $R4 - Push $R5 - Push $R6 - Push $R7 - Push $R8 - - StrCpy $R5 "0" - StrCpy $R6 "0" - StrCpy $R7 "0" - StrCpy $R8 "0.0.0" - StrCpy $0 0 - - loop: - - ;Get each sub key under "SOFTWARE\Microsoft\NET Framework Setup\NDP" - EnumRegKey $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP" $0 - StrCmp $1 "" done ;jump to end if no more registry keys - IntOp $0 $0 + 1 - StrCpy $2 $1 1 ;Cut off the first character - StrCpy $3 $1 "" 1 ;Remainder of string - - ;Loop if first character is not a 'v' - StrCmpS $2 "v" start_parse loop - - ;Parse the string - start_parse: - StrCpy $R1 "" - StrCpy $R2 "" - StrCpy $R3 "" - StrCpy $R4 $3 - - StrCpy $4 1 - - parse: - StrCmp $3 "" parse_done ;If string is empty, we are finished - StrCpy $2 $3 1 ;Cut off the first character - StrCpy $3 $3 "" 1 ;Remainder of string - StrCmp $2 "." is_dot not_dot ;Move to next part if it's a dot - - is_dot: - IntOp $4 $4 + 1 ; Move to the next section - goto parse ;Carry on parsing - - not_dot: - IntCmp $4 1 major_ver - IntCmp $4 2 minor_ver - IntCmp $4 3 build_ver - IntCmp $4 4 parse_done - - major_ver: - StrCpy $R1 $R1$2 - goto parse ;Carry on parsing - - minor_ver: - StrCpy $R2 $R2$2 - goto parse ;Carry on parsing - - build_ver: - StrCpy $R3 $R3$2 - goto parse ;Carry on parsing - - parse_done: - - IntCmp $R1 $R5 this_major_same loop this_major_more - this_major_more: - StrCpy $R5 $R1 - StrCpy $R6 $R2 - StrCpy $R7 $R3 - StrCpy $R8 $R4 - - goto loop - - this_major_same: - IntCmp $R2 $R6 this_minor_same loop this_minor_more - this_minor_more: - StrCpy $R6 $R2 - StrCpy $R7 R3 - StrCpy $R8 $R4 - goto loop - - this_minor_same: - IntCmp R3 $R7 loop loop this_build_more - this_build_more: - StrCpy $R7 $R3 - StrCpy $R8 $R4 - goto loop - - done: - - ;Have we got the framework we need? - IntCmp $R5 ${MIN_FRA_MAJOR} max_major_same fail end - max_major_same: - IntCmp $R6 ${MIN_FRA_MINOR} max_minor_same fail end - max_minor_same: - IntCmp $R7 ${MIN_FRA_BUILD} end fail end - - fail: - StrCmp $R8 "0.0.0" no_framework - goto wrong_framework - - no_framework: - MessageBox MB_OK|MB_ICONSTOP "Installation failed.$\n$\n\ - This software requires Windows Framework version \ - ${MIN_FRA_MAJOR}.${MIN_FRA_MINOR}.${MIN_FRA_BUILD} or higher.$\n$\n\ - No version of Windows Framework is installed.$\n$\n\ - Please update your computer at http://windowsupdate.microsoft.com/." - abort - - wrong_framework: - MessageBox MB_OK|MB_ICONSTOP "Installation failed!$\n$\n\ - This software requires Windows Framework version \ - ${MIN_FRA_MAJOR}.${MIN_FRA_MINOR}.${MIN_FRA_BUILD} or higher.$\n$\n\ - The highest version on this computer is $R8.$\n$\n\ - Please update your computer at http://windowsupdate.microsoft.com/." - abort - - end: - - ;Pop the variables we pushed earlier - Pop $R8 - Pop $R7 - Pop $R6 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Pop $R1 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - -FunctionEnd \ No newline at end of file Modified: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh 2009-02-10 22:00:46 UTC (rev 2630) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh 2009-02-10 22:07:21 UTC (rev 2631) @@ -43,19 +43,16 @@ #**********************************************************************************************************# +!ifndef ___FILE_ASSOCIATION__NSH___ +!define ___FILE_ASSOCIATION__NSH___ -!define registerExtension "!insertmacro registerExtension" -!define unregisterExtension "!insertmacro unregisterExtension" - -!macro registerExtension executable extension description - Push "${executable}" ; "full path to my.exe" - Push "${extension}" ; ".mkv" - Push "${description}" ; "MKV File" - Call registerExtension -!macroend - -; back up old value of .opt -Function registerExtension + +!define RegisterExtension `!insertmacro RegisterExtension ""` +!define un.RegisterExtension `!insertmacro RegisterExtension "un."` +!define UnRegisterExtension `!insertmacro UnRegisterExtension ""` +!define un.UnRegisterExtension `!insertmacro UnRegisterExtension "un."` + +!macro ___RegisterExtension___ !define Index "Line${__LINE__}" pop $R0 ; ext name pop $R1 @@ -80,15 +77,9 @@ pop $0 pop $1 !undef Index -FunctionEnd - -!macro unregisterExtension extension description - Push "${extension}" ; ".mkv" - Push "${description}" ; "MKV File" - Call un.unregisterExtension !macroend - -Function un.unregisterExtension + +!macro ___UnRegisterExtension___ pop $R1 ; description pop $R0 ; extension !define Index "Line${__LINE__}" @@ -104,4 +95,36 @@ DeleteRegKey HKCR $R1 ;Delete key with association name settings "${Index}-NoOwn:" !undef Index -FunctionEnd \ No newline at end of file +!macroend + + +Function RegisterExtension + !insertmacro ___RegisterExtension___ +FunctionEnd +Function un.RegisterExtension + !insertmacro ___RegisterExtension___ +FunctionEnd + +Function UnRegisterExtension + !insertmacro ___UnRegisterExtension___ +FunctionEnd +Function un.UnRegisterExtension + !insertmacro ___UnRegisterExtension___ +FunctionEnd + + +!macro RegisterExtension UNINSTALL_PREFIX executable extension description + Push "${executable}" ; "full path to my.exe" + Push "${extension}" ; ".mkv" + Push "${description}" ; "MKV File" + Call ${UNINSTALL_PREFIX}RegisterExtension +!macroend + +!macro UnRegisterExtension UNINSTALL_PREFIX extension description + Push "${extension}" ; ".mkv" + Push "${description}" ; "MKV File" + Call ${UNINSTALL_PREFIX}UnRegisterExtension +!macroend + +!endif # !___FILE_ASSOCIATION__NSH___ + Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-WinVerEx.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-WinVerEx.nsh 2009-02-10 22:00:46 UTC (rev 2630) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-WinVerEx.nsh 2009-02-10 22:07:21 UTC (rev 2631) @@ -1,253 +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 - -#**********************************************************************************************************# -# -# WinVer Extended -# -# code was taken from: -# https://sourceforge.net/tracker/?func=detail&atid=373088&aid=1949260&group_id=22049 -# -#**********************************************************************************************************# - -; LogicLib extensions for handling Windows versions. -; -; IsNT checks if the installer is running on Windows NT family (NT4, 2000, XP, etc.) -; -; ${If} ${IsNT} -; DetailPrint "Running on NT. Installing Unicode enabled application." -; ${Else} -; DetailPrint "Not running on NT. Installing ANSI application." -; ${EndIf} -; -; AtLeastWin<version> checks if the installer is running on Windows version at least as specified. -; IsWin<version> checks if the installer is running on Windows version exactly as specified. -; AtMostWin<version> checks if the installer is running on Windows version at most as specified. -; -; <version> can be replaced with the following values: -; -; 95 -; 98 -; ME -; -; NT4 -; 2000 -; 2000Srv -; XP -; XP64 -; 2003 -; Vista -; 2008 -; -; Usage examples: -; -; ${If} ${IsNT} -; DetailPrint "Running on NT family." -; DetailPrint "Surely not running on 95, 98 or ME." -; ${AndIf} ${AtLeastWinNT4} -; DetailPrint "Running on NT4 or better. Could even be 2003." -; ${EndIf} -; -; ${If} ${AtLeastWinXP} -; DetailPrint "Running on XP or better." -; ${EndIf} -; -; ${If} ${IsWin2000} -; DetailPrint "Running on 2000." -; ${EndIf} -; -; ${If} ${AtMostWinXP} -; DetailPrint "Running on XP or older. Surely not running on Vista. Maybe 98, or even 95." -; ${EndIf} -; -; Warning: -; -; Windows 95 and NT both use the same version number. To avoid getting NT4 misidentified -; as Windows 95 and vice-versa or 98 as a version higher than NT4, always use IsNT to -; check if running on the NT family. -; -; ${If} ${AtLeastWin95} -; ${And} ${AtMostWinME} -; DetailPrint "Running 95, 98 or ME." -; DetailPrint "Actually, maybe it's NT4?" -; ${If} ${IsNT} -; DetailPrint "Yes, it's NT4! oops..." -; ${Else} -; DetailPrint "Nope, not NT4. phew..." -; ${EndIf} -; ${EndIf} - -#**********************************************************************************************************# - -!verbose push -!verbose 3 - -!ifndef ___WINVER__NSH___ -!define ___WINVER__NSH___ - -!include LogicLib.nsh - -!define WINVER_95 0x4000 -!define WINVER_98 0x40A0 ;4.10 -!define WINVER_ME 0x45A0 ;4.90 - -!define WINVER_NT4 0x4000 -!define WINVER_2000 0x5000 -!define WINVER_2000Srv 0x5001 -!define WINVER_XP 0x5010 -!define WINVER_XP64 0x5020 -!define WINVER_2003 0x5021 -!define WINVER_VISTA 0x6000 -!define WINVER_2008 0x6001 - - -!macro __ParseWinVer - !insertmacro _LOGICLIB_TEMP - Push $0 - Push $1 - System::Call '*(i 148,i,i,i,i,&t128,&i2,&i2,&i2,&i1,&i1)i.r1' ;BUGBUG: no error handling for mem alloc failure! - System::Call 'kernel32::GetVersionEx(i r1)' - System::Call '*$1(i,i.r0)' - !define _WINVER_PARSEVER_OLDSYS _WINVER${__LINE__} - IntCmpU $0 5 0 ${_WINVER_PARSEVER_OLDSYS} ;OSVERSIONINFOEX can be used on NT4SP6 and later, but we only use it on NT5+ - System::Call '*$1(i 156)' - System::Call 'kernel32::GetVersionEx(i r1)' - ${_WINVER_PARSEVER_OLDSYS}: - !undef _WINVER_PARSEVER_OLDSYS - IntOp $_LOGICLIB_TEMP $0 << 12 ;we already have the major version in r0 - System::Call '*$1(i,i,i.r0)' - IntOp $0 $0 << 4 - IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP | $0 - System::Call '*$1(i,i,i,i,i,&t128,&i2,&i2,&i2,&i1.r0,&i1)' - !define _WINVER_PARSEVER_NOTNTSERVER _WINVER${__LINE__} - IntCmp $0 1 ${_WINVER_PARSEVER_NOTNTSERVER} ${_WINVER_PARSEVER_NOTNTSERVER} ;oviex.wProductType > VER_NT_WORKSTATION - IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP | 1 - ${_WINVER_PARSEVER_NOTNTSERVER}: - !undef _WINVER_PARSEVER_NOTNTSERVER - System::Free $1 - pop $1 - pop $0 -!macroend - -!macro _IsNT _a _b _t _f - !insertmacro _LOGICLIB_TEMP - System::Call kernel32::GetVersion()i.s - Pop $_LOGICLIB_TEMP - IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP & 0x80000000 - !insertmacro _== $_LOGICLIB_TEMP 0 `${_t}` `${_f}` -!macroend -!define IsNT `"" IsNT ""` - -!macro __WinVer_DefineOSTest Test OS - - !define ${Test}Win${OS} `"" WinVer${Test} ${WINVER_${OS}}` - -!macroend - -!macro __WinVer_DefineOSTests Test - - !insertmacro __WinVer_DefineOSTest ${Test} 95 - !insertmacro __WinVer_DefineOSTest ${Test} 98 - !insertmacro __WinVer_DefineOSTest ${Test} ME - !insertmacro __WinVer_DefineOSTest ${Test} NT4 - !insertmacro __WinVer_DefineOSTest ${Test} 2000 - !insertmacro __WinVer_DefineOSTest ${Test} 2000Srv - !insertmacro __WinVer_DefineOSTest ${Test} XP - !insertmacro __WinVer_DefineOSTest ${Test} XP64 - !insertmacro __WinVer_DefineOSTest ${Test} 2003 - !insertmacro __WinVer_DefineOSTest ${Test} VISTA - !insertmacro __WinVer_DefineOSTest ${Test} 2008 - -!macroend - -!macro _WinVerAtLeast _a _b _t _f - !insertmacro __ParseWinVer - !insertmacro _>= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}` -!macroend - -!macro _WinVerIs _a _b _t _f - !insertmacro __ParseWinVer - !insertmacro _= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}` -!macroend - -!macro _WinVerAtMost _a _b _t _f - !insertmacro __ParseWinVer - !insertmacro _<= $_LOGICLIB_TEMP `${_b}` `${_t}` `${_f}` -!macroend - -!insertmacro __WinVer_DefineOSTests AtLeast -!insertmacro __WinVer_DefineOSTests Is -!insertmacro __WinVer_DefineOSTests AtMost - - - -!macro GetServicePack _major _minor - - Push $0 - Push $1 - Push $2 - Push $3 - System::Call '*(i 148,i,i,i,i,&t128,&i2,&i2,&i2,&i1,&i1)i.r1' ;BUGBUG: no error handling for mem alloc failure! - System::Call 'kernel32::GetVersionEx(i r1)' - - ; using the service pack major number - ;System::Call '*$1(i,i,i,i,i,&t128,&i2.r0)' - - ; result is: - ; "Service Pack 3" for final Service Packs - ; "Service Pack 3, v.3311" for beta Service Packs - System::Call '*$1(i,i,i,i,i,&t128.r0)' - - ;uncomment for testing - ;StrCpy $0 "Service Pack 3" - ;StrCpy $0 "Service Pack 3, v.3311" - - ; split the string by "." and save the word count in $2 - ; if no . is found in $2 the input string (was $0) is saved - ${WordFind} "$0" "." "#" $2 - - ; if $0 = $2 -> no "." was found -> no beta - ${If} "$2" == "$0" - StrCpy ${_major} $0 1 -1 ; "Service Pack 3" - StrCpy ${_minor} 0 - ${Else} - StrCpy ${_major} 0 - ;split again, and use the second word as minorVer - ${WordFind} "$0" "." "+2" ${_minor} ; "Service Pack 3, v.3311" - ${EndIf} - - ;MessageBox MB_OK|MB_ICONEXCLAMATION "Service Pack: >${_major}< >${_minor}<" - - System::Free $1 - pop $3 - pop $2 - pop $1 - pop $0 - -!macroend - -!endif # !___WINVER__NSH___ - -!verbose pop \ No newline at end of file Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-02-10 22:00:46 UTC (rev 2630) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-02-10 22:07:21 UTC (rev 2631) @@ -5,18 +5,31 @@ ;====================================== -# DEFINES +#--------------------------------------------------------------------------- +# SPECIAL BUILDS +#--------------------------------------------------------------------------- +##### BUILD_TYPE +# Uncomment the following line to create a setup in debug mode +;!define BUILD_TYPE "Debug" +# parameter for command line execution: /DBUILD_TYPE=Debug +# by default BUILD_TYPE is set to "Release" +!ifndef BUILD_TYPE + !define BUILD_TYPE "Release" +!endif + + +#--------------------------------------------------------------------------- +# DEVELOPMENT ENVIRONMENT +#--------------------------------------------------------------------------- +# path definitions ;!define svn_ROOT_IRSS ".." ;!define svn_InstallScripts "${svn_ROOT_IRSS}\setup\CommonNSIS" !define svn_InstallScripts ".\CommonNSIS" -#**********************************************************************************************************# -# -# For building the installer on your own you need: -# - Lastest NSIS version from http://nsis.sourceforge.net/Download -# -#**********************************************************************************************************# +#--------------------------------------------------------------------------- +# DEFINES +#--------------------------------------------------------------------------- !define PRODUCT_NAME "IR Server Suite" !define PRODUCT_PUBLISHER "Aaron Dinnage (and-81)" !define PRODUCT_WEB_SITE "http://forum.team-mediaportal.com/mce_replacement_plugin-f165.html" @@ -54,18 +67,21 @@ ;====================================== -!include "x64.nsh" +!include x64.nsh !include MUI2.nsh !include Sections.nsh !include LogicLib.nsh !include Library.nsh !include FileFunc.nsh -!include WinVer.nsh -;!define WinVer++ ; this one is used by MP but not tested with irss !include Memento.nsh +!include WinVer.nsh -!include "${svn_InstallScripts}\include-AddRemovePage.nsh" + +!define USE_READ_MP_DIRS ; defines if MediaPortal's special directories needs to be read from config +!define USE_INSTALL_LOG ; enables logging during installation and uninstallation !include "${svn_InstallScripts}\include-CommonMPMacros.nsh" + +!include "${svn_InstallScripts}\include-AddRemovePage.nsh" !include setup-languages.nsh ; FileFunc macros @@ -168,24 +184,29 @@ !insertmacro "${MacroName}" "SectionInputService" !insertmacro "${MacroName}" "SectionMPCommon" - !insertmacro "${MacroName}" "SectionMPControlPlugin" - !insertmacro "${MacroName}" "SectionMPBlastZonePlugin" - !insertmacro "${MacroName}" "SectionTV2BlasterPlugin" + !insertmacro "${MacroName}" "SectionMPControlPlugin" + !insertmacro "${MacroName}" "SectionMPBlastZonePlugin" + !insertmacro "${MacroName}" "SectionTV2BlasterPlugin" !insertmacro "${MacroName}" "SectionTV3Common" - !insertmacro "${MacroName}" "SectionTV3BlasterPlugin" + !insertmacro "${MacroName}" "SectionTV3BlasterPlugin" + !insertmacro "${MacroName}" "SectionTV3PostInstall" ; !insertmacro "${MacroName}" "SectionMCEBlaster" + #SectionGroupTools + !insertmacro "${MacroName}" "SectionAbstractor" + !insertmacro "${MacroName}" "SectionDebugClient" + !insertmacro "${MacroName}" "SectionIRFileTool" + !insertmacro "${MacroName}" "SectionKeyboardInputRelay" !insertmacro "${MacroName}" "SectionTranslator" !insertmacro "${MacroName}" "SectionTrayLauncher" !insertmacro "${MacroName}" "SectionVirtualRemote" + + #SectionGroupCmdLineTools !insertmacro "${MacroName}" "SectionIRBlast" - !insertmacro "${MacroName}" "SectionIRFileTool" - !insertmacro "${MacroName}" "SectionKeyboardInputRelay" !insertmacro "${MacroName}" "SectionDboxTuner" !insertmacro "${MacroName}" "SectionHcwPvrTuner" - !insertmacro "${MacroName}" "SectionDebugClient" !macroend ;====================================== @@ -235,22 +256,6 @@ DetailPrint "Preparing to install ..." - ; Use the all users context - SetShellVarContext all - - ; Kill running Programs - DetailPrint "Attempting to terminate running processes ..." - ${KILLPROCESS} "Translator.exe" - ${KILLPROCESS} "TrayLauncher.exe" - ${KILLPROCESS} "WebRemote.exe" - ${KILLPROCESS} "VirtualRemote.exe" - ${KILLPROCESS} "VirtualRemoteSkinEditor.exe" - ${KILLPROCESS} "IRFileTool.exe" - ${KILLPROCESS} "DebugClient.exe" - ${KILLPROCESS} "KeyboardInputRelay.exe" - ${KILLPROCESS} "MediaCenterBlaster.exe" - ${KILLPROCESS} "Input Service Configuration.exe" - IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" StopInputService SkipStopInputService StopInputService: @@ -281,7 +286,6 @@ ; Create app data directories SetOutPath "$DIR_INSTALL" - SetOverwrite ifnewer File "..\Documentation\${PRODUCT_NAME}.chm" @@ -295,6 +299,7 @@ SetOutPath "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" SetOverwrite ifnewer File /r /x .svn "..\Set Top Boxes\*.*" + SetOverwrite on ; Create a start menu shortcut folder CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" @@ -304,9 +309,9 @@ ;====================================== ${MementoSection} "Input Service" SectionInputService + ${LOG_TEXT} "INFO" "Installing Input Service..." + ${KILLPROCESS} "Input Service Configuration.exe" - DetailPrint "Installing Input Service ..." - ; Use the all users context SetShellVarContext all @@ -319,23 +324,22 @@ SkipUninstallInputService: Sleep 100 - ; Installing Input Service - CreateDirectory "$DIR_INSTALL\Input Service" + + ${LOG_TEXT} "INFO" "Installing Input Service..." SetOutPath "$DIR_INSTALL\Input Service" - SetOverwrite ifnewer File "..\Input Service\Input Service\bin\${Build_Type}\*.*" - ; Installing Input Service Configuration - CreateDirectory "$DIR_INSTALL\Input Service Configuration" + ${LOG_TEXT} "INFO" "Installing Input Service Configuration..." SetOutPath "$DIR_INSTALL\Input Service Configuration" - SetOverwrite ifnewer File "..\Input Service\Input Service Configuration\bin\${Build_Type}\*.*" - ; Install IR Server Plugins ... - DetailPrint "Installing IR Server Plugins ..." - CreateDirectory "$DIR_INSTALL\IR Server Plugins" + ${LOG_TEXT} "INFO" "Installing IR Server..." + SetOutPath "$DIR_INSTALL\Input Service" + File "..\Applications\IR Server\bin\${Build_Type}\*.*" + + + ${LOG_TEXT} "INFO" "Installing IR Server Plugins..." SetOutPath "$DIR_INSTALL\IR Server Plugins" - SetOverwrite ifnewer File "..\IR Server Plugins\Ads Tech PTV-335 Receiver\bin\${Build_Type}\Ads Tech PTV-335 Receiver.*" File "..\IR Server Plugins\CoolCommand Receiver\bin\${Build_Type}\CoolCommand Receiver.*" @@ -379,11 +383,11 @@ CreateDirectory "$APPDATA\${PRODUCT_NAME}\Input Service" ; Copy Abstract Remote maps - 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" + SetOverwrite on ; 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 @@ -394,47 +398,47 @@ ${MementoSectionEnd} !macro Remove_${SectionInputService} - DetailPrint "Attempting to remove Input Service ..." + ${LOG_TEXT} "INFO" "Removing Input Service..." + ${KILLPROCESS} "Input Service Configuration.exe" ; remove Input Service ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /uninstall' - ; remove Start Menu shortcuts + ; remove start menu shortcuts Delete "$SMPROGRAMS\${PRODUCT_NAME}\Input Service Configuration.lnk" ; remove files RMDir /R /REBOOTOK "$DIR_INSTALL\Input Service" RMDir /R /REBOOTOK "$DIR_INSTALL\Input Service Configuration" + RMDir /R /REBOOTOK "$DIR_INSTALL\IR Server" RMDir /R /REBOOTOK "$DIR_INSTALL\IR Server Plugins" !macroend ;====================================== -SectionGroup /e "MediaPortal plugins" SectionGroupMP +SectionGroup "MediaPortal plugins" SectionGroupMP Section "-commonMP" SectionMPCommon + ${LOG_TEXT} "INFO" "Installing common files for MediaPortal plugins..." + ${KILLPROCESS} "MediaPortal.exe" + ${KILLPROCESS} "configuration.exe" - DetailPrint "Installing common files for MediaPortal plugins ..." - - ; Use the all users context - SetShellVarContext all - ; Write plugin dll SetOutPath "$MPdir.Plugins\Process" - SetOverwrite ifnewer File "..\Common\MPUtils\bin\${Build_Type}\MPUtils.*" File "..\Common\IrssComms\bin\${Build_Type}\IrssComms.*" File "..\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" ; Write plugin dll SetOutPath "$MPdir.Plugins\Windows" - SetOverwrite ifnewer File "..\Common\MPUtils\bin\${Build_Type}\MPUtils.*" File "..\Common\IrssComms\bin\${Build_Type}\IrssComms.*" File "..\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" SectionEnd !macro Remove_${SectionMPCommon} - DetailPrint "Attempting to remove common files for MediaPortal plugins ..." + ${LOG_TEXT} "INFO" "Removing common files for MediaPortal plugins..." + ${KILLPROCESS} "MediaPortal.exe" + ${KILLPROCESS} "configuration.exe" ; remove files Delete /REBOOTOK "$MPdir.Plugins\Process\MPUtils.*" @@ -448,20 +452,14 @@ ;====================================== ${MementoSection} "MP Control Plugin" SectionMPControlPlugin + ${LOG_TEXT} "INFO" "Installing MP Control Plugin..." - DetailPrint "Installing MP Control Plugin ..." - - ; Use the all users context - SetShellVarContext all - ; Write plugin dll SetOutPath "$MPdir.Plugins\Process" - SetOverwrite ifnewer File "..\MediaPortal Plugins\MP Control Plugin\bin\${Build_Type}\MPControlPlugin.*" ; Write input mapping SetOutPath "$MPdir.CustomInputDefault" - SetOverwrite ifnewer File "..\MediaPortal Plugins\MP Control Plugin\InputMapping\MPControlPlugin.xml" ; Write app data @@ -469,13 +467,14 @@ SetOutPath "$APPDATA\${PRODUCT_NAME}\MP Control Plugin" SetOverwrite ifnewer File /r /x .svn "..\MediaPortal Plugins\MP Control Plugin\AppData\*.*" + SetOverwrite on ; Create Macro folder CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Control Plugin\Macro" ${MementoSectionEnd} !macro Remove_${SectionMPControlPlugin} - DetailPrint "Attempting to remove MediaPortal Control Plugin ..." + ${LOG_TEXT} "INFO" "MP Control Plugin..." Delete /REBOOTOK "$MPdir.Plugins\Process\MPControlPlugin.*" !macroend @@ -483,15 +482,13 @@ ;====================================== ${MementoUnselectedSection} "MP Blast Zone Plugin" SectionMPBlastZonePlugin + ${LOG_TEXT} "INFO" "Installing MP Blast Zone Plugin..." - DetailPrint "Installing MP Blast Zone Plugin ..." - ; Use the all users context SetShellVarContext all ; Write plugin dll SetOutPath "$MPdir.Plugins\Windows" - SetOverwrite ifnewer File "..\MediaPortal Plugins\MP Blast Zone Plugin\bin\${Build_Type}\MPBlastZonePlugin.*" ; Write app data @@ -499,14 +496,13 @@ SetOutPath "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin" SetOverwrite off File "..\MediaPortal Plugins\MP Blast Zone Plugin\AppData\Menu.xml" + SetOverwrite on ; Write skin files - SetOutPath "$MPdir.Skin\BlueTwo" - SetOverwrite on + SetOutPath "$MPdir.Skin\Blue3" File /r /x .svn "..\MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" - SetOutPath "$MPdir.Skin\BlueTwo wide" - SetOverwrite on + SetOutPath "$MPdir.Skin\Blue3wide" File /r /x .svn "..\MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" ; Create Macro folder @@ -514,7 +510,7 @@ ${MementoSectionEnd} !macro Remove_${SectionMPBlastZonePlugin} - DetailPrint "Attempting to remove MediaPortal Blast Zone Plugin ..." + ${LOG_TEXT} "INFO" "Removing MP Blast Zone Plugin..." Delete /REBOOTOK "$MPdir.Plugins\Windows\MPBlastZonePlugin.*" !macroend @@ -522,15 +518,10 @@ ;====================================== ${MementoUnselectedSection} "TV2 Blaster Plugin" SectionTV2BlasterPlugin + ${LOG_TEXT} "INFO" "Installing TV2 Blaster Plugin..." - DetailPrint "Installing TV2 Blaster Plugin ..." - - ; Use the all users context - SetShellVarContext all - ; Write plugin dll SetOutPath "$MPdir.Plugins\Process" - SetOverwrite ifnewer File "..\MediaPortal Plugins\TV2 Blaster Plugin\bin\${Build_Type}\TV2BlasterPlugin.*" ; Create folders @@ -539,7 +530,7 @@ ${MementoSectionEnd} !macro Remove_${SectionTV2BlasterPlugin} - DetailPrint "Attempting to remove MediaPortal TV2 Plugin ..." + ${LOG_TEXT} "INFO" "Removing TV2 Blaster Plugin..." Delete /REBOOTOK "$MPdir.Plugins\Process\TV2BlasterPlugin.*" !macroend @@ -549,44 +540,63 @@ SectionGroupEnd ;====================================== +Var RestartTvService +!macro StopTVService -SectionGroup /e "TV Server plugins" SectionGroupTV3 + ; stopping TV Service + ; if TV service was Running, and has been stopped correctly $RestartTvService = 0 , otherwise 1 or 2 ............ + ${LOG_TEXT} "INFO" "Stopping TV Service..." + nsExec::ExecToLog 'net stop TVservice' + Pop $RestartTvService + + ${KILLPROCESS} "TVService.exe" + ${KILLPROCESS} "SetupTv.exe" -Section "-commonTV3" SectionTV3Common +!macroend +!macro StartTVService + ; only if TVService was stopped by the installer before, correctly, start it now + ${If} $RestartTvService == 0 + ${LOG_TEXT} "INFO" "Starting TV Service..." + nsExec::ExecToLog 'net start TVservice' + StrCpy $RestartTvService 1 + ${EndIf} +!macroend - DetailPrint "Installing common files for TV Server plugins ..." +SectionGroup "TV Server plugins" SectionGroupTV3 - ; Use the all users context - SetShellVarContext all +Section "-commonTV3" SectionTV3Common + ${LOG_TEXT} "INFO" "Installing common files for TV Server plugins..." + !insertmacro StopTVService ; Write plugin dll SetOutPath "$DIR_TVSERVER\Plugins" - SetOverwrite ifnewer File "..\Common\MPUtils\bin\${Build_Type}\MPUtils.*" File "..\Common\IrssComms\bin\${Build_Type}\IrssComms.*" File "..\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" SectionEnd !macro Remove_${SectionTV3Common} - DetailPrint "Attempting to remove common files for TV Server plugins ..." + ${If} ${FileExists} "$DIR_TVSERVER\Plugins\MPUtils.*" + ${OrIf} ${FileExists} "$DIR_TVSERVER\Plugins\IrssComms.*" + ${OrIf} ${FileExists} "$DIR_TVSERVER\Plugins\IrssUtils.*" - ; remove files - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\MPUtils.*" - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\IrssComms.*" - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\IrssUtils.*" + ${LOG_TEXT} "INFO" "Removing common files for TV Server plugins..." + !insertmacro StopTVService + + ; remove files + Delete /REBOOTOK "$DIR_TVSERVER\Plugins\MPUtils.*" + Delete /REBOOTOK "$DIR_TVSERVER\Plugins\IrssComms.*" + Delete /REBOOTOK "$DIR_TVSERVER\Plugins\IrssUtils.*" + + ${EndIf} !macroend ;====================================== -${MementoSection} "TV3 Blaster Plugin" SectionTV3BlasterPlugin +${MementoSection} "TV Server Blaster Plugin" SectionTV3BlasterPlugin + ${LOG_TEXT} "INFO" "Installing TV Server Blaster Plugin..." - 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\${Build_Type}\TV3BlasterPlugin.*" ; Create folders @@ -595,13 +605,25 @@ ${MementoSectionEnd} !macro Remove_${SectionTV3BlasterPlugin} - DetailPrint "Attempting to remove MediaPortal TV3 Plugin ..." + ${If} ${FileExists} "$DIR_TVSERVER\Plugins\MPUtils.*" - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\TV3BlasterPlugin.*" + ${LOG_TEXT} "INFO" "Removing TV Server Blaster Plugin..." + !insertmacro StopTVService + + Delete /REBOOTOK "$DIR_TVSERVER\Plugins\TV3BlasterPlugin.*" + + ${EndIf} !macroend ;====================================== +Section "-TV3PostInstall" SectionTV3PostInstall + !insertmacro StartTVService +SectionEnd +!macro Remove_${SectionTV3PostInstall} + !insertmacro StartTVService +!macroend + SectionGroupEnd ;====================================== @@ -609,16 +631,15 @@ SectionGroup /e "Media Center add-ons" SectionGroupMCE ${MementoUnselectedSection} "Media Center Blaster (experimental)" SectionMCEBlaster + ${LOG_TEXT} "INFO" "Installing MediaCenterBlaster..." + ${KILLPROCESS} "MediaCenterBlaster.exe" - DetailPrint "Installing Media Center Blaster ..." - ; Use the all users context SetShellVarContext all ; Installing Translator CreateDirectory "$DIR_INSTALL\Media Center Blaster" SetOutPath "$DIR_INSTALL\Media Center Blaster" - SetOverwrite ifnewer File "..\Applications\Media Center Blaster\bin\${Build_Type}\*.*" ; Create folders @@ -630,7 +651,8 @@ ${MementoSectionEnd} !macro Remove_${SectionMCEBlaster} - DetailPrint "Attempting to remove Media Center Blaster ..." + ${LOG_TEXT} "INFO" "Removing MediaCenterBlaster..." + ${KILLPROCESS} "MediaCenterBlaster.exe" ; Remove auto-run DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Media Center Blaster" @@ -648,40 +670,149 @@ */ ;====================================== -${MementoSection} "Translator" SectionTranslator +SectionGroup "Tools" SectionGroupTools - DetailPrint "Installing Translator ..." +${MementoSection} "Abstractor" SectionAbstractor + ${LOG_TEXT} "INFO" "Installing Abstractor..." + ${KILLPROCESS} "Abstractor.exe" - ; Use the all users context - SetShellVarContext all + ; install files + SetOutPath "$DIR_INSTALL\Abstractor" + File "..\Applications\Abstractor\bin\${Build_Type}\*.*" - ; Installing Translator - CreateDirectory "$DIR_INSTALL\Translator" + ; create start menu shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" "$DIR_INSTALL\Translator\Translator.exe" "" "$DIR_INSTALL\Translator\Translator.exe" 0 + +${MementoSectionEnd} +!macro Remove_${SectionAbstractor} + ${LOG_TEXT} "INFO" "Removing Abstractor..." + ${KILLPROCESS} "Abstractor.exe" + + ; remove start menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Abstractor.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Abstractor" +!macroend + +;====================================== + +${MementoSection} "Debug Client" SectionDebugClient + ${LOG_TEXT} "INFO" "Installing Debug Client..." + ${KILLPROCESS} "DebugClient.exe" + + ; install files + SetOutPath "$DIR_INSTALL\Debug Client" + File "..\Applications\Debug Client\bin\${Build_Type}\*.*" + + ; create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\Debug Client" + + ; create start menu shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Debug Client.lnk" "$DIR_INSTALL\Debug Client\DebugClient.exe" "" "$DIR_INSTALL\Debug Client\DebugClient.exe" 0 + +${MementoSectionEnd} +!macro Remove_${SectionDebugClient} + ${LOG_TEXT} "INFO" "Removing Debug Client..." + ${KILLPROCESS} "DebugClient.exe" + + ; remove start menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Debug Client.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Debug Client" +!macroend + +;====================================== + +${MementoSection} "IR File Tool" SectionIRFileTool + ${LOG_TEXT} "INFO" "Installing IR File Tool..." + ${KILLPROCESS} "IRFileTool.exe" + + ; install files + SetOutPath "$DIR_INSTALL\IR File Tool" + File "..\Applications\IR File Tool\bin\${Build_Type}\*.*" + + ; create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\IR File Tool" + + ; create start menu shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\IR File Tool.lnk" "$DIR_INSTALL\IR File Tool\IRFileTool.exe" "" "$DIR_INSTALL\IR F... [truncated message content] |