From: <che...@us...> - 2008-11-12 14:58:47
|
Revision: 2329 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2329&view=rev Author: chef_koch Date: 2008-11-12 14:58:34 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Added Paths: ----------- trunk/plugins/IR Server Suite/setup/CommonNSIS/ trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-languages.nsh Removed Paths: ------------- trunk/plugins/IR Server Suite/setup/setup-AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/setup-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/setup-languages.nsh Copied: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh (from rev 2328, trunk/plugins/IR Server Suite/setup/setup-AddRemovePage.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh 2008-11-12 14:58:34 UTC (rev 2329) @@ -0,0 +1,162 @@ +#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. +# +#**********************************************************************************************************# + +!include WordFunc.nsh +!include FileFunc.nsh + +!insertmacro VersionCompare +!insertmacro GetParent + +##### Add/Remove/Reinstall page +Var ReinstallPageCheck + +Function PageReinstall + ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "InstallPath" + + ${If} $R0 == "" + Abort + ${EndIf} + + ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" + ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" + ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" + ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" + StrCpy $R0 $R0.$R1.$R2.$R3 + + ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0 + ${If} $R0 == 0 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" + StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" + StrCpy $R0 "2" + ${ElseIf} $R0 == 1 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + StrCpy $R0 "1" + ${ElseIf} $R0 == 2 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + StrCpy $R0 "1" + ${Else} + Abort + ${EndIf} + + nsDialogs::Create /NOUNLOAD 1018 + + ${NSD_CreateLabel} 0 0 100% 24u $R1 + Pop $R1 + + ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 + Pop $R2 + ${NSD_OnClick} $R2 PageReinstallUpdateSelection + + ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 + Pop $R3 + ${NSD_OnClick} $R3 PageReinstallUpdateSelection + + ${If} $ReinstallPageCheck != 2 + SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${Else} + SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${EndIf} + + nsDialogs::Show +FunctionEnd + +Function PageReinstallUpdateSelection + Pop $R1 + + ${NSD_GetState} $R2 $R1 + + ${If} $R1 == ${BST_CHECKED} + StrCpy $ReinstallPageCheck 1 + ${Else} + StrCpy $ReinstallPageCheck 2 + ${EndIf} + +FunctionEnd + +Function PageLeaveReinstall + ${NSD_GetState} $R2 $R1 + + StrCmp $R0 "1" 0 +2 + StrCmp $R1 "1" doUninstall finish + StrCmp $R0 "2" 0 +3 + StrCmp $R1 "1" finish doUninstall + + doUninstall: + ; check if MP is already installed + ReadRegStr $R0 HKLM "${REG_UNINSTALL}" UninstallString + ${If} ${FileExists} "$R0" + ; get parent folder of uninstallation EXE (RO) and save it to R1 + ${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' + 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} + + ; if reboot flag is set, abort the installation, and continue the installer on next startup + ${If} ${FileExists} "$INSTDIR\rebootflag" + MessageBox MB_OK|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "$(^Name)" $EXEPATH + Quit + ${EndIf} + + finish: +FunctionEnd + + + +LangString TEXT_ADDREMOVE_HEADER ${LANG_ENGLISH} "Already Installed" +LangString TEXT_ADDREMOVE_HEADER2_REPAIR ${LANG_ENGLISH} "Choose the maintenance option to perform." +LangString TEXT_ADDREMOVE_HEADER2_UPDOWN ${LANG_ENGLISH} "Choose how you want to install $(^Name)." +LangString TEXT_ADDREMOVE_INFO_REPAIR ${LANG_ENGLISH} "$(^Name) ${VERSION} is already installed. Select the operation you want to perform and click Next to continue." +LangString TEXT_ADDREMOVE_INFO_UPGRADE ${LANG_ENGLISH} "An older version of $(^Name) is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue." +LangString TEXT_ADDREMOVE_INFO_DOWNGRADE ${LANG_ENGLISH} "A newer version of $(^Name) is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue." +LangString TEXT_ADDREMOVE_REPAIR_OPT1 ${LANG_ENGLISH} "Add/Remove/Reinstall components" +LangString TEXT_ADDREMOVE_REPAIR_OPT2 ${LANG_ENGLISH} "Uninstall $(^Name)" +LangString TEXT_ADDREMOVE_UPDOWN_OPT1 ${LANG_ENGLISH} "Uninstall before installing" +LangString TEXT_ADDREMOVE_UPDOWN_OPT2 ${LANG_ENGLISH} "Do not uninstall" \ No newline at end of file Property changes on: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh (from rev 2328, trunk/plugins/IR Server Suite/setup/setup-CommonMPMacros.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh 2008-11-12 14:58:34 UTC (rev 2329) @@ -0,0 +1,800 @@ +#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 + +!include /nonFatal "XML.nsh" +!ifndef xml::SetCondenseWhiteSpace + !error "$\r$\n$\r$\nYou need the xml plugin to compile this script. Look at$\r$\n$\r$\n http://nsis.sourceforge.net/XML_plug-in$\r$\n$\r$\ndownload and install it!$\r$\n$\r$\n" +!endif + +!include FileFunc.nsh +!insertmacro GetRoot +!insertmacro un.GetRoot + +!include WordFunc.nsh +!insertmacro WordReplace +!insertmacro un.WordReplace + + + +#**********************************************************************************************************# +# +# code for file association was taken from: +# http://nsis.sourceforge.net/File_Association +# +#**********************************************************************************************************# +!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 Index "Line${__LINE__}" + pop $R0 ; ext name + pop $R1 + pop $R2 + push $1 + push $0 + ReadRegStr $1 HKCR $R1 "" + StrCmp $1 "" "${Index}-NoBackup" + StrCmp $1 "OptionsFile" "${Index}-NoBackup" + WriteRegStr HKCR $R1 "backup_val" $1 +"${Index}-NoBackup:" + WriteRegStr HKCR $R1 "" $R0 + ReadRegStr $0 HKCR $R0 "" + StrCmp $0 "" 0 "${Index}-Skip" + WriteRegStr HKCR $R0 "" $R0 + WriteRegStr HKCR "$R0\shell" "" "open" + WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" +"${Index}-Skip:" + WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' + WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" + WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' + 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 + pop $R1 ; description + pop $R0 ; extension +!define Index "Line${__LINE__}" + ReadRegStr $1 HKCR $R0 "" + StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it + ReadRegStr $1 HKCR $R0 "backup_val" + StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key + DeleteRegKey HKCR $R0 + Goto "${Index}-NoOwn" +"${Index}-Restore:" + WriteRegStr HKCR $R0 "" $1 + DeleteRegValue HKCR $R0 "backup_val" + DeleteRegKey HKCR $R1 ;Delete key with association name settings +"${Index}-NoOwn:" +!undef Index +FunctionEnd + + + +#**********************************************************************************************************# +# +# logging system +# +#**********************************************************************************************************# +!ifdef INSTALL_LOG +!ifndef INSTALL_LOG_FILE + !ifndef COMMON_APPDATA + !error "$\r$\n$\r$\nCOMMON_APPDATA is not defined!$\r$\n$\r$\n" + !endif + + !define INSTALL_LOG_FILE "${COMMON_APPDATA}\Logs\install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}.log" +!endif + +Var LogFile + +!define prefixERROR "[ERROR !!!] " +!define prefixDEBUG "[ DEBUG ] " +!define prefixINFO "[ INFO] " + +!define LOG_OPEN `!insertmacro LOG_OPEN` +!macro LOG_OPEN + + FileOpen $LogFile "$TEMP\install_$(^Name).log" w + +!macroend + +!define LOG_CLOSE `!insertmacro LOG_CLOSE` +!macro LOG_CLOSE + + FileClose $LogFile + + CopyFiles "$TEMP\install_$(^Name).log" "${INSTALL_LOG_FILE}" + +!macroend + +!define LOG_TEXT `!insertmacro LOG_TEXT` +!macro LOG_TEXT LEVEL TEXT + +!if "${LEVEL}" != "DEBUG" + !if "${LEVEL}" != "ERROR" + !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" + !endif + !endif +!endif + + FileWrite $LogFile "${prefix${LEVEL}}${TEXT}$\r$\n" + +!macroend + +!else + +!define LOG_OPEN `!insertmacro LOG_OPEN` +!macro LOG_OPEN +!macroend + +!define LOG_CLOSE `!insertmacro LOG_CLOSE` +!macro LOG_CLOSE +!macroend + +!define LOG_TEXT `!insertmacro LOG_TEXT` +!macro LOG_TEXT LEVEL TEXT +!macroend + +!endif + + + +#**********************************************************************************************************# +# +# killing a process +# +#**********************************************************************************************************# +!define KILLPROCESS `!insertmacro KILLPROCESS` +!macro KILLPROCESS PROCESS +!if ${KILLMODE} == "1" + ExecShell "" "Cmd.exe" '/C "taskkill /F /IM "${PROCESS}""' SW_HIDE + Sleep 300 +!else if ${KILLMODE} == "2" + ExecWait '"taskkill" /F /IM "${PROCESS}"' +!else if ${KILLMODE} == "3" + nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' +!else + + nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' + +!endif +!macroend + + + + + + + + + + + +#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 + +!macro DisableComponent SectionName AddText + !insertmacro UnselectSection "${SectionName}" + ; Make the unselected section read only + !insertmacro SetSectionFlag "${SectionName}" 16 + SectionGetText ${SectionName} $R0 + SectionSetText ${SectionName} "$R0${AddText}" +!macroend + + + +#**********************************************************************************************************# +# +# Useful macros for MediaPortal and addtional Software which can be used like other LogicLib expressions. +# +#**********************************************************************************************************# + +!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 + +;====================================== OLD MP INSTALLATION TESTs + +# old installations < 0.2.3.0 RC 3 +!macro _MP022IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87819CFA-1786-484D-B0DE-10B5FBF2625D}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MP022IsInstalled `"" MP022IsInstalled ""` + +!macro _MP023RC3IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0 RC3" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MP023RC3IsInstalled `"" MP023RC3IsInstalled ""` + +!macro _MP023IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MP023IsInstalled `"" MP023IsInstalled ""` + +;====================================== OLD TVServer/TVClient INSTALLATION TESTs + +!macro _MSI_TVServerIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B738773-EE07-413D-AFB7-BB0AB04A5488}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MSI_TVServerIsInstalled `"" MSI_TVServerIsInstalled ""` + +!macro _MSI_TVClientIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F7444E89-5BC0-497E-9650-E50539860DE0}" "UninstallString" + IfErrors 0 `${_t}` + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FD9FD453-1C0C-4EDA-AEE6-D7CF0E9951CA}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MSI_TVClientIsInstalled `"" MSI_TVClientIsInstalled ""` + +;====================================== + +!macro _MPIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${MP_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MPIsInstalled `"" MPIsInstalled ""` + +!macro _TVServerIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP 0 `${_f}` + + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecServer" + StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` +!macroend +!define TVServerIsInstalled `"" TVServerIsInstalled ""` + +!macro _TVClientIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP 0 `${_f}` + + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecClient" + StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` +!macroend +!define TVClientIsInstalled `"" TVClientIsInstalled ""` + +;====================================== 3rd PARTY APPLICATION TESTs + +!macro _VCRedistIsInstalled _a _b _t _f + + ClearErrors + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors `${_f}` + + StrCpy $R1 $R0 3 + + StrCmp $R1 '5.1' lbl_winnt_XP + StrCmp $R1 '5.2' lbl_winnt_2003 + StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` + + + lbl_winnt_vista: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.762_none_11ecb0ab9b2caf3c.manifest" 0 `${_f}` + Goto `${_t}` + + lbl_winnt_2003: + lbl_winnt_XP: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_cbb27474.manifest" 0 `${_f}` + Goto `${_t}` +!macroend +!define VCRedistIsInstalled `"" VCRedistIsInstalled ""` + +!macro _dotNetIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + + ReadRegStr $4 HKLM "Software\Microsoft\.NETFramework" "InstallRoot" + # remove trailing back slash + Push $4 + Exch $EXEDIR + Exch $EXEDIR + Pop $4 + # if the root directory doesn't exist .NET is not installed + IfFileExists $4 0 `${_f}` + + StrCpy $0 0 + + EnumStart: + + EnumRegKey $2 HKLM "Software\Microsoft\.NETFramework\Policy" $0 + IntOp $0 $0 + 1 + StrCmp $2 "" `${_f}` + + StrCpy $1 0 + + EnumPolicy: + + EnumRegValue $3 HKLM "Software\Microsoft\.NETFramework\Policy\$2" $1 + IntOp $1 $1 + 1 + StrCmp $3 "" EnumStart + IfFileExists "$4\$2.$3" `${_t}` EnumPolicy +!macroend +!define dotNetIsInstalled `"" dotNetIsInstalled ""` + +#**********************************************************************************************************# +# Get MP infos +!macro MP_GET_INSTALL_DIR _var + SetRegView 32 + + ${If} ${MP023IsInstalled} + ReadRegStr ${_var} HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" + ${ElseIf} ${MPIsInstalled} + ReadRegStr ${_var} HKLM "${MP_REG_UNINSTALL}" "InstallPath" + ${Else} + StrCpy ${_var} "" + ${EndIf} + +!macroend + +!macro TVSERVER_GET_INSTALL_DIR _var + SetRegView 32 + + ${If} ${TVServerIsInstalled} + ReadRegStr ${_var} HKLM "${TV3_REG_UNINSTALL}" "InstallPath" + ${Else} + StrCpy ${_var} "" + ${EndIf} + +!macroend + +!insertmacro GetTime +!macro GET_BACKUP_POSTFIX _var + + ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + ; $0="01" day + ; $1="04" month + ; $2="2005" year + ; $3="Friday" day of week name + ; $4="16" hour + ; $5="05" minute + ; $6="50" seconds + + StrCpy ${_var} "BACKUP_$1-$0_$4-$5" + +!macroend + + + +#**********************************************************************************************************# +# +# common language strings +# +#**********************************************************************************************************# +LangString TEXT_MP_NOT_INSTALLED ${LANG_ENGLISH} "MediaPortal not installed" +LangString TEXT_TVSERVER_NOT_INSTALLED ${LANG_ENGLISH} "TVServer not installed" + + +LangString TEXT_MSGBOX_INSTALLATION_CANCELD ${LANG_ENGLISH} "Installation will be canceled." +LangString TEXT_MSGBOX_MORE_INFO ${LANG_ENGLISH} "Do you want to get more information about it?" + +LangString TEXT_MSGBOX_ERROR_WIN ${LANG_ENGLISH} "Your operating system is not supported by $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED ${LANG_ENGLISH} "Your operating system is not recommended by $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_ADMIN ${LANG_ENGLISH} "You need administration rights to install $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)" +LangString TEXT_MSGBOX_ERROR_VCREDIST ${LANG_ENGLISH} "Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_DOTNET ${LANG_ENGLISH} "Microsoft .Net Framework 2 is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" + +LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "$(^Name) is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." +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." + + + + /* +; Section flag test +!macro _MPIsInstalled _a _b _t _f + !insertmacro _LOGICLIB_TEMP + + ReadRegStr $MPBaseDir HKLM "${MP_REG_UNINSTALL}" "UninstallString" + ${If} $MPBaseDir == "" + # this fallback should only be enabled until MediaPortal 1.0 is out + ReadRegStr $MPBaseDir HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" + +#!define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" +#!define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" + + ${If} $MPBaseDir == "" + !insertmacro UnselectSection "${SecClient}" + ; Make the unselected section read only + !insertmacro SetSectionFlag "${SecClient}" 16 + SectionGetText ${SecClient} $R0 + SectionSetText ${SecClient} "$R0 ($(TEXT_MP_NOT_INSTALLED))" + ${EndIf} + ${EndIf} + SectionGetFlags `${_b}` $_LOGICLIB_TEMP + IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP & `${_a}` + + !insertmacro _= $_LOGICLIB_TEMP `${_a}` `${_t}` `${_f}` + !macroend + + #!define MPIsInstalled `${SF_SELECTED} SectionFlagIsSet` +!define MPIsInstalled "!insertmacro _MPIsInstalled" + */ + + + +#*************************** +#*************************** + +Var MyDocs +Var UserAppData +Var CommonAppData + +Var MPdir.Base + +Var MPdir.Config +Var MPdir.Plugins +Var MPdir.Log +Var MPdir.CustomInputDevice +Var MPdir.CustomInputDefault +Var MPdir.Skin +Var MPdir.Language +Var MPdir.Database +Var MPdir.Thumbs +Var MPdir.Weather +Var MPdir.Cache +Var MPdir.BurnerSupport + +#*************************** +#*************************** + +!macro GET_PATH_TEXT + + Pop $R0 + + ${xml::GotoPath} "/Config" $0 + ${If} $0 != 0 + ${LOG_TEXT} "ERROR" "xml::GotoPath /Config" + Goto error + ${EndIf} + + loop: + + ${xml::FindNextElement} "Dir" $0 $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::FindNextElement >/Dir< >$0<" + Goto error + ${EndIf} + + ${xml::ElementPath} $0 + ${xml::GetAttribute} "id" $0 $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::GetAttribute >id< >$0<" + Goto error + ${EndIf} + ${IfThen} $0 == $R0 ${|} Goto foundDir ${|} + + Goto loop + + + foundDir: + ${xml::ElementPath} $0 + ${xml::GotoPath} "$0/Path" $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::GotoPath >$0/Path<" + Goto error + ${EndIf} + + ${xml::GetText} $0 $1 + ${If} $1 != 0 + ; maybe the path is only empty, which means MPdir.Base + #MessageBox MB_OK "error: xml::GetText" + #Goto error + StrCpy $0 "" + ${EndIf} + + Push $0 + Goto end + + error: + Push "-1" + + end: + +!macroend +Function GET_PATH_TEXT + !insertmacro GET_PATH_TEXT +FunctionEnd +Function un.GET_PATH_TEXT + !insertmacro GET_PATH_TEXT +FunctionEnd + +#*************************** +#*************************** + +!macro ReadMPdir UNINSTALL_PREFIX DIR + ${LOG_TEXT} "DEBUG" "macro: ReadMPdir | DIR: ${DIR}" + + Push "${DIR}" + Call ${UNINSTALL_PREFIX}GET_PATH_TEXT + Pop $0 + ${IfThen} $0 == -1 ${|} Goto error ${|} + + ${LOG_TEXT} "DEBUG" "macro: ReadMPdir | text found in xml: '$0'" + ${${UNINSTALL_PREFIX}WordReplace} "$0" "%APPDATA%" "$UserAppData" "+" $0 + ${${UNINSTALL_PREFIX}WordReplace} "$0" "%PROGRAMDATA%" "$CommonAppData" "+" $0 + + ${${UNINSTALL_PREFIX}GetRoot} "$0" $1 + + ${IfThen} $1 == "" ${|} StrCpy $0 "$MPdir.Base\$0" ${|} + + ; TRIM \ AT THE END + StrLen $1 "$0" + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + IntOp $2 $1 - 1 + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + StrCpy $3 $0 1 $2 + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + + ${If} $3 == "\" + StrCpy $MPdir.${DIR} $0 $2 + ${Else} + StrCpy $MPdir.${DIR} $0 + ${EndIf} + +!macroend + +#*************************** +#*************************** + +!macro ReadConfig UNINSTALL_PREFIX PATH_TO_XML + ${LOG_TEXT} "DEBUG" "macro: ReadConfig | UNINSTALL_PREFIX: ${UNINSTALL_PREFIX} | PATH_TO_XML: ${PATH_TO_XML}" + + IfFileExists "${PATH_TO_XML}\MediaPortalDirs.xml" 0 error + + + #${xml::LoadFile} "$EXEDIR\MediaPortalDirsXP.xml" $0 + ${xml::LoadFile} "$0\MediaPortalDirs.xml" $0 + ${IfThen} $0 != 0 ${|} Goto error ${|} + + #</Dir> Log CustomInputDevice CustomInputDefault Skin Language Database Thumbs Weather Cache BurnerSupport + + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Config + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Plugins + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Log + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" CustomInputDevice + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" CustomInputDefault + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Skin + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Language + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Database + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Thumbs + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Weather + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Cache + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" BurnerSupport + + + Push "0" + Goto end + + error: + Push "-1" + + end: + +!macroend +Function ReadConfig + Pop $0 + + !insertmacro ReadConfig "" "$0" +FunctionEnd +Function un.ReadConfig + Pop $0 + + !insertmacro ReadConfig "un." "$0" +FunctionEnd + +#*************************** +#*************************** + +!macro LoadDefaultDirs + + StrCpy $MPdir.Config "$CommonAppData\Team MediaPortal\MediaPortal" + + StrCpy $MPdir.Plugins "$MPdir.Base\plugins" + StrCpy $MPdir.Log "$MPdir.Config\log" + StrCpy $MPdir.CustomInputDevice "$MPdir.Config\InputDeviceMappings" + StrCpy $MPdir.CustomInputDefault "$MPdir.Base\InputDeviceMappings\defaults" + StrCpy $MPdir.Skin "$MPdir.Base\skin" + StrCpy $MPdir.Language "$MPdir.Base\language" + StrCpy $MPdir.Database "$MPdir.Config\database" + StrCpy $MPdir.Thumbs "$MPdir.Config\thumbs" + StrCpy $MPdir.Weather "$MPdir.Base\weather" + StrCpy $MPdir.Cache "$MPdir.Config\cache" + StrCpy $MPdir.BurnerSupport "$MPdir.Base\Burner" + +!macroend + +#*************************** +#*************************** + +!define ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs ""` +!define un.ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs "un."` +!macro ReadMediaPortalDirs UNINSTALL_PREFIX INSTDIR + ${LOG_TEXT} "DEBUG" "macro ReadMediaPortalDirs" + + StrCpy $MPdir.Base "${INSTDIR}" + SetShellVarContext current + StrCpy $MyDocs "$DOCUMENTS" + StrCpy $UserAppData "$APPDATA" + SetShellVarContext all + StrCpy $CommonAppData "$APPDATA" + + + !insertmacro LoadDefaultDirs + + Push "$MyDocs\Team MediaPortal" + Call ${UNINSTALL_PREFIX}ReadConfig + Pop $0 + ${If} $0 != 0 ; an error occured + ${LOG_TEXT} "ERROR" "could not read '$MyDocs\Team MediaPortal\MediaPortalDirs.xml'" + + Push "$MPdir.Base" + Call ${UNINSTALL_PREFIX}ReadConfig + Pop $0 + ${If} $0 != 0 ; an error occured + ${LOG_TEXT} "ERROR" "could not read '$MPdir.Base\MediaPortalDirs.xml'" + + ${LOG_TEXT} "INFO" "no MediaPortalDirs.xml read. using LoadDefaultDirs" + !insertmacro LoadDefaultDirs + + ${Else} + ${LOG_TEXT} "INFO" "read '$MPdir.Base\MediaPortalDirs.xml' successfully" + ${EndIf} + + ${Else} + ${LOG_TEXT} "INFO" "read '$MyDocs\Team MediaPortal\MediaPortalDirs.xml' successfully" + ${EndIf} + + ${LOG_TEXT} "INFO" "Installer will use the following directories:$\r$\n" + ${LOG_TEXT} "INFO" " Base: $MPdir.Base" + ${LOG_TEXT} "INFO" " Config: $MPdir.Config" + ${LOG_TEXT} "INFO" " Plugins: $MPdir.Plugins" + ${LOG_TEXT} "INFO" " Log: $MPdir.Log" + ${LOG_TEXT} "INFO" " CustomInputDevice: $MPdir.CustomInputDevice" + ${LOG_TEXT} "INFO" " CustomInputDefault: $MPdir.CustomInputDefault" + ${LOG_TEXT} "INFO" " Skin: $MPdir.Skin" + ${LOG_TEXT} "INFO" " Language: $MPdir.Language" + ${LOG_TEXT} "INFO" " Database: $MPdir.Database" + ${LOG_TEXT} "INFO" " Thumbs: $MPdir.Thumbs" + ${LOG_TEXT} "INFO" " Weather: $MPdir.Weather" + ${LOG_TEXT} "INFO" " Cache: $MPdir.Cache" + ${LOG_TEXT} "INFO" " BurnerSupport: $MPdir.BurnerSupport" +!macroend \ No newline at end of file Property changes on: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-languages.nsh (from rev 2328, trunk/plugins/IR Server Suite/setup/setup-languages.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-languages.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-languages.nsh 2008-11-12 14:58:34 UTC (rev 2329) @@ -0,0 +1,55 @@ +#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 header contains multilanguage strings for the setup routine +# +#**********************************************************************************************************# + +# ENGLISH +LangString DESC_SectionInputService ${LANG_ENGLISH} "A windows service that provides access to your IR devices." +LangString DESC_SectionGroupMP ${LANG_ENGLISH} "MediaPortal plugins." +LangString DESC_SectionMPControlPlugin ${LANG_ENGLISH} "Connects to the Input Service to control MediaPortal." +LangString DESC_SectionMPBlastZonePlugin ${LANG_ENGLISH} "Lets you control your IR devices from within the MediaPortal GUI." +LangString DESC_SectionTV2BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the default MediaPortal TV engine." +LangString DESC_SectionGroupTV3 ${LANG_ENGLISH} "MediaPortal TV Server plugins." +LangString DESC_SectionTV3BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." +LangString DESC_SectionGroupMCE ${LANG_ENGLISH} "Windows Media Center add-ons." +LangString DESC_SectionMCEBlaster ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with Windows Media Center." +LangString DESC_SectionTranslator ${LANG_ENGLISH} "Control your whole PC." +LangString DESC_SectionTrayLauncher ${LANG_ENGLISH} "Simple program to launch an application of your choosing when a particular button is pressed." +LangString DESC_SectionVirtualRemote ${LANG_ENGLISH} "Simulated remote control. Includes PC application, web, and Smart Devices versions." +LangString DESC_SectionIRBlast ${LANG_ENGLISH} "Command line tools for blasting IR codes." +LangString DESC_SectionIRFileTool ${LANG_ENGLISH} "Tool for learning, modifying, testing, correcting and converting IR command files." +LangString DESC_SectionKeyboardInputRelay ${LANG_ENGLISH} "Relays keyboard input to the Input Service to act on keypresses like remote buttons." +LangString DESC_SectionDboxTuner ${LANG_ENGLISH} "Command line tuner for Dreambox devices." +LangString DESC_SectionHcwPvrTuner ${LANG_ENGLISH} "Command line tuner for Hauppauge PVR devices." +LangString DESC_SectionDebugClient ${LANG_ENGLISH} "Simple testing tool for troubleshooting input and communications problems." + + +LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" + +LangString TEXT_MSGBOX_REMOVE_ALL ${LANG_ENGLISH} "Do you want to remove your User settings?$\r$\nAttention: This will remove all your customised settings including Skins and Databases." Property changes on: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-languages.nsh ___________________________________________________________________ Added: svn:mergeinfo + Deleted: trunk/plugins/IR Server Suite/setup/setup-AddRemovePage.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/setup-AddRemovePage.nsh 2008-11-11 14:06:38 UTC (rev 2328) +++ trunk/plugins/IR Server Suite/setup/setup-AddRemovePage.nsh 2008-11-12 14:58:34 UTC (rev 2329) @@ -1,162 +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. -# -#**********************************************************************************************************# - -!include WordFunc.nsh -!include FileFunc.nsh - -!insertmacro VersionCompare -!insertmacro GetParent - -##### Add/Remove/Reinstall page -Var ReinstallPageCheck - -Function PageReinstall - ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "InstallPath" - - ${If} $R0 == "" - Abort - ${EndIf} - - ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" - ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" - ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" - ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" - StrCpy $R0 $R0.$R1.$R2.$R3 - - ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0 - ${If} $R0 == 0 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" - StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" - StrCpy $R0 "2" - ${ElseIf} $R0 == 1 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" - ${ElseIf} $R0 == 2 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" - ${Else} - Abort - ${EndIf} - - nsDialogs::Create /NOUNLOAD 1018 - - ${NSD_CreateLabel} 0 0 100% 24u $R1 - Pop $R1 - - ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 - Pop $R2 - ${NSD_OnClick} $R2 PageReinstallUpdateSelection - - ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 - Pop $R3 - ${NSD_OnClick} $R3 PageReinstallUpdateSelection - - ${If} $ReinstallPageCheck != 2 - SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${Else} - SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${EndIf} - - nsDialogs::Show -FunctionEnd - -Function PageReinstallUpdateSelection - Pop $R1 - - ${NSD_GetState} $R2 $R1 - - ${If} $R1 == ${BST_CHECKED} - StrCpy $ReinstallPageCheck 1 - ${Else} - StrCpy $ReinstallPageCheck 2 - ${EndIf} - -FunctionEnd - -Function PageLeaveReinstall - ${NSD_GetState} $R2 $R1 - - StrCmp $R0 "1" 0 +2 - StrCmp $R1 "1" doUninstall finish - StrCmp $R0 "2" 0 +3 - StrCmp $R1 "1" finish doUninstall - - doUninstall: - ; check if MP is already installed - ReadRegStr $R0 HKLM "${REG_UNINSTALL}" UninstallString - ${If} ${FileExists} "$R0" - ; get parent folder of uninstallation EXE (RO) and save it to R1 - ${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' - 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} - - ; if reboot flag is set, abort the installation, and continue the installer on next startup - ${If} ${FileExists} "$INSTDIR\rebootflag" - MessageBox MB_OK|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "$(^Name)" $EXEPATH - Quit - ${EndIf} - - finish: -FunctionEnd - - - -LangString TEXT_ADDREMOVE_HEADER ${LANG_ENGLISH} "Already Installed" -LangString TEXT_ADDREMOVE_HEADER2_REPAIR ${LANG_ENGLISH} "Choose the maintenance option to perform." -LangString TEXT_ADDREMOVE_HEADER2_UPDOWN ${LANG_ENGLISH} "Choose how you want to install $(^Name)." -LangString TEXT_ADDREMOVE_INFO_REPAIR ${LANG_ENGLISH} "$(^Name) ${VERSION} is already installed. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_INFO_UPGRADE ${LANG_ENGLISH} "An older version of $(^Name) is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_INFO_DOWNGRADE ${LANG_ENGLISH} "A newer version of $(^Name) is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_REPAIR_OPT1 ${LANG_ENGLISH} "Add/Remove/Reinstall components" -LangString TEXT_ADDREMOVE_REPAIR_OPT2 ${LANG_ENGLISH} "Uninstall $(^Name)" -LangString TEXT_ADDREMOVE_UPDOWN_OPT1 ${LANG_ENGLISH} "Uninstall before installing" -LangString TEXT_ADDREMOVE_UPDOWN_OPT2 ${LANG_ENGLISH} "Do not uninstall" \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/setup/setup-CommonMPMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/setup-CommonMPMacros.nsh 2008-11-11 14:06:38 UTC (rev 2328) +++ trunk/plugins/IR Server Suite/setup/setup-CommonMPMacros.nsh 2008-11-12 14:58:34 UTC (rev 2329) @@ -1,800 +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 - -!include /nonFatal "XML.nsh" -!ifndef xml::SetCondenseWhiteSpace - !error "$\r$\n$\r$\nYou need the xml plugin to compile this script. Look at$\r$\n$\r$\n http://nsis.sourceforge.net/XML_plug-in$\r$\n$\r$\ndownload and install it!$\r$\n$\r$\n" -!endif - -!include FileFunc.nsh -!insertmacro GetRoot -!insertmacro un.GetRoot - -!include WordFunc.nsh -!insertmacro WordReplace -!insertmacro un.WordReplace - - - -#**********************************************************************************************************# -# -# code for file association was taken from: -# http://nsis.sourceforge.net/File_Association -# -#**********************************************************************************************************# -!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 Index "Line${__LINE__}" - pop $R0 ; ext name - pop $R1 - pop $R2 - push $1 - push $0 - ReadRegStr $1 HKCR $R1 "" - StrCmp $1 "" "${Index}-NoBackup" - StrCmp $1 "OptionsFile" "${Index}-NoBackup" - WriteRegStr HKCR $R1 "backup_val" $1 -"${Index}-NoBackup:" - WriteRegStr HKCR $R1 "" $R0 - ReadRegStr $0 HKCR $R0 "" - StrCmp $0 "" 0 "${Index}-Skip" - WriteRegStr HKCR $R0 "" $R0 - WriteRegStr HKCR "$R0\shell" "" "open" - WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" -"${Index}-Skip:" - WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' - WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" - WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' - 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 - pop $R1 ; description - pop $R0 ; extension -!define Index "Line${__LINE__}" - ReadRegStr $1 HKCR $R0 "" - StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it - ReadRegStr $1 HKCR $R0 "backup_val" - StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key - DeleteRegKey HKCR $R0 - Goto "${Index}-NoOwn" -"${Index}-Restore:" - WriteRegStr HKCR $R0 "" $1 - DeleteRegValue HKCR $R0 "backup_val" - DeleteRegKey HKCR $R1 ;Delete key with association name settings -"${Index}-NoOwn:" -!undef Index -FunctionEnd - - - -#**********************************************************************************************************# -# -# logging system -# -#**********************************************************************************************************# -!ifdef INSTALL_LOG -!ifndef INSTALL_LOG_FILE - !ifndef COMMON_APPDATA - !error "$\r$\n$\r$\nCOMMON_APPDATA is not defined!$\r$\n$\r$\n" - !endif - - !define INSTALL_LOG_FILE "${COMMON_APPDATA}\Logs\install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}.log" -!endif - -Var LogFile - -!define prefixERROR "[ERROR !!!] " -!define prefixDEBUG "[ DEBUG ] " -!define prefixINFO "[ INFO] " - -!define LOG_OPEN `!insertmacro LOG_OPEN` -!macro LOG_OPEN - - FileOpen $LogFile "$TEMP\install_$(^Name).log" w - -!macroend - -!define LOG_CLOSE `!insertmacro LOG_CLOSE` -!macro LOG_CLOSE - - FileClose $LogFile - - CopyFiles "$TEMP\install_$(^Name).log" "${INSTALL_LOG_FILE}" - -!macroend - -!define LOG_TEXT `!insertmacro LOG_TEXT` -!macro LOG_TEXT LEVEL TEXT - -!if "${LEVEL}" != "DEBUG" - !if "${LEVEL}" != "ERROR" - !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" - !endif - !endif -!endif - - FileWrite $LogFile "${prefix${LEVEL}}${TEXT}$\r$\n" - -!macroend - -!else - -!define LOG_OPEN `!insertmacro LOG_OPEN` -!macro LOG_OPEN -!macroend - -!define LOG_CLOSE `!insertmacro LOG_CLOSE` -!macro LOG_CLOSE -!macroend - -!define LOG_TEXT `!insertmacro LOG_TEXT` -!macro LOG_TEXT LEVEL TEXT -!macroend - -!endif - - - -#**********************************************************************************************************# -# -# killing a process -# -#**********************************************************************************************************# -!define KILLPROCESS `!insertmacro KILLPROCESS` -!macro KILLPROCESS PROCESS -!if ${KILLMODE} == "1" - ExecShell "" "Cmd.exe" '/C "taskkill /F /IM "${PROCESS}""' SW_HIDE - Sleep 300 -!else if ${KILLMODE} == "2" - ExecWait '"taskkill" /F /IM "${PROCESS}"' -!else if ${KILLMODE} == "3" - nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' -!else - - nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' - -!endif -!macroend - - - - - - - - - - - -#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 - -!macro DisableComponent SectionName AddText - !insertmacro UnselectSection "${SectionName}" - ; Make the unselected section read only - !insertmacro SetSectionFlag "${SectionName}" 16 - SectionGetText ${SectionName} $R0 - SectionSetText ${SectionName} "$R0${AddText}" -!macroend - - - -#**********************************************************************************************************# -# -# Useful macros for MediaPortal and addtional Software which can be used like other LogicLib expressions. -# -#**********************************************************************************************************# - -!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 - -;====================================== OLD MP INSTALLATION TESTs - -# old installations < 0.2.3.0 RC 3 -!macro _MP022IsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ClearErrors - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87819CFA-1786-484D-B0DE-10B5FBF2625D}" "UninstallString" - IfErrors `${_f}` `${_t}` -!macroend -!define MP022IsInstalled `"" MP022IsInstalled ""` - -!macro _MP023RC3IsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0 RC3" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` -!macroend -!define MP023RC3IsInstalled `"" MP023RC3IsInstalled ""` - -!macro _MP023IsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` -!macroend -!define MP023IsInstalled `"" MP023IsInstalled ""` - -;====================================== OLD TVServer/TVClient INSTALLATION TESTs - -!macro _MSI_TVServerIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ClearErrors - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B738773-EE07-413D-AFB7-BB0AB04A5488}" "UninstallString" - IfErrors `${_f}` `${_t}` -!macroend -!define MSI_TVServerIsInstalled `"" MSI_TVServerIsInstalled ""` - -!macro _MSI_TVClientIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ClearErrors - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F7444E89-5BC0-497E-9650-E50539860DE0}" "UninstallString" - IfErrors 0 `${_t}` - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FD9FD453-1C0C-4EDA-AEE6-D7CF0E9951CA}" "UninstallString" - IfErrors `${_f}` `${_t}` -!macroend -!define MSI_TVClientIsInstalled `"" MSI_TVClientIsInstalled ""` - -;====================================== - -!macro _MPIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "${MP_REG_UNINSTALL}" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` -!macroend -!define MPIsInstalled `"" MPIsInstalled ""` - -!macro _TVServerIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP 0 `${_f}` - - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecServer" - StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` -!macroend -!define TVServerIsInstalled `"" TVServerIsInstalled ""` - -!macro _TVClientIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP 0 `${_f}` - - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecClient" - StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` -!macroend -!define TVClientIsInstalled `"" TVClientIsInstalled ""` - -;====================================== 3rd PARTY APPLICATION TESTs - -!macro _VCRedistIsInstalled _a _b _t _f - - ClearErrors - ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - IfErrors `${_f}` - - StrCpy $R1 $R0 3 - - StrCmp $R1 '5.1' lbl_winnt_XP - StrCmp $R1 '5.2' lbl_winnt_2003 - StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` - - - lbl_winnt_vista: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.762_none_11ecb0ab9b2caf3c.manifest" 0 `${_f}` - Goto `${_t}` - - lbl_winnt_2003: - lbl_winnt_XP: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_cbb27474.manifest" 0 `${_f}` - Goto `${_t}` -!macroend -!define VCRedistIsInstalled `"" VCRedistIsInstalled ""` - -!macro _dotNetIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - - ReadRegStr $4 HKLM "Software\Microsoft\.NETFramework" "InstallRoot" - # remove trailing back slash - Push $4 - Exch $EXEDIR - Exch $EXEDIR - Pop $4 - # if the root directory doesn't exist .NET is not installed - IfFileExists $4 0 `${_f}` - - StrCpy $0 0 - - EnumStart: - - EnumRegKey $2 HKLM "Software\Microsoft\.NETFramework\Policy" $0 - IntOp $0 $0 + 1 - StrCmp $2 "" `${_f}` - - StrCpy $1 0 - - EnumPolicy: - - EnumRegValue $3 HKLM "Software\Microsoft\.NETFramework\Policy\$2" $1 - IntOp $1 $1 + 1 - StrCmp $3 "" EnumStart - IfFileExists "$4\$2.$3" `${_t}` EnumPolicy -!macroend -!define dotNetIsInstalled `"" dotNetIsInstalled ""` - -#**********************************************************************************************************# -# Get MP infos -!macro MP_GET_INSTALL_DIR _var - SetRegView 32 - - ${If} ${MP023IsInstalled} - ReadRegStr ${_var} HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" - ${ElseIf} ${MPIsInstalled} - ReadRegStr ${_var} HKLM "${MP_REG_UNINSTALL}" "InstallPath" - ${Else} - StrCpy ${_var} "" - ${EndIf} ... [truncated message content] |
From: <che...@us...> - 2008-11-12 15:15:07
|
Revision: 2330 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2330&view=rev Author: chef_koch Date: 2008-11-12 15:14:59 +0000 (Wed, 12 Nov 2008) Log Message: ----------- moving some files around #2 Added Paths: ----------- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/setup-languages.nsh Removed Paths: ------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-languages.nsh Copied: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh (from rev 2329, trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh 2008-11-12 15:14:59 UTC (rev 2330) @@ -0,0 +1,162 @@ +#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. +# +#**********************************************************************************************************# + +!include WordFunc.nsh +!include FileFunc.nsh + +!insertmacro VersionCompare +!insertmacro GetParent + +##### Add/Remove/Reinstall page +Var ReinstallPageCheck + +Function PageReinstall + ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "InstallPath" + + ${If} $R0 == "" + Abort + ${EndIf} + + ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" + ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" + ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" + ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" + StrCpy $R0 $R0.$R1.$R2.$R3 + + ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0 + ${If} $R0 == 0 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" + StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" + StrCpy $R0 "2" + ${ElseIf} $R0 == 1 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + StrCpy $R0 "1" + ${ElseIf} $R0 == 2 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + StrCpy $R0 "1" + ${Else} + Abort + ${EndIf} + + nsDialogs::Create /NOUNLOAD 1018 + + ${NSD_CreateLabel} 0 0 100% 24u $R1 + Pop $R1 + + ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 + Pop $R2 + ${NSD_OnClick} $R2 PageReinstallUpdateSelection + + ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 + Pop $R3 + ${NSD_OnClick} $R3 PageReinstallUpdateSelection + + ${If} $ReinstallPageCheck != 2 + SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${Else} + SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${EndIf} + + nsDialogs::Show +FunctionEnd + +Function PageReinstallUpdateSelection + Pop $R1 + + ${NSD_GetState} $R2 $R1 + + ${If} $R1 == ${BST_CHECKED} + StrCpy $ReinstallPageCheck 1 + ${Else} + StrCpy $ReinstallPageCheck 2 + ${EndIf} + +FunctionEnd + +Function PageLeaveReinstall + ${NSD_GetState} $R2 $R1 + + StrCmp $R0 "1" 0 +2 + StrCmp $R1 "1" doUninstall finish + StrCmp $R0 "2" 0 +3 + StrCmp $R1 "1" finish doUninstall + + doUninstall: + ; check if MP is already installed + ReadRegStr $R0 HKLM "${REG_UNINSTALL}" UninstallString + ${If} ${FileExists} "$R0" + ; get parent folder of uninstallation EXE (RO) and save it to R1 + ${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' + 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} + + ; if reboot flag is set, abort the installation, and continue the installer on next startup + ${If} ${FileExists} "$INSTDIR\rebootflag" + MessageBox MB_OK|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "$(^Name)" $EXEPATH + Quit + ${EndIf} + + finish: +FunctionEnd + + + +LangString TEXT_ADDREMOVE_HEADER ${LANG_ENGLISH} "Already Installed" +LangString TEXT_ADDREMOVE_HEADER2_REPAIR ${LANG_ENGLISH} "Choose the maintenance option to perform." +LangString TEXT_ADDREMOVE_HEADER2_UPDOWN ${LANG_ENGLISH} "Choose how you want to install $(^Name)." +LangString TEXT_ADDREMOVE_INFO_REPAIR ${LANG_ENGLISH} "$(^Name) ${VERSION} is already installed. Select the operation you want to perform and click Next to continue." +LangString TEXT_ADDREMOVE_INFO_UPGRADE ${LANG_ENGLISH} "An older version of $(^Name) is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue." +LangString TEXT_ADDREMOVE_INFO_DOWNGRADE ${LANG_ENGLISH} "A newer version of $(^Name) is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue." +LangString TEXT_ADDREMOVE_REPAIR_OPT1 ${LANG_ENGLISH} "Add/Remove/Reinstall components" +LangString TEXT_ADDREMOVE_REPAIR_OPT2 ${LANG_ENGLISH} "Uninstall $(^Name)" +LangString TEXT_ADDREMOVE_UPDOWN_OPT1 ${LANG_ENGLISH} "Uninstall before installing" +LangString TEXT_ADDREMOVE_UPDOWN_OPT2 ${LANG_ENGLISH} "Do not uninstall" \ No newline at end of file Copied: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh (from rev 2329, trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh 2008-11-12 15:14:59 UTC (rev 2330) @@ -0,0 +1,800 @@ +#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 + +!include /nonFatal "XML.nsh" +!ifndef xml::SetCondenseWhiteSpace + !error "$\r$\n$\r$\nYou need the xml plugin to compile this script. Look at$\r$\n$\r$\n http://nsis.sourceforge.net/XML_plug-in$\r$\n$\r$\ndownload and install it!$\r$\n$\r$\n" +!endif + +!include FileFunc.nsh +!insertmacro GetRoot +!insertmacro un.GetRoot + +!include WordFunc.nsh +!insertmacro WordReplace +!insertmacro un.WordReplace + + + +#**********************************************************************************************************# +# +# code for file association was taken from: +# http://nsis.sourceforge.net/File_Association +# +#**********************************************************************************************************# +!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 Index "Line${__LINE__}" + pop $R0 ; ext name + pop $R1 + pop $R2 + push $1 + push $0 + ReadRegStr $1 HKCR $R1 "" + StrCmp $1 "" "${Index}-NoBackup" + StrCmp $1 "OptionsFile" "${Index}-NoBackup" + WriteRegStr HKCR $R1 "backup_val" $1 +"${Index}-NoBackup:" + WriteRegStr HKCR $R1 "" $R0 + ReadRegStr $0 HKCR $R0 "" + StrCmp $0 "" 0 "${Index}-Skip" + WriteRegStr HKCR $R0 "" $R0 + WriteRegStr HKCR "$R0\shell" "" "open" + WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" +"${Index}-Skip:" + WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' + WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" + WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' + 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 + pop $R1 ; description + pop $R0 ; extension +!define Index "Line${__LINE__}" + ReadRegStr $1 HKCR $R0 "" + StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it + ReadRegStr $1 HKCR $R0 "backup_val" + StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key + DeleteRegKey HKCR $R0 + Goto "${Index}-NoOwn" +"${Index}-Restore:" + WriteRegStr HKCR $R0 "" $1 + DeleteRegValue HKCR $R0 "backup_val" + DeleteRegKey HKCR $R1 ;Delete key with association name settings +"${Index}-NoOwn:" +!undef Index +FunctionEnd + + + +#**********************************************************************************************************# +# +# logging system +# +#**********************************************************************************************************# +!ifdef INSTALL_LOG +!ifndef INSTALL_LOG_FILE + !ifndef COMMON_APPDATA + !error "$\r$\n$\r$\nCOMMON_APPDATA is not defined!$\r$\n$\r$\n" + !endif + + !define INSTALL_LOG_FILE "${COMMON_APPDATA}\Logs\install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}.log" +!endif + +Var LogFile + +!define prefixERROR "[ERROR !!!] " +!define prefixDEBUG "[ DEBUG ] " +!define prefixINFO "[ INFO] " + +!define LOG_OPEN `!insertmacro LOG_OPEN` +!macro LOG_OPEN + + FileOpen $LogFile "$TEMP\install_$(^Name).log" w + +!macroend + +!define LOG_CLOSE `!insertmacro LOG_CLOSE` +!macro LOG_CLOSE + + FileClose $LogFile + + CopyFiles "$TEMP\install_$(^Name).log" "${INSTALL_LOG_FILE}" + +!macroend + +!define LOG_TEXT `!insertmacro LOG_TEXT` +!macro LOG_TEXT LEVEL TEXT + +!if "${LEVEL}" != "DEBUG" + !if "${LEVEL}" != "ERROR" + !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" + !endif + !endif +!endif + + FileWrite $LogFile "${prefix${LEVEL}}${TEXT}$\r$\n" + +!macroend + +!else + +!define LOG_OPEN `!insertmacro LOG_OPEN` +!macro LOG_OPEN +!macroend + +!define LOG_CLOSE `!insertmacro LOG_CLOSE` +!macro LOG_CLOSE +!macroend + +!define LOG_TEXT `!insertmacro LOG_TEXT` +!macro LOG_TEXT LEVEL TEXT +!macroend + +!endif + + + +#**********************************************************************************************************# +# +# killing a process +# +#**********************************************************************************************************# +!define KILLPROCESS `!insertmacro KILLPROCESS` +!macro KILLPROCESS PROCESS +!if ${KILLMODE} == "1" + ExecShell "" "Cmd.exe" '/C "taskkill /F /IM "${PROCESS}""' SW_HIDE + Sleep 300 +!else if ${KILLMODE} == "2" + ExecWait '"taskkill" /F /IM "${PROCESS}"' +!else if ${KILLMODE} == "3" + nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' +!else + + nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' + +!endif +!macroend + + + + + + + + + + + +#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 + +!macro DisableComponent SectionName AddText + !insertmacro UnselectSection "${SectionName}" + ; Make the unselected section read only + !insertmacro SetSectionFlag "${SectionName}" 16 + SectionGetText ${SectionName} $R0 + SectionSetText ${SectionName} "$R0${AddText}" +!macroend + + + +#**********************************************************************************************************# +# +# Useful macros for MediaPortal and addtional Software which can be used like other LogicLib expressions. +# +#**********************************************************************************************************# + +!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 + +;====================================== OLD MP INSTALLATION TESTs + +# old installations < 0.2.3.0 RC 3 +!macro _MP022IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87819CFA-1786-484D-B0DE-10B5FBF2625D}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MP022IsInstalled `"" MP022IsInstalled ""` + +!macro _MP023RC3IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0 RC3" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MP023RC3IsInstalled `"" MP023RC3IsInstalled ""` + +!macro _MP023IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MP023IsInstalled `"" MP023IsInstalled ""` + +;====================================== OLD TVServer/TVClient INSTALLATION TESTs + +!macro _MSI_TVServerIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B738773-EE07-413D-AFB7-BB0AB04A5488}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MSI_TVServerIsInstalled `"" MSI_TVServerIsInstalled ""` + +!macro _MSI_TVClientIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F7444E89-5BC0-497E-9650-E50539860DE0}" "UninstallString" + IfErrors 0 `${_t}` + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FD9FD453-1C0C-4EDA-AEE6-D7CF0E9951CA}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MSI_TVClientIsInstalled `"" MSI_TVClientIsInstalled ""` + +;====================================== + +!macro _MPIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${MP_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MPIsInstalled `"" MPIsInstalled ""` + +!macro _TVServerIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP 0 `${_f}` + + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecServer" + StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` +!macroend +!define TVServerIsInstalled `"" TVServerIsInstalled ""` + +!macro _TVClientIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP 0 `${_f}` + + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecClient" + StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` +!macroend +!define TVClientIsInstalled `"" TVClientIsInstalled ""` + +;====================================== 3rd PARTY APPLICATION TESTs + +!macro _VCRedistIsInstalled _a _b _t _f + + ClearErrors + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors `${_f}` + + StrCpy $R1 $R0 3 + + StrCmp $R1 '5.1' lbl_winnt_XP + StrCmp $R1 '5.2' lbl_winnt_2003 + StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` + + + lbl_winnt_vista: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.762_none_11ecb0ab9b2caf3c.manifest" 0 `${_f}` + Goto `${_t}` + + lbl_winnt_2003: + lbl_winnt_XP: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_cbb27474.manifest" 0 `${_f}` + Goto `${_t}` +!macroend +!define VCRedistIsInstalled `"" VCRedistIsInstalled ""` + +!macro _dotNetIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + + ReadRegStr $4 HKLM "Software\Microsoft\.NETFramework" "InstallRoot" + # remove trailing back slash + Push $4 + Exch $EXEDIR + Exch $EXEDIR + Pop $4 + # if the root directory doesn't exist .NET is not installed + IfFileExists $4 0 `${_f}` + + StrCpy $0 0 + + EnumStart: + + EnumRegKey $2 HKLM "Software\Microsoft\.NETFramework\Policy" $0 + IntOp $0 $0 + 1 + StrCmp $2 "" `${_f}` + + StrCpy $1 0 + + EnumPolicy: + + EnumRegValue $3 HKLM "Software\Microsoft\.NETFramework\Policy\$2" $1 + IntOp $1 $1 + 1 + StrCmp $3 "" EnumStart + IfFileExists "$4\$2.$3" `${_t}` EnumPolicy +!macroend +!define dotNetIsInstalled `"" dotNetIsInstalled ""` + +#**********************************************************************************************************# +# Get MP infos +!macro MP_GET_INSTALL_DIR _var + SetRegView 32 + + ${If} ${MP023IsInstalled} + ReadRegStr ${_var} HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" + ${ElseIf} ${MPIsInstalled} + ReadRegStr ${_var} HKLM "${MP_REG_UNINSTALL}" "InstallPath" + ${Else} + StrCpy ${_var} "" + ${EndIf} + +!macroend + +!macro TVSERVER_GET_INSTALL_DIR _var + SetRegView 32 + + ${If} ${TVServerIsInstalled} + ReadRegStr ${_var} HKLM "${TV3_REG_UNINSTALL}" "InstallPath" + ${Else} + StrCpy ${_var} "" + ${EndIf} + +!macroend + +!insertmacro GetTime +!macro GET_BACKUP_POSTFIX _var + + ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + ; $0="01" day + ; $1="04" month + ; $2="2005" year + ; $3="Friday" day of week name + ; $4="16" hour + ; $5="05" minute + ; $6="50" seconds + + StrCpy ${_var} "BACKUP_$1-$0_$4-$5" + +!macroend + + + +#**********************************************************************************************************# +# +# common language strings +# +#**********************************************************************************************************# +LangString TEXT_MP_NOT_INSTALLED ${LANG_ENGLISH} "MediaPortal not installed" +LangString TEXT_TVSERVER_NOT_INSTALLED ${LANG_ENGLISH} "TVServer not installed" + + +LangString TEXT_MSGBOX_INSTALLATION_CANCELD ${LANG_ENGLISH} "Installation will be canceled." +LangString TEXT_MSGBOX_MORE_INFO ${LANG_ENGLISH} "Do you want to get more information about it?" + +LangString TEXT_MSGBOX_ERROR_WIN ${LANG_ENGLISH} "Your operating system is not supported by $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED ${LANG_ENGLISH} "Your operating system is not recommended by $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_ADMIN ${LANG_ENGLISH} "You need administration rights to install $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)" +LangString TEXT_MSGBOX_ERROR_VCREDIST ${LANG_ENGLISH} "Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_DOTNET ${LANG_ENGLISH} "Microsoft .Net Framework 2 is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" + +LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "$(^Name) is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." +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." + + + + /* +; Section flag test +!macro _MPIsInstalled _a _b _t _f + !insertmacro _LOGICLIB_TEMP + + ReadRegStr $MPBaseDir HKLM "${MP_REG_UNINSTALL}" "UninstallString" + ${If} $MPBaseDir == "" + # this fallback should only be enabled until MediaPortal 1.0 is out + ReadRegStr $MPBaseDir HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" + +#!define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" +#!define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" + + ${If} $MPBaseDir == "" + !insertmacro UnselectSection "${SecClient}" + ; Make the unselected section read only + !insertmacro SetSectionFlag "${SecClient}" 16 + SectionGetText ${SecClient} $R0 + SectionSetText ${SecClient} "$R0 ($(TEXT_MP_NOT_INSTALLED))" + ${EndIf} + ${EndIf} + SectionGetFlags `${_b}` $_LOGICLIB_TEMP + IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP & `${_a}` + + !insertmacro _= $_LOGICLIB_TEMP `${_a}` `${_t}` `${_f}` + !macroend + + #!define MPIsInstalled `${SF_SELECTED} SectionFlagIsSet` +!define MPIsInstalled "!insertmacro _MPIsInstalled" + */ + + + +#*************************** +#*************************** + +Var MyDocs +Var UserAppData +Var CommonAppData + +Var MPdir.Base + +Var MPdir.Config +Var MPdir.Plugins +Var MPdir.Log +Var MPdir.CustomInputDevice +Var MPdir.CustomInputDefault +Var MPdir.Skin +Var MPdir.Language +Var MPdir.Database +Var MPdir.Thumbs +Var MPdir.Weather +Var MPdir.Cache +Var MPdir.BurnerSupport + +#*************************** +#*************************** + +!macro GET_PATH_TEXT + + Pop $R0 + + ${xml::GotoPath} "/Config" $0 + ${If} $0 != 0 + ${LOG_TEXT} "ERROR" "xml::GotoPath /Config" + Goto error + ${EndIf} + + loop: + + ${xml::FindNextElement} "Dir" $0 $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::FindNextElement >/Dir< >$0<" + Goto error + ${EndIf} + + ${xml::ElementPath} $0 + ${xml::GetAttribute} "id" $0 $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::GetAttribute >id< >$0<" + Goto error + ${EndIf} + ${IfThen} $0 == $R0 ${|} Goto foundDir ${|} + + Goto loop + + + foundDir: + ${xml::ElementPath} $0 + ${xml::GotoPath} "$0/Path" $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::GotoPath >$0/Path<" + Goto error + ${EndIf} + + ${xml::GetText} $0 $1 + ${If} $1 != 0 + ; maybe the path is only empty, which means MPdir.Base + #MessageBox MB_OK "error: xml::GetText" + #Goto error + StrCpy $0 "" + ${EndIf} + + Push $0 + Goto end + + error: + Push "-1" + + end: + +!macroend +Function GET_PATH_TEXT + !insertmacro GET_PATH_TEXT +FunctionEnd +Function un.GET_PATH_TEXT + !insertmacro GET_PATH_TEXT +FunctionEnd + +#*************************** +#*************************** + +!macro ReadMPdir UNINSTALL_PREFIX DIR + ${LOG_TEXT} "DEBUG" "macro: ReadMPdir | DIR: ${DIR}" + + Push "${DIR}" + Call ${UNINSTALL_PREFIX}GET_PATH_TEXT + Pop $0 + ${IfThen} $0 == -1 ${|} Goto error ${|} + + ${LOG_TEXT} "DEBUG" "macro: ReadMPdir | text found in xml: '$0'" + ${${UNINSTALL_PREFIX}WordReplace} "$0" "%APPDATA%" "$UserAppData" "+" $0 + ${${UNINSTALL_PREFIX}WordReplace} "$0" "%PROGRAMDATA%" "$CommonAppData" "+" $0 + + ${${UNINSTALL_PREFIX}GetRoot} "$0" $1 + + ${IfThen} $1 == "" ${|} StrCpy $0 "$MPdir.Base\$0" ${|} + + ; TRIM \ AT THE END + StrLen $1 "$0" + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + IntOp $2 $1 - 1 + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + StrCpy $3 $0 1 $2 + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + + ${If} $3 == "\" + StrCpy $MPdir.${DIR} $0 $2 + ${Else} + StrCpy $MPdir.${DIR} $0 + ${EndIf} + +!macroend + +#*************************** +#*************************** + +!macro ReadConfig UNINSTALL_PREFIX PATH_TO_XML + ${LOG_TEXT} "DEBUG" "macro: ReadConfig | UNINSTALL_PREFIX: ${UNINSTALL_PREFIX} | PATH_TO_XML: ${PATH_TO_XML}" + + IfFileExists "${PATH_TO_XML}\MediaPortalDirs.xml" 0 error + + + #${xml::LoadFile} "$EXEDIR\MediaPortalDirsXP.xml" $0 + ${xml::LoadFile} "$0\MediaPortalDirs.xml" $0 + ${IfThen} $0 != 0 ${|} Goto error ${|} + + #</Dir> Log CustomInputDevice CustomInputDefault Skin Language Database Thumbs Weather Cache BurnerSupport + + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Config + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Plugins + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Log + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" CustomInputDevice + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" CustomInputDefault + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Skin + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Language + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Database + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Thumbs + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Weather + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Cache + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" BurnerSupport + + + Push "0" + Goto end + + error: + Push "-1" + + end: + +!macroend +Function ReadConfig + Pop $0 + + !insertmacro ReadConfig "" "$0" +FunctionEnd +Function un.ReadConfig + Pop $0 + + !insertmacro ReadConfig "un." "$0" +FunctionEnd + +#*************************** +#*************************** + +!macro LoadDefaultDirs + + StrCpy $MPdir.Config "$CommonAppData\Team MediaPortal\MediaPortal" + + StrCpy $MPdir.Plugins "$MPdir.Base\plugins" + StrCpy $MPdir.Log "$MPdir.Config\log" + StrCpy $MPdir.CustomInputDevice "$MPdir.Config\InputDeviceMappings" + StrCpy $MPdir.CustomInputDefault "$MPdir.Base\InputDeviceMappings\defaults" + StrCpy $MPdir.Skin "$MPdir.Base\skin" + StrCpy $MPdir.Language "$MPdir.Base\language" + StrCpy $MPdir.Database "$MPdir.Config\database" + StrCpy $MPdir.Thumbs "$MPdir.Config\thumbs" + StrCpy $MPdir.Weather "$MPdir.Base\weather" + StrCpy $MPdir.Cache "$MPdir.Config\cache" + StrCpy $MPdir.BurnerSupport "$MPdir.Base\Burner" + +!macroend + +#*************************** +#*************************** + +!define ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs ""` +!define un.ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs "un."` +!macro ReadMediaPortalDirs UNINSTALL_PREFIX INSTDIR + ${LOG_TEXT} "DEBUG" "macro ReadMediaPortalDirs" + + StrCpy $MPdir.Base "${INSTDIR}" + SetShellVarContext current + StrCpy $MyDocs "$DOCUMENTS" + StrCpy $UserAppData "$APPDATA" + SetShellVarContext all + StrCpy $CommonAppData "$APPDATA" + + + !insertmacro LoadDefaultDirs + + Push "$MyDocs\Team MediaPortal" + Call ${UNINSTALL_PREFIX}ReadConfig + Pop $0 + ${If} $0 != 0 ; an error occured + ${LOG_TEXT} "ERROR" "could not read '$MyDocs\Team MediaPortal\MediaPortalDirs.xml'" + + Push "$MPdir.Base" + Call ${UNINSTALL_PREFIX}ReadConfig + Pop $0 + ${If} $0 != 0 ; an error occured + ${LOG_TEXT} "ERROR" "could not read '$MPdir.Base\MediaPortalDirs.xml'" + + ${LOG_TEXT} "INFO" "no MediaPortalDirs.xml read. using LoadDefaultDirs" + !insertmacro LoadDefaultDirs + + ${Else} + ${LOG_TEXT} "INFO" "read '$MPdir.Base\MediaPortalDirs.xml' successfully" + ${EndIf} + + ${Else} + ${LOG_TEXT} "INFO" "read '$MyDocs\Team MediaPortal\MediaPortalDirs.xml' successfully" + ${EndIf} + + ${LOG_TEXT} "INFO" "Installer will use the following directories:$\r$\n" + ${LOG_TEXT} "INFO" " Base: $MPdir.Base" + ${LOG_TEXT} "INFO" " Config: $MPdir.Config" + ${LOG_TEXT} "INFO" " Plugins: $MPdir.Plugins" + ${LOG_TEXT} "INFO" " Log: $MPdir.Log" + ${LOG_TEXT} "INFO" " CustomInputDevice: $MPdir.CustomInputDevice" + ${LOG_TEXT} "INFO" " CustomInputDefault: $MPdir.CustomInputDefault" + ${LOG_TEXT} "INFO" " Skin: $MPdir.Skin" + ${LOG_TEXT} "INFO" " Language: $MPdir.Language" + ${LOG_TEXT} "INFO" " Database: $MPdir.Database" + ${LOG_TEXT} "INFO" " Thumbs: $MPdir.Thumbs" + ${LOG_TEXT} "INFO" " Weather: $MPdir.Weather" + ${LOG_TEXT} "INFO" " Cache: $MPdir.Cache" + ${LOG_TEXT} "INFO" " BurnerSupport: $MPdir.BurnerSupport" +!macroend \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh 2008-11-12 14:58:34 UTC (rev 2329) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-AddRemovePage.nsh 2008-11-12 15:14:59 UTC (rev 2330) @@ -1,162 +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. -# -#**********************************************************************************************************# - -!include WordFunc.nsh -!include FileFunc.nsh - -!insertmacro VersionCompare -!insertmacro GetParent - -##### Add/Remove/Reinstall page -Var ReinstallPageCheck - -Function PageReinstall - ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "InstallPath" - - ${If} $R0 == "" - Abort - ${EndIf} - - ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" - ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" - ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" - ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" - StrCpy $R0 $R0.$R1.$R2.$R3 - - ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0 - ${If} $R0 == 0 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" - StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" - StrCpy $R0 "2" - ${ElseIf} $R0 == 1 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" - ${ElseIf} $R0 == 2 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" - ${Else} - Abort - ${EndIf} - - nsDialogs::Create /NOUNLOAD 1018 - - ${NSD_CreateLabel} 0 0 100% 24u $R1 - Pop $R1 - - ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 - Pop $R2 - ${NSD_OnClick} $R2 PageReinstallUpdateSelection - - ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 - Pop $R3 - ${NSD_OnClick} $R3 PageReinstallUpdateSelection - - ${If} $ReinstallPageCheck != 2 - SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${Else} - SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${EndIf} - - nsDialogs::Show -FunctionEnd - -Function PageReinstallUpdateSelection - Pop $R1 - - ${NSD_GetState} $R2 $R1 - - ${If} $R1 == ${BST_CHECKED} - StrCpy $ReinstallPageCheck 1 - ${Else} - StrCpy $ReinstallPageCheck 2 - ${EndIf} - -FunctionEnd - -Function PageLeaveReinstall - ${NSD_GetState} $R2 $R1 - - StrCmp $R0 "1" 0 +2 - StrCmp $R1 "1" doUninstall finish - StrCmp $R0 "2" 0 +3 - StrCmp $R1 "1" finish doUninstall - - doUninstall: - ; check if MP is already installed - ReadRegStr $R0 HKLM "${REG_UNINSTALL}" UninstallString - ${If} ${FileExists} "$R0" - ; get parent folder of uninstallation EXE (RO) and save it to R1 - ${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' - 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} - - ; if reboot flag is set, abort the installation, and continue the installer on next startup - ${If} ${FileExists} "$INSTDIR\rebootflag" - MessageBox MB_OK|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "$(^Name)" $EXEPATH - Quit - ${EndIf} - - finish: -FunctionEnd - - - -LangString TEXT_ADDREMOVE_HEADER ${LANG_ENGLISH} "Already Installed" -LangString TEXT_ADDREMOVE_HEADER2_REPAIR ${LANG_ENGLISH} "Choose the maintenance option to perform." -LangString TEXT_ADDREMOVE_HEADER2_UPDOWN ${LANG_ENGLISH} "Choose how you want to install $(^Name)." -LangString TEXT_ADDREMOVE_INFO_REPAIR ${LANG_ENGLISH} "$(^Name) ${VERSION} is already installed. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_INFO_UPGRADE ${LANG_ENGLISH} "An older version of $(^Name) is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_INFO_DOWNGRADE ${LANG_ENGLISH} "A newer version of $(^Name) is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_REPAIR_OPT1 ${LANG_ENGLISH} "Add/Remove/Reinstall components" -LangString TEXT_ADDREMOVE_REPAIR_OPT2 ${LANG_ENGLISH} "Uninstall $(^Name)" -LangString TEXT_ADDREMOVE_UPDOWN_OPT1 ${LANG_ENGLISH} "Uninstall before installing" -LangString TEXT_ADDREMOVE_UPDOWN_OPT2 ${LANG_ENGLISH} "Do not uninstall" \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh 2008-11-12 14:58:34 UTC (rev 2329) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/setup-CommonMPMacros.nsh 2008-11-12 15:14:59 UTC (rev 2330) @@ -1,800 +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 - -!include /nonFatal "XML.nsh" -!ifndef xml::SetCondenseWhiteSpace - !error "$\r$\n$\r$\nYou need the xml plugin to compile this script. Look at$\r$\n$\r$\n http://nsis.sourceforge.net/XML_plug-in$\r$\n$\r$\ndownload and install it!$\r$\n$\r$\n" -!endif - -!include FileFunc.nsh -!insertmacro GetRoot -!insertmacro un.GetRoot - -!include WordFunc.nsh -!insertmacro WordReplace -!insertmacro un.WordReplace - - - -#**********************************************************************************************************# -# -# code for file association was taken from: -# http://nsis.sourceforge.net/File_Association -# -#**********************************************************************************************************# -!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 Index "Line${__LINE__}" - pop $R0 ; ext name - pop $R1 - pop $R2 - push $1 - push $0 - ReadRegStr $1 HKCR $R1 "" - StrCmp $1 "" "${Index}-NoBackup" - StrCmp $1 "OptionsFile" "${Index}-NoBackup" - WriteRegStr HKCR $R1 "backup_val" $1 -"${Index}-NoBackup:" - WriteRegStr HKCR $R1 "" $R0 - ReadRegStr $0 HKCR $R0 "" - StrCmp $0 "" 0 "${Index}-Skip" - WriteRegStr HKCR $R0 "" $R0 - WriteRegStr HKCR "$R0\shell" "" "open" - WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" -"${Index}-Skip:" - WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' - WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" - WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' - 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 - pop $R1 ; description - pop $R0 ; extension -!define Index "Line${__LINE__}" - ReadRegStr $1 HKCR $R0 "" - StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it - ReadRegStr $1 HKCR $R0 "backup_val" - StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key - DeleteRegKey HKCR $R0 - Goto "${Index}-NoOwn" -"${Index}-Restore:" - WriteRegStr HKCR $R0 "" $1 - DeleteRegValue HKCR $R0 "backup_val" - DeleteRegKey HKCR $R1 ;Delete key with association name settings -"${Index}-NoOwn:" -!undef Index -FunctionEnd - - - -#**********************************************************************************************************# -# -# logging system -# -#**********************************************************************************************************# -!ifdef INSTALL_LOG -!ifndef INSTALL_LOG_FILE - !ifndef COMMON_APPDATA - !error "$\r$\n$\r$\nCOMMON_APPDATA is not defined!$\r$\n$\r$\n" - !endif - - !define INSTALL_LOG_FILE "${COMMON_APPDATA}\Logs\install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}.log" -!endif - -Var LogFile - -!define prefixERROR "[ERROR !!!] " -!define prefixDEBUG "[ DEBUG ] " -!define prefixINFO "[ INFO] " - -!define LOG_OPEN `!insertmacro LOG_OPEN` -!macro LOG_OPEN - - FileOpen $LogFile "$TEMP\install_$(^Name).log" w - -!macroend - -!define LOG_CLOSE `!insertmacro LOG_CLOSE` -!macro LOG_CLOSE - - FileClose $LogFile - - CopyFiles "$TEMP\install_$(^Name).log" "${INSTALL_LOG_FILE}" - -!macroend - -!define LOG_TEXT `!insertmacro LOG_TEXT` -!macro LOG_TEXT LEVEL TEXT - -!if "${LEVEL}" != "DEBUG" - !if "${LEVEL}" != "ERROR" - !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" - !endif - !endif -!endif - - FileWrite $LogFile "${prefix${LEVEL}}${TEXT}$\r$\n" - -!macroend - -!else - -!define LOG_OPEN `!insertmacro LOG_OPEN` -!macro LOG_OPEN -!macroend - -!define LOG_CLOSE `!insertmacro LOG_CLOSE` -!macro LOG_CLOSE -!macroend - -!define LOG_TEXT `!insertmacro LOG_TEXT` -!macro LOG_TEXT LEVEL TEXT -!macroend - -!endif - - - -#**********************************************************************************************************# -# -# killing a process -# -#**********************************************************************************************************# -!define KILLPROCESS `!insertmacro KILLPROCESS` -!macro KILLPROCESS PROCESS -!if ${KILLMODE} == "1" - ExecShell "" "Cmd.exe" '/C "taskkill /F /IM "${PROCESS}""' SW_HIDE - Sleep 300 -!else if ${KILLMODE} == "2" - ExecWait '"taskkill" /F /IM "${PROCESS}"' -!else if ${KILLMODE} == "3" - nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' -!else - - nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' - -!endif -!macroend - - - - - - - - - - - -#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 - -!macro DisableComponent SectionName AddText - !insertmacro UnselectSection "${SectionName}" - ; Make the unselected section read only - !insertmacro SetSectionFlag "${SectionName}" 16 - SectionGetText ${SectionName} $R0 - SectionSetText ${SectionName} "$R0${AddText}" -!macroend - - - -#**********************************************************************************************************# -# -# Useful macros for MediaPortal and addtional Software which can be used like other LogicLib expressions. -# -#**********************************************************************************************************# - -!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 - -;====================================== OLD MP INSTALLATION TESTs - -# old installations < 0.2.3.0 RC 3 -!macro _MP022IsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ClearErrors - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87819CFA-1786-484D-B0DE-10B5FBF2625D}" "UninstallString" - IfErrors `${_f}` `${_t}` -!macroend -!define MP022IsInstalled `"" MP022IsInstalled ""` - -!macro _MP023RC3IsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0 RC3" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` -!macroend -!define MP023RC3IsInstalled `"" MP023RC3IsInstalled ""` - -!macro _MP023IsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` -!macroend -!define MP023IsInstalled `"" MP023IsInstalled ""` - -;====================================== OLD TVServer/TVClient INSTALLATION TESTs - -!macro _MSI_TVServerIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ClearErrors - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B738773-EE07-413D-AFB7-BB0AB04A5488}" "UninstallString" - IfErrors `${_f}` `${_t}` -!macroend -!define MSI_TVServerIsInstalled `"" MSI_TVServerIsInstalled ""` - -!macro _MSI_TVClientIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ClearErrors - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F7444E89-5BC0-497E-9650-E50539860DE0}" "UninstallString" - IfErrors 0 `${_t}` - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FD9FD453-1C0C-4EDA-AEE6-D7CF0E9951CA}" "UninstallString" - IfErrors `${_f}` `${_t}` -!macroend -!define MSI_TVClientIsInstalled `"" MSI_TVClientIsInstalled ""` - -;====================================== - -!macro _MPIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "${MP_REG_UNINSTALL}" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` -!macroend -!define MPIsInstalled `"" MPIsInstalled ""` - -!macro _TVServerIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP 0 `${_f}` - - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecServer" - StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` -!macroend -!define TVServerIsInstalled `"" TVServerIsInstalled ""` - -!macro _TVClientIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" - - IfFileExists $_LOGICLIB_TEMP 0 `${_f}` - - ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecClient" - StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` -!macroend -!define TVClientIsInstalled `"" TVClientIsInstalled ""` - -;====================================== 3rd PARTY APPLICATION TESTs - -!macro _VCRedistIsInstalled _a _b _t _f - - ClearErrors - ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - IfErrors `${_f}` - - StrCpy $R1 $R0 3 - - StrCmp $R1 '5.1' lbl_winnt_XP - StrCmp $R1 '5.2' lbl_winnt_2003 - StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` - - - lbl_winnt_vista: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.762_none_11ecb0ab9b2caf3c.manifest" 0 `${_f}` - Goto `${_t}` - - lbl_winnt_2003: - lbl_winnt_XP: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_cbb27474.manifest" 0 `${_f}` - Goto `${_t}` -!macroend -!define VCRedistIsInstalled `"" VCRedistIsInstalled ""` - -!macro _dotNetIsInstalled _a _b _t _f - SetRegView 32 - - !insertmacro _LOGICLIB_TEMP - - ReadRegStr $4 HKLM "Software\Microsoft\.NETFramework" "InstallRoot" - # remove trailing back slash - Push $4 - Exch $EXEDIR - Exch $EXEDIR - Pop $4 - # if the root directory doesn't exist .NET is not installed - IfFileExists $4 0 `${_f}` - - StrCpy $0 0 - - EnumStart: - - EnumRegKey $2 HKLM "Software\Microsoft\.NETFramework\Policy" $0 - IntOp $0 $0 + 1 - StrCmp $2 "" `${_f}` - - StrCpy $1 0 - - EnumPolicy: - - EnumRegValue $3 HKLM "Software\Microsoft\.NETFramework\Policy\$2" $1 - IntOp $1 $1 + 1 - StrCmp $3 "" EnumStart - IfFileExists "$4\$2.$3" `${_t}` EnumPolicy -!macroend -!define dotNetIsInstalled `"" dotNetIsInstalled ""` - -#**********************************************************************************************************# -# Get MP infos -!macro MP_GET_INSTALL_DIR _var - SetRegView 32 - - ${If} ${MP023IsInstalled} - ReadRegStr ${_var} HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" - ${ElseIf} ${MPIsInstalled} - ReadRegStr ${_var} HKLM "${MP_REG_UNINSTALL}" "InstallPath" - ${Else} - StrCpy ${_var} "" - ${EndIf} - -!macroend - -!macro TVSERVER_GET_INSTALL_DIR _var - SetRegView 32 - - ${If} ${TVServerIsInstalled} - ReadRegStr ${_var} HKLM "${TV3_REG_UNINSTALL}" "InstallPath" - ${Else} - StrCpy ${_var} "" - ${EndIf} - -!macroend - -!insertmacro GetTime -!macro GET_BACKUP_POSTFIX _var - - ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 - ; $0="01" day - ; $1="04" month - ; $2="2005" year - ; $3="Friday" day of week name - ; $4="16" hour - ; $5="05" minute - ; $6="50" seconds - - StrCpy ${_var} "BACKUP_$1-$0_$4-$5" - -!macroend - - - -#**********************************************************************************************************# -# -# common language strings -# -#**********************************************************************************************************# -LangString TEXT_MP_NOT_INSTALLED ${LANG_ENGLISH} "MediaPortal not installed" -LangString TEXT_TVSERVER_NOT_INSTALLED ${LANG_ENGLISH} "TVServer not installed" - - -LangString TEXT_MSGBOX_INSTALLATION_CANCELD ${LANG_ENGLISH} "Installation will be canceled." -LangString TEXT_MSGBOX_MORE_INFO ${LANG_ENGLISH} "Do you want to get more information about it?" - -LangString TEXT_MSGBOX_ERROR_WIN ${LANG_ENGLISH} "Your operating system is not supported by $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" -LangString TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED ${LANG_ENGLISH} "Your operating system is not recommended by $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" -LangString TEXT_MSGBOX_ERROR_ADMIN ${LANG_ENGLISH} "You need administration rights to install $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)" -LangString TEXT_MSGBOX_ERROR_VCREDIST ${LANG_ENGLISH} "Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" -LangString TEXT_MSGBOX_ERROR_DOTNET ${LANG_ENGLISH} "Microsoft .Net Framework 2 is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" - -LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "$(^Name) is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." -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." - - - - /* -; Section flag test -!macro _MPIsInstalled _a _b _t _f - !insertmacro _LOGICLIB_TEMP - - ReadRegStr $MPBaseDir HKLM "${MP_REG_UNINSTALL}" "UninstallString" - ${If} $MPBaseDir == "" - # this fallback should only be enabled until MediaPortal 1.0 is out - ReadRegStr $MPBaseDir HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" - -#!define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" -#!define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" - - ${If} $MPBaseDir == "" - !insertmacro UnselectSection "${SecClient}" - ; Make the unselected section read only - !insertmacro SetSectionFlag "${SecClient}" 16 - SectionGetText ${SecClient} $R0 - SectionSetText ${SecClient} "$R0 ($(TEXT_MP_NOT_INSTALLED))" - ${EndIf} - ${EndIf} - SectionGetFlags `${_b}` $_LOGICLIB_TEMP - IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP & `${_a}` - - !insertmacro _= $_LOGICLIB_TEMP `${_a}` `${_t}` `${_f}` - !macroend - - #!define MPIsInstalled `${SF_SELECTED} SectionFlagIsSet` -!define MPIsInstalled "!insertmacro _MPIsInstalled" - */ - - - -#*************************** -#*************************** - -Var MyDocs -Var UserAppData -Var CommonAppData - -Var MPdir.Base - -Var MPdir.Config -Var MPdir.Plugins -Var MPdir.Log -Var MPdir.CustomInputDevice -Var MPdir.CustomInputDefault -Var MPdir.Skin -Var MPdir.Language -Var MPdir.Database -Var MPdir.Thumbs -Var MPdir.Weather -Var MPdir.Cache -Var MPdir.BurnerSupport - -#*************************** -#*************************** - -!macro GET_PATH_TEXT - - Pop $R0 - - ${xml::GotoPath} "/Config" $0 - ${If} $0 != 0 - ${LOG_TEXT} "ERROR" "xml::GotoPath /Config" - Goto error - ${EndI... [truncated message content] |
From: <che...@us...> - 2008-11-12 15:35:55
|
Revision: 2331 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2331&view=rev Author: chef_koch Date: 2008-11-12 15:35:43 +0000 (Wed, 12 Nov 2008) Log Message: ----------- - added common mp nsis stuff - only formatting style changes in addremovepage Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/GetVersion.dll 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/XML-plugin/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Plugin/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Plugin/xml.dll trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Readme.html trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Build.cmd trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Install.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Install.dsp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Install.dsw trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/Install.ico trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/Install.rc trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/Install/Res/Resource.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/StackFunc.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/action_store.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/action_store.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/build.cmd trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/byte_stream.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/lex_token.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/lex_util.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/lex_util.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/node_set.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/node_set.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinystr.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinystr.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxml.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxml.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxmlerror.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxmlparser.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tinyxpath_conf.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tokenlist.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/tokenlist.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml.dsp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml.dsw trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml_util.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xml_util.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_expression.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_expression.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_processor.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_processor.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stack.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stack.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_static.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_static.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stream.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_stream.h trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_syntax.cpp trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Source/xpath_syntax.h trunk/plugins/IR Server Suite/setup/CommonNSIS/include-DotNetFramework.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-WinVerEx.nsh Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.cpp 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,740 @@ +#include <windows.h> +#include "..\ExDll\exdll.h" +#include "shlwapi.h" +#include <stdio.h> + +/** + GetVersion.cpp - Windows version info plugin for NSIS by Afrow UK + Based on example script by Microsoft at: + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp +*/ + +#define ERROR_STRING TEXT("GetVersion error") +#define SM_SERVERR2 89 +typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); +typedef BOOL (WINAPI *PGPI)(DWORD, DWORD, DWORD, DWORD, PDWORD); + +HINSTANCE g_hInstance; + +#ifndef VER_PLATFORM_WIN32_CE +#define VER_PLATFORM_WIN32_CE 3 +#endif + +#ifndef VER_SUITE_STORAGE_SERVER +#define VER_SUITE_STORAGE_SERVER 0x00002000 +#endif +#ifndef VER_SUITE_COMPUTE_SERVER +#define VER_SUITE_COMPUTE_SERVER 0x00004000 +#endif + +#define PRODUCT_UNDEFINED 0x00000000 + +#define PRODUCT_ULTIMATE 0x00000001 +#define PRODUCT_HOME_BASIC 0x00000002 +#define PRODUCT_HOME_PREMIUM 0x00000003 +#define PRODUCT_ENTERPRISE 0x00000004 +#define PRODUCT_HOME_BASIC_N 0x00000005 +#define PRODUCT_BUSINESS 0x00000006 +#define PRODUCT_STANDARD_SERVER 0x00000007 +#define PRODUCT_DATACENTER_SERVER 0x00000008 +#define PRODUCT_SMALLBUSINESS_SERVER 0x00000009 +#define PRODUCT_ENTERPRISE_SERVER 0x0000000A +#define PRODUCT_STARTER 0x0000000B +#define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C +#define PRODUCT_STANDARD_SERVER_CORE 0x0000000D +#define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E +#define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F +#define PRODUCT_BUSINESS_N 0x00000010 +#define PRODUCT_WEB_SERVER 0x00000011 +#define PRODUCT_CLUSTER_SERVER 0x00000012 +#define PRODUCT_HOME_SERVER 0x00000013 +#define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014 +#define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015 +#define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016 +#define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017 +#define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018 +#define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019 + +#define PRODUCT_UNLICENSED 0xABCDABCD + +BOOL callGetVersion(LPOSVERSIONINFOEXA posvi, BOOL *pbOsVersionInfoEx) +{ + // Try calling GetVersionEx using the OSVERSIONINFOEX structure. + // If that fails, try using the OSVERSIONINFO structure. + + posvi->dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + + if (!(*pbOsVersionInfoEx = GetVersionEx((LPOSVERSIONINFOA)posvi))) + { + posvi->dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if (!GetVersionEx((LPOSVERSIONINFOA)posvi)) + { + pushstring(ERROR_STRING); + return FALSE; + } + } + return TRUE; +} + +extern "C" +void __declspec(dllexport) WindowsName(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsName = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Test for the specific product. + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) + { + if (osvi.wProductType == VER_NT_WORKSTATION) + szOsName = "Vista"; + else szOsName = "Server Longhorn"; + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) + { + + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + + if (NULL != pGNSI) + pGNSI(&si); + + if (GetSystemMetrics(SM_SERVERR2)) + szOsName = "Server 2003 R2"; + else if (osvi.wProductType == VER_NT_WORKSTATION && si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) + szOsName = "XP x64"; + else szOsName = "Server 2003"; + + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + szOsName = "XP"; + + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + szOsName = "2000"; + + else if (osvi.dwMajorVersion <= 4) + szOsName = "NT"; + + break; + + // Test for Windows CE. + case VER_PLATFORM_WIN32_CE: + szOsName = "CE"; + break; + + // Test for the Windows Me/98/95. + case VER_PLATFORM_WIN32_WINDOWS: + + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) + { + szOsName = "95"; + if (osvi.szCSDVersion[1]=='C' || osvi.szCSDVersion[1]=='B') + lstrcat(szOsName, " OSR2"); + } + + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10) + { + szOsName = "98"; + if (osvi.szCSDVersion[1] == 'A') + lstrcat(szOsName, " SE"); + } + + if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) + { + szOsName = "ME"; + } + break; + + case VER_PLATFORM_WIN32s: + + szOsName = "Win32s"; + break; + } + pushstring(szOsName); + } +} + +extern "C" +void __declspec(dllexport) WindowsType(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsType = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + PGPI pGPI; + DWORD dwType; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + //ZeroMemory(&si, sizeof(SYSTEM_INFO)); + + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); + if (pGNSI) + pGNSI(&si); + else GetSystemInfo(&si); + + if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) + { + pGPI = (PGPI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo"); + pGPI(6, 0, 0, 0, &dwType); + + switch(dwType) + { + case PRODUCT_ULTIMATE: + szOsType = "Ultimate Edition"; + break; + case PRODUCT_HOME_PREMIUM: + szOsType = "Home Premium Edition"; + break; + case PRODUCT_HOME_BASIC: + szOsType = "Home Basic Edition"; + break; + case PRODUCT_ENTERPRISE: + szOsType = "Enterprise Edition"; + break; + case PRODUCT_BUSINESS: + szOsType = "Business Edition"; + break; + case PRODUCT_STARTER: + szOsType = "Starter Edition"; + break; + } + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + { + HKEY hKeyMCE, hKeyTPCE; + DWORD dwBufLen; + LONG lRetMCE, lRetTPCE; + DWORD dwInstMCE = 0, dwInstTPCE = 0; + + lRetMCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\MediaCenter", 0, KEY_QUERY_VALUE, &hKeyMCE); + lRetTPCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\TabletPC" , 0, KEY_QUERY_VALUE, &hKeyTPCE); + + if (lRetMCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetMCE = RegQueryValueEx(hKeyMCE, "Installed", NULL, NULL, (LPBYTE)dwInstMCE, &dwBufLen); + } + if (lRetTPCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetTPCE = RegQueryValueEx(hKeyTPCE, "Installed", NULL, NULL, (LPBYTE)dwInstTPCE, &dwBufLen); + } + + if (lRetMCE == ERROR_SUCCESS) + RegCloseKey(hKeyMCE); + if (lRetTPCE == ERROR_SUCCESS) + RegCloseKey(hKeyTPCE); + + if (dwInstMCE == 0 && dwInstTPCE == 0) + { + if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + szOsType = "Home Edition"; + else if (osvi.wSuiteMask & VER_SUITE_EMBEDDEDNT) + szOsType = "Embedded"; + else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) + szOsType = "Professional x64 Edition"; + else + szOsType = "Professional"; + } + else if (dwInstMCE == 1) + szOsType = "Media Center Edition"; + else if (dwInstTPCE == 1) + szOsType = "Tablet PC Edition"; + else + szOsType = ""; + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + szOsType = "Professional"; + else if (osvi.dwMajorVersion == 4) + szOsType = "Workstation 4.0"; + } + +/* switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + + if (NULL != pGNSI) + pGNSI(&si); + + if (osvi.wProductType == VER_NT_WORKSTATION) + { + if (osvi.dwMajorVersion == 4) + szOsType = "Workstation 4.0"; + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + { + HKEY hKeyMCE, hKeyTPCE; + DWORD dwBufLen; + LONG lRetMCE, lRetTPCE; + DWORD dwInstMCE = 0, dwInstTPCE = 0; + + lRetMCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\MediaCenter", 0, KEY_QUERY_VALUE, &hKeyMCE); + lRetTPCE = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\WPA\\TabletPC" , 0, KEY_QUERY_VALUE, &hKeyTPCE); + + if (lRetMCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetMCE = RegQueryValueEx(hKeyMCE, "Installed", NULL, NULL, (LPBYTE)dwInstMCE, &dwBufLen); + } + if (lRetTPCE != ERROR_SUCCESS) + { + dwBufLen = sizeof(DWORD); + lRetTPCE = RegQueryValueEx(hKeyTPCE, "Installed", NULL, NULL, (LPBYTE)dwInstTPCE, &dwBufLen); + } + + if (lRetMCE == ERROR_SUCCESS) + RegCloseKey(hKeyMCE); + if (lRetTPCE == ERROR_SUCCESS) + RegCloseKey(hKeyTPCE); + + if (dwInstMCE == 0 && dwInstTPCE == 0) + { + if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + szOsType = "Home Edition"; + else if (osvi.wSuiteMask & VER_SUITE_EMBEDDEDNT) + szOsType = "Embedded"; + else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) + szOsType = "Professional x64 Edition"; + else + szOsType = "Professional"; + } + else if (dwInstMCE == 1) + szOsType = "Media Center Edition"; + else if (dwInstTPCE == 1) + szOsType = "Tablet PC Edition"; + else + szOsType = ""; + } + else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + szOsType = "Professional"; + else if (osvi.dwMajorVersion == 6) + { + if (osvi.wSuiteMask & VER_SUITE_PERSONAL) + szOsType = "Home Premium/Basic"; + } + else szOsType = ""; + } + else szOsType = ""; + + break; + }*/ + pushstring(szOsType); + + } +} + +extern "C" +void __declspec(dllexport) WindowsVersion(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char szOsVer[16]; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + wsprintf(szOsVer, "%i.%i", osvi.dwMajorVersion, osvi.dwMinorVersion); + pushstring(szOsVer); + } +} + +extern "C" +void __declspec(dllexport) WindowsPlatformId(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char szOsPId[16]; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + wsprintf(szOsPId, "%i", osvi.dwPlatformId); + pushstring(szOsPId); + } +} + +extern "C" +void __declspec(dllexport) WindowsPlatformArchitecture(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsPlatArch = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + + if (NULL != pGNSI) + { + pGNSI(&si); + + if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) + szOsPlatArch = "64"; + else + szOsPlatArch = "32"; + } + else + szOsPlatArch = "32"; + + pushstring(szOsPlatArch); + } + } +} + +extern "C" +void __declspec(dllexport) WindowsServerName(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsServName = NULL; + PGNSI pGNSI; + SYSTEM_INFO si; + PGPI pGPI; + DWORD dwType; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Test for specific product on Windows NT 4.0 SP6 and later. + if (bOsVersionInfoEx) + { + // Test for the workstation type. + if (osvi.wProductType == VER_NT_WORKSTATION) + { + // Test for the server type. + if (osvi.wProductType == VER_NT_SERVER || + osvi.wProductType == VER_NT_DOMAIN_CONTROLLER) + { + if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==2) + { + // Use GetProcAddress to avoid load issues on Windows 2000 + pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); + if (pGNSI) + pGNSI(&si); + + if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64) + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter Edition for Itanium-based Systems"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Enterprise Edition for Itanium-based Systems"; + } + + else if (si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64) + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter x64 Edition"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Enterprise x64 Edition"; + else szOsServName = "Standard x64 Edition"; + } + + else + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter Edition"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Enterprise Edition"; + else if (osvi.wSuiteMask == VER_SUITE_BLADE) + szOsServName = "Enterprise Edition"; + else if (osvi.wSuiteMask == VER_SUITE_STORAGE_SERVER) + szOsServName = "Storage Server 2003"; + else if (osvi.wSuiteMask == VER_SUITE_COMPUTE_SERVER) + szOsServName = "Server 2003"; + else if (osvi.wSuiteMask == VER_SUITE_SMALLBUSINESS) + szOsServName = "Small Business Server"; + else szOsServName = "Standard Edition"; + } + } + else if (osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0) + { + if (osvi.wSuiteMask & VER_SUITE_DATACENTER) + szOsServName = "Datacenter Server"; + else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Advanced Server"; + else szOsServName = "Server"; + } + else if (osvi.dwMajorVersion==6 && osvi.dwMinorVersion==0) + { + if (!osvi.wSuiteMask & VER_NT_WORKSTATION) + szOsServName = "Server 2008"; + else + { + pGPI = (PGPI)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetProductInfo"); + pGPI(6, 0, 0, 0, &dwType); + + switch(dwType) + { + case PRODUCT_DATACENTER_SERVER: + case PRODUCT_DATACENTER_SERVER_CORE: + szOsServName = "Datacenter Edition"; + break; + case PRODUCT_ENTERPRISE_SERVER: + case PRODUCT_ENTERPRISE_SERVER_CORE: + szOsServName = "Enterprise Edition"; + break; + case PRODUCT_STANDARD_SERVER: + case PRODUCT_STANDARD_SERVER_CORE: + szOsServName = "Standard Edition"; + break; + case PRODUCT_ENTERPRISE_SERVER_IA64: + szOsServName = "Enterprise Edition for Itanium-based Systems"; + break; + case PRODUCT_SMALLBUSINESS_SERVER: + szOsServName = "Small Business Server"; + break; + case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: + szOsServName = "Small Business Server Premium Edition"; + break; + case PRODUCT_CLUSTER_SERVER: + szOsServName = "Cluster Server Edition"; + break; + case PRODUCT_WEB_SERVER: + szOsServName = "Web Server Edition"; + break; + } + } + } + else // Windows NT 4.0 + { + if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) + szOsServName = "Server 4.0 Enterprise Edition"; + else szOsServName = "Server 4.0"; + } + } + } + + // Test for specific product on Windows NT 4.0 SP5 and earlier + } + else + { + HKEY hKey; + char szProductType[128]; + DWORD dwBufLen; + LONG lRet; + + lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\ProductOptions", 0, KEY_QUERY_VALUE, &hKey); + if (lRet != ERROR_SUCCESS) + szOsServName = ERROR_STRING; + else + { + dwBufLen = sizeof(szProductType); + lRet = RegQueryValueEx(hKey, "ProductType", NULL, NULL, (LPBYTE)szProductType, &dwBufLen); + if (lRet != ERROR_SUCCESS) + szOsServName = ERROR_STRING; + else + { + RegCloseKey(hKey); + + if (lstrcmpi("WINNT", szProductType) == 0) + szOsServName = "Workstation"; + else if (lstrcmpi("LANMANNT", szProductType) == 0) + szOsServName = "Server"; + else if (lstrcmpi("SERVERNT", szProductType) == 0) + szOsServName = "Advanced Server"; + } + } + } + } + pushstring(szOsServName); + } +} + +extern "C" +void __declspec(dllexport) WindowsServicePack(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + char *szOsServPack = NULL; + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + switch (osvi.dwPlatformId) + { + // Test for the Windows NT product family. + case VER_PLATFORM_WIN32_NT: + + // Display service pack (if any) and build number. + if (osvi.dwMajorVersion == 4 && + lstrcmpi(osvi.szCSDVersion, "Service Pack 6") == 0) + { + HKEY hKey; + LONG lRet; + + // Test for SP6 versus SP6a. + lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009", 0, KEY_QUERY_VALUE, &hKey); + if (lRet == ERROR_SUCCESS) + szOsServPack = "Service Pack 6a"; + else // Windows NT 4.0 prior to SP6a + szOsServPack = osvi.szCSDVersion; + + RegCloseKey(hKey); + } + else // not Windows NT 4.0 + { + szOsServPack = osvi.szCSDVersion; + } + break; + } + pushstring(szOsServPack); + } +} + +extern "C" +void __declspec(dllexport) WindowsServicePackBuild(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!callGetVersion(&osvi, &bOsVersionInfoEx)) + { + pushstring(""); + return; + } + + char szServPackBuild[16]; + wsprintf(szServPackBuild, "%i", osvi.dwBuildNumber & 0xFFFF); + pushstring(szServPackBuild); + } +} + +/*extern "C" +void __declspec(dllexport) IEVersion(HWND hWndParent, int string_size, + char *variables, stack_t **stacktop, + extra_parameters *extra) +{ + EXDLL_INIT(); + { + HINSTANCE hBrowser; + + //Load the DLL. + hBrowser = LoadLibrary(TEXT("shdocvw.dll")); + + if (hBrowser) + { + HRESULT hr = S_OK; + DLLGETVERSIONPROC pDllGetVersion; + + pDllGetVersion = + (DLLGETVERSIONPROC)GetProcAddress(hBrowser, + TEXT("DllGetVersion")); + + if (pDllGetVersion) + { + char buf[32]; + + DLLVERSIONINFO dvi; + + dvi.cbSize = sizeof(dvi); + hr = (*pDllGetVersion)(&dvi); + + if (SUCCEEDED(hr)) + { + wsprintf(buf, "%i", dvi.dwBuildNumber); + pushstring(buf); + wsprintf(buf, "%i.%i", dvi.dwMajorVersion, dvi.dwMinorVersion); + pushstring(buf); + } + + } + else + //If GetProcAddress failed, there is a problem + // with the DLL. + hr = E_FAIL; + + FreeLibrary(hBrowser); + } + } +}*/ + +BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) +{ + g_hInstance = (HINSTANCE)hInst; + return TRUE; +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Contrib/GetVersion/GetVersion.vcproj 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="7.10" + Name="GetVersion" + ProjectGUID="{970880F8-9482-4AF1-995D-5E0E7207B0A5}" + SccProjectName="" + SccLocalPath=""> + <Platforms> + <Platform + Name="Win32"/> + </Platforms> + <Configurations> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="2" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;GetVersion_EXPORTS" + StringPooling="TRUE" + RuntimeLibrary="0" + EnableFunctionLevelLinking="TRUE" + UsePrecompiledHeader="2" + PrecompiledHeaderFile=".\Release/GetVersion.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="TRUE"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile="../../Plugins/GetVersion.dll" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + IgnoreAllDefaultLibraries="TRUE" + ProgramDatabaseFile=".\Release/GetVersion.pdb" + OptimizeForWindows98="1" + EntryPointSymbol="DllMain" + ImportLibrary=".\Release/GetVersion.lib" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Release/GetVersion.tlb" + HeaderFileName=""/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug" + IntermediateDirectory=".\Debug" + ConfigurationType="2" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="FALSE" + CharacterSet="2"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;GetVersion_EXPORTS" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="2" + PrecompiledHeaderFile=".\Debug/GetVersion.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + WarningLevel="3" + SuppressStartupBanner="TRUE" + DebugInformationFormat="4"/> + <Tool + Name="VCCustomBuildTool"/> + <Tool + Name="VCLinkerTool" + OutputFile=".\Debug/GetVersion.dll" + LinkIncremental="1" + SuppressStartupBanner="TRUE" + GenerateDebugInformation="TRUE" + ProgramDatabaseFile=".\Debug/GetVersion.pdb" + ImportLibrary=".\Debug/GetVersion.lib" + TargetMachine="1"/> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="TRUE" + SuppressStartupBanner="TRUE" + TargetEnvironment="1" + TypeLibraryName=".\Debug/GetVersion.tlb" + HeaderFileName=""/> + <Tool + Name="VCPostBuildEventTool"/> + <Tool + Name="VCPreBuildEventTool"/> + <Tool + Name="VCPreLinkEventTool"/> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033"/> + <Tool + Name="VCWebServiceProxyGeneratorTool"/> + <Tool + Name="VCXMLDataGeneratorTool"/> + <Tool + Name="VCWebDeploymentTool"/> + <Tool + Name="VCManagedWrapperGeneratorTool"/> + <Tool + Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"> + <File + RelativePath="GetVersion.cpp"> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;GetVersion_EXPORTS;$(NoInherit)"/> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;GetVersion_EXPORTS;$(NoInherit)" + BasicRuntimeChecks="3"/> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl"> + <File + RelativePath="GetVersion.h"> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Docs/GetVersion/Readme.txt 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,164 @@ + ============================================================== + + GetVersion.dll v0.9 (5kB) by Afrow UK + + Last build: 12th October 2007 + + C++ NSIS plugin that gets Windows & IE version information. + + -------------------------------------------------------------- + + Place GetVersion.dll in your NSIS\Plugins folder or + simply extract all files in the Zip to NSIS\ + + See Examples\GetVersion\Example.nsi for examples of use. + + ============================================================== + The Functions: + + GetVersion::WindowsName + Pop $R0 + + Gets name of Windows. This includes: + Vista + Server Longhorn + Server 2003 + Server 2003 R2 + XP + XP x64 + 2000 + CE + NT + ME + 98 + 98 SE + 95 + 95 OSR2 + Win32s + + --------------------------- + + GetVersion::WindowsType + Pop $R0 + + Gets type of Windows OS. + For Windows NT: + Workstation 4.0 + For Windows XP: + Home Edition + Professional + Professional x64 Edition + Media Center Edition + Tablet PC Edition + (or empty string) + For Windows Vista: + Ultimate Edition + Home Premium Edition + Home Basic Edition + Enterprise Edition + Business Edition + Starter Edition + (or empty string) + + --------------------------- + + GetVersion::WindowsVersion + Pop $R0 + + Gets the Windows version x.x (e.g. 5.1). + + --------------------------- + + GetVersion::WindowsServerName + Pop $R0 + + Gets the installed server name. This includes: + Server + Server 4.0 + Server 4.0 Enterprise Edition + Workstation + Storage Server 2003 + Server 2003 + Server 2008 + Cluster Server Edition + Datacenter Edition + Datacenter Edition for Itanium-based Systems + Datacenter x64 Edition + Enterprise Edition + Enterprise Edition for Itanium-based Systems + Enterprise x64 Edition + Advanced Server + Small Business Server + Small Business Server Premium Edition + Standard Edition + Web Server Edition + (or empty string) + + --------------------------- + + GetVersion::WindowsServicePack + Pop $R0 + + Gets the installed service pack name (e.g. Service Pack 2). + + --------------------------- + + GetVersion::WindowsServicePackBuild + Pop $R0 + + Gets the installed service pack build number (e.g. 2600). + + --------------------------- + + GetVersion::WindowsPlatformId + Pop $R0 + + Gets the platform Id of the installed Windows + (e.g. 1, 2, 3). + + --------------------------- + + GetVersion::WindowsPlatformArchitecture + Pop $R0 + + Gets the architecture of the installed Windows + (e.g. 32, 64). + + ============================================================== + Change Log: + + v0.9 + * Major code clean up. + * All functions now return an empty string if GetVersionEx API call fails. + * Added Windows types and server names for Vista. + + v0.8 + * Fixed WindowsType. + * Removed function to get IE version. + + v0.7 + * WindowsName now returns simple names (not Windows #). + + v0.6 + * Added support for Windows CE. + + v0.5 + * Added support for Windows XP Media Center Edition (in + WindowsType). + * Added support for Windows XP Tablet PC Edition (in + WindowsType). + + v0.4 + * Added WindowsPlatformId. + * Added WindowsPlatformArchitecture. + + v0.3 + * Added support for Windows Vista and Longhorn Server. + + v0.2 + * Added support for Windows x64. + * No support added for Windows Vista as yet (waiting for + Microsoft to update their page for it!) + + v0.1 + * First version. \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Examples/GetVersion/Example.nsi 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,49 @@ +Name "GetVersion Example" +OutFile "GetVersion.exe" +ShowInstDetails show + +Page InstFiles + +Section + + GetVersion::WindowsName + Pop $R0 + DetailPrint "WindowsName:" + DetailPrint " $R0" + + GetVersion::WindowsType + Pop $R0 + DetailPrint "WindowsType:" + DetailPrint " $R0" + + GetVersion::WindowsVersion + Pop $R0 + DetailPrint "WindowsVersion:" + DetailPrint " $R0" + + GetVersion::WindowsServerName + Pop $R0 + DetailPrint "WindowsServerName:" + DetailPrint " $R0" + + GetVersion::WindowsPlatformId + Pop $R0 + DetailPrint "WindowsPlatformId:" + DetailPrint " $R0" + + GetVersion::WindowsPlatformArchitecture + Pop $R0 + DetailPrint "WindowsPlatformArchitecture:" + DetailPrint " $R0" + + GetVersion::WindowsServicePack + Pop $R0 + DetailPrint "WindowsServicePack:" + DetailPrint " $R0" + + GetVersion::WindowsServicePackBuild + Pop $R0 + DetailPrint "WindowsServicePackBuild:" + DetailPrint " $R0" + +SectionEnd \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/GetVersion.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/setup/CommonNSIS/GetVersion-plugin/Plugins/GetVersion.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/NsisTestApplication.nsi 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,288 @@ +#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 + Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/RevisionInfoTemplate.nsh 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1 @@ +!define SVN_REVISION "$WCREV$" \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/XMLTest.nsi 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,142 @@ +Name "XMLTest" +OutFile "XMLTest.exe" + +!include "XML.nsh" +!include "Sections.nsh" + +Var RADIOBUTTON + +Page components +Page instfiles + + +Section "Read 'BBB' example 1" Read1 + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::FirstChildElement} "" $0 $1 + MessageBox MB_OK "xml::FirstChildElement$\n$$0=$0$\n$$1=$1" + + ${xml::NextSiblingElement} "b" $0 $1 + MessageBox MB_OK "xml::NextSiblingElement$\n$$0=$0$\n$$1=$1" + + ${xml::FirstChild} "" $0 $1 + MessageBox MB_OK "xml::FirstChild$\n$$0=$0$\n$$1=$1" + + ${xml::Unload} +SectionEnd + + +Section /o "Read 'BBB' example 2" Read2 + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::GotoPath} "/a/b" $0 + MessageBox MB_OK "xml::GotoPath$\n$$0=$0" + + ${xml::GetText} $0 $1 + MessageBox MB_OK "xml::GetText$\n$$0=$0$\n$$1=$1" + + ${xml::Unload} +SectionEnd + + +Section /o "Read attributes example" ReadAttributes + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::GotoPath} "/a[2]/d" $0 + MessageBox MB_OK "xml::GotoPath$\n$$0=$0" + + ${xml::GetAttribute} "attr2" $0 $1 + MessageBox MB_OK "xml::GetAttribute$\n$$0=$0$\n$$1=$1" + + loop: + ${xml::NextAttribute} $0 $1 $2 + MessageBox MB_YESNO "xml::NextAttribute$\n$$0=$0$\n$$1=$1$\n$$2=$2$\n$\nContinue?" IDYES loop + + #Used only for unload plugin + ${xml::NodeHandle} $0 + + ${xml::Unload} +SectionEnd + + +Section /o "Node replace example" NodeReplace + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::NextSiblingElement} "" $0 $1 + MessageBox MB_OK "xml::NextSiblingElement$\n$$0=$0$\n$$1=$1" + + ${xml::NodeHandle} $R0 + MessageBox MB_OK "xml::NodeHandle$\n$$R0=$R0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::FirstChildElement} "" $0 $1 + MessageBox MB_OK "xml::FirstChildElement$\n$$0=$0$\n$$1=$1" + + ${xml::ReplaceNode} "$R0" $0 + MessageBox MB_OK "xml::ReplaceNode$\n$$0=$0" + + ${xml::SaveFile} "test_saved.xml" $0 + MessageBox MB_OK "xml::SaveFile$\n$$0=$0" + + ${xml::Unload} +SectionEnd + + +Section /o "Search element example" SearchElement + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + loop: + ${xml::FindNextElement} "a" $0 $1 + MessageBox MB_OK "xml::FindNextElement$\n$$0=$0$\n$$1=$1" + + ${xml::ElementPath} $0 + MessageBox MB_YESNO "xml::ElementPath$\n$$0=$0$\n$\nContinue?" IDYES loop + + ${xml::FindCloseElement} + MessageBox MB_OK "xml::FindCloseElement" + + ${xml::Unload} +SectionEnd + + +Section /o "XPath example" XPath + ${xml::LoadFile} "test.xml" $0 + MessageBox MB_OK "xml::LoadFile$\n$$0=$0" + + ${xml::RootElement} $0 $1 + MessageBox MB_OK "xml::RootElement$\n$$0=$0$\n$$1=$1" + + ${xml::XPathString} "count(//*/comment())" $0 $1 + MessageBox MB_OK "xml::XPathString$\n$$0=$0$\n$$1=$1" + + ${xml::Unload} +SectionEnd + + +Function .onInit + StrCpy $RADIOBUTTON ${Read1} +FunctionEnd + +Function .onSelChange + !insertmacro StartRadioButtons $RADIOBUTTON + !insertmacro RadioButton ${Read1} + !insertmacro RadioButton ${Read2} + !insertmacro RadioButton ${ReadAttributes} + !insertmacro RadioButton ${NodeReplace} + !insertmacro RadioButton ${SearchElement} + !insertmacro RadioButton ${XPath} + !insertmacro EndRadioButtons +FunctionEnd Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Example/test.xml 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- world --> +<a> + <a>AAA + <a> + <!-- a --> + <bold>GGG</bold> + </a> + </a> + <!-- b --> + <c>CCC + <m>EEE</m> + </c> + <a>FFF</a> + <b>BBB</b> +</a> +<a> + <d attr1="value1" attr2="value2" attr3="value3" attr4="value4">HHH</d> +</a> Added: trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/XML-plugin/Include/XML.nsh 2008-11-12 15:35:43 UTC (rev 2331) @@ -0,0 +1,449 @@ +!define xml::SetCondenseWhiteSpace `!insertmacro xml::SetCondenseWhiteSpace` + +!macro xml::SetCondenseWhiteSpace _BOOL + xml::_SetCondenseWhiteSpace /NOUNLOAD `${_BOOL}` +!macroend + + +!define xml::SetEncoding `!insertmacro xml::SetEncoding` + +!macro xml::SetEncoding _ENCODING + xml::_SetEncoding /NOUNLOAD `${_ENCODING}` +!macroend + + +!define xml::LoadFile `!insertmacro xml::LoadFile` + +!macro xml::LoadFile _FILE _ERR + xml::_LoadFile /NOUNLOAD `${_FILE}` + Pop ${_ERR} +!macroend + + +!define xml::SaveFile `!insertmacro xml::SaveFile` + +!macro xml::SaveFile _FILE _ERR + xml::_SaveFile /NOUNLOAD `${_FILE}` + Pop ${_ERR} +!macroend + + +!define xml::DeclarationVersion `!insertmacro xml::DeclarationVersion` + +!macro xml::DeclarationVersion _ERR1 _ERR2 + xml::_DeclarationVersion /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::DeclarationEncoding `!insertmacro xml::DeclarationEncoding` + +!macro xml::DeclarationEncoding _ERR1 _ERR2 + xml::_DeclarationEncoding /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::DeclarationStandalone `!insertmacro xml::DeclarationStandalone` + +!macro xml::DeclarationStandalone _ERR1 _ERR2 + xml::_DeclarationStandalone /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::GetText `!insertmacro xml::GetText` + +!macro xml::GetText _ERR1 _ERR2 + xml::_GetText /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::SetText `!insertmacro xml::SetText` + +!macro xml::SetText _VALUE _ERR + xml::_SetText /NOUNLOAD `${_VALUE}` + Pop ${_ERR} +!macroend + + +!define xml::SetCDATA `!insertmacro xml::SetCDATA` + +!macro xml::SetCDATA _BOOL _ERR + xml::_SetCDATA /NOUNLOAD `${_BOOL}` + Pop ${_ERR} +!macroend + + +!define xml::IsCDATA `!insertmacro xml::IsCDATA` + +!macro xml::IsCDATA _ERR + xml::_IsCDATA /NOUNLOAD + Pop ${_ERR} +!macroend + + +!define xml::GetNodeValue `!insertmacro xml::GetNodeValue` + +!macro xml::GetNodeValue _ERR + xml::_GetNodeValue /NOUNLOAD + Pop ${_ERR} +!macroend + + +!define xml::SetNodeValue `!insertmacro xml::SetNodeValue` + +!macro xml::SetNodeValue _VALUE + xml::_SetNodeValue /NOUNLOAD `${_VALUE}` +!macroend + + +!define xml::FindNextElement `!insertmacro xml::FindNextElement` + +!macro xml::FindNextElement _NAME _ERR1 _ERR2 + xml::_FindNextElement /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::FindCloseElement `!insertmacro xml::FindCloseElement` + +!macro xml::FindCloseElement + xml::_FindCloseElement /NOUNLOAD +!macroend + + +!define xml::RootElement `!insertmacro xml::RootElement` + +!macro xml::RootElement _ERR1 _ERR2 + xml::_RootElement /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::FirstChildElement `!insertmacro xml::FirstChildElement` + +!macro xml::FirstChildElement _NAME _ERR1 _ERR2 + xml::_FirstChildElement /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::FirstChild `!insertmacro xml::FirstChild` + +!macro xml::FirstChild _NAME _ERR1 _ERR2 + xml::_FirstChild /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::LastChild `!insertmacro xml::LastChild` + +!macro xml::LastChild _NAME _ERR1 _ERR2 + xml::_LastChild /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::Parent `!insertmacro xml::Parent` + +!macro xml::Parent _ERR1 _ERR2 + xml::_Parent /NOUNLOAD + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::NoChildren `!insertmacro xml::NoChildren` + +!macro xml::NoChildren _ERR + xml::_NoChildren /NOUNLOAD + Pop ${_ERR} +!macroend + + +!define xml::NextSiblingElement `!insertmacro xml::NextSiblingElement` + +!macro xml::NextSiblingElement _NAME _ERR1 _ERR2 + xml::_NextSiblingElement /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::NextSibling `!insertmacro xml::NextSibling` + +!macro xml::NextSibling _NAME _ERR1 _ERR2 + xml::_NextSibling /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::PreviousSibling `!insertmacro xml::PreviousSibling` + +!macro xml::PreviousSibling _NAME _ERR1 _ERR2 + xml::_PreviousSibling /NOUNLOAD `${_NAME}` + Pop ${_ERR1} + Pop ${_ERR2} +!macroend + + +!define xml::InsertAfterNode `!insertmacro xml::InsertAfterNode` + +!macro xml::InsertAfterNode _HANDLE _ERR + xml::_InsertAfterNode /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::InsertBeforeNode `!insertmacro xml::InsertBeforeNode` + +!macro xml::InsertBeforeNode _HANDLE _ERR + xml::_InsertBeforeNode /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::InsertEndChild `!insertmacro xml::InsertEndChild` + +!macro xml::InsertEndChild _HANDLE _ERR + xml::_InsertEndChild /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::ReplaceNode `!insertmacro xml::ReplaceNode` + +!macro xml::ReplaceNode _HANDLE _ERR + xml::_ReplaceNode /NOUNLOAD `${_HANDLE}` + Pop ${_ERR} +!macroend + + +!define xml::RemoveNode `!insertmacro xml::RemoveNode` + +!macro xml::RemoveNode _ERR + xml::_RemoveNode /N... [truncated message content] |
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] |
From: <che...@us...> - 2009-04-01 08:16:24
|
Revision: 2753 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2753&view=rev Author: chef_koch Date: 2009-04-01 08:16:20 +0000 (Wed, 01 Apr 2009) Log Message: ----------- updated common mp macros fixed startmenu shortcut for abstractor Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh 2009-03-30 19:04:09 UTC (rev 2752) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh 2009-04-01 08:16:20 UTC (rev 2753) @@ -38,7 +38,7 @@ !define URL "www.team-mediaportal.com" !endif !ifndef WEB_REQUIREMENTS - !define WEB_REQUIREMENTS "http://wiki.team-mediaportal.com/GeneralRequirements/OperatingSystems" + !define WEB_REQUIREMENTS "http://wiki.team-mediaportal.com/GeneralRequirements" !endif @@ -63,6 +63,10 @@ # # enable it by defining USE_INSTALL_LOG in parent script #--------------------------------------------------------------------------- +!define prefixERROR "[ERROR !!!] " +!define prefixDEBUG "[ DEBUG ] " +!define prefixINFO "[ INFO] " + !ifdef USE_INSTALL_LOG !include FileFunc.nsh @@ -72,9 +76,6 @@ Var LogFile Var TempInstallLog -!define prefixERROR "[ERROR !!!] " -!define prefixDEBUG "[ DEBUG ] " -!define prefixINFO "[ INFO] " !define LOG_OPEN `!insertmacro LOG_OPEN ""` @@ -151,6 +152,7 @@ !define LOG_TEXT `!insertmacro LOG_TEXT` !macro LOG_TEXT LEVEL TEXT + DetailPrint "${prefix${LEVEL}}${TEXT}" !macroend !endif @@ -158,28 +160,103 @@ #--------------------------------------------------------------------------- # KILL Process macro for common usage #--------------------------------------------------------------------------- -!define KILLPROCESS `!insertmacro KILLPROCESS` -!macro KILLPROCESS PROCESS -/* -!if ${KILLMODE} == "1" - ExecShell "" "Cmd.exe" '/C "taskkill /F /IM "${PROCESS}""' SW_HIDE - Sleep 300 -!else if ${KILLMODE} == "2" - ExecWait '"taskkill" /F /IM "${PROCESS}"' -!else if ${KILLMODE} == "3" - nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' -!else -*/ - ${LOG_TEXT} "DEBUG" "KILLPROCESS: ${PROCESS}" - nsExec::ExecToLog '"taskkill" /F /IM "${PROCESS}"' +!define KillProcess `!insertmacro KillProcess` +!macro KillProcess Process + ${LOG_TEXT} "INFO" "KillProcess: ${Process}" - Pop $0 - ${LOG_TEXT} "DEBUG" "KILLPROCESS result: $0" + StrCpy $R1 1 ; set counter to 1 + ${Do} + nsExec::Exec '"taskkill" /F /IM "${Process}"' + + Pop $0 + + ${Select} $0 + ${Case} "0" + ${LOG_TEXT} "INFO" "KillProcess: ${Process} was killed successfully." + ${ExitDo} + ${Case} "128" + ${LOG_TEXT} "INFO" "KillProcess: ${Process} is not running." + ${ExitDo} + ${CaseElse} + + ${LOG_TEXT} "ERROR" "KillProcess: Unknown result: $0" + IntOp $R1 $R1 + 1 ; increase retry-counter +1 + ${If} $R1 > 5 ; try max. 5 times + ${ExitDo} + ${Else} + ${LOG_TEXT} "INFO" "KillProcess: Trying again. $R1/5" + ${EndIf} + + ${EndSelect} + ${Loop} !macroend +!define StopService `!insertmacro StopService` +!macro StopService Service + ${LOG_TEXT} "INFO" "StopService: ${Service}" + StrCpy $R1 1 ; set counter to 1 + ${Do} + nsExec::Exec 'net stop "${Service}"' + + Pop $0 + + ${Select} $0 + ${Case} "0" + ${LOG_TEXT} "INFO" "StopService: ${Service} was stopped successfully." + ${ExitDo} + ${Case} "2" + ${LOG_TEXT} "INFO" "StopService: ${Service} is not started." + ${ExitDo} + ${CaseElse} + + ${LOG_TEXT} "ERROR" "StopService: Unknown result: $0" + IntOp $R1 $R1 + 1 ; increase retry-counter +1 + ${If} $R1 > 5 ; try max. 5 times + ${ExitDo} + ${Else} + ${LOG_TEXT} "INFO" "StopService: Trying again. $R1/5" + ${EndIf} + + ${EndSelect} + ${Loop} +!macroend + +!macro RenameDirectory DirPath NewDirPath + ${LOG_TEXT} "INFO" "RenameDirectory: Old path: ${DirPath}" + ${LOG_TEXT} "INFO" "RenameDirectory: New path: ${NewDirPath}" + + ${If} ${FileExists} "${DirPath}\*.*" + ${LOG_TEXT} "INFO" "RenameDirectory: Directory exists. Trying to rename." + + StrCpy $R1 1 ; set counter to 1 + ${Do} + + ClearErrors + Rename "${DirPath}" "${NewDirPath}" + + IntOp $R1 $R1 + 1 ; increase retry-counter +1 + ${IfNot} ${Errors} + ${LOG_TEXT} "INFO" "RenameDirectory: Renamed directory successfully." + ${ExitDo} + ${ElseIf} $R1 > 5 ; try max. 5 times + ${LOG_TEXT} "ERROR" "RenameDirectory: Renaming directory failed for some reason." + ${ExitDo} + ${Else} + ${LOG_TEXT} "INFO" "RenameDirectory: Trying again. $R1/5" + ${EndIf} + + ${Loop} + + ${Else} + ${LOG_TEXT} "INFO" "RenameDirectory: Directory does not exist. No need to rename: ${DirPath}" + ${EndIf} +!macroend + + + #Var AR_SecFlags #Var AR_RegFlags @@ -420,31 +497,39 @@ # Get MP infos !macro MP_GET_INSTALL_DIR _var SetRegView 32 + ;${LOG_TEXT} "DEBUG" "MACRO:MP_GET_INSTALL_DIR" ${If} ${MP023IsInstalled} ReadRegStr ${_var} HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" + ${LOG_TEXT} "INFO" "MediaPortal v0.2.3 installation dir found: ${_var}" ${ElseIf} ${MPIsInstalled} ReadRegStr ${_var} HKLM "${MP_REG_UNINSTALL}" "InstallPath" + ${LOG_TEXT} "INFO" "MediaPortal installation dir found: ${_var}" ${Else} StrCpy ${_var} "" + ${LOG_TEXT} "INFO" "No MediaPortal installation found: _var will be empty" ${EndIf} !macroend !macro TVSERVER_GET_INSTALL_DIR _var SetRegView 32 + ;${LOG_TEXT} "DEBUG" "MACRO:TVSERVER_GET_INSTALL_DIR" ${If} ${TVServerIsInstalled} ${OrIf} ${TVClientIsInstalled} ReadRegStr ${_var} HKLM "${TV3_REG_UNINSTALL}" "InstallPath" + ${LOG_TEXT} "INFO" "TVServer/Client installation dir found: ${_var}" ${Else} StrCpy ${_var} "" + ${LOG_TEXT} "INFO" "No TVServer/Client installation found: _var will be empty" ${EndIf} !macroend !macro MP_GET_VERSION _var SetRegView 32 + ${LOG_TEXT} "DEBUG" "MACRO:MP_GET_VERSION" ${If} ${MPIsInstalled} ReadRegDWORD $R0 HKLM "${MP_REG_UNINSTALL}" "VersionMajor" @@ -460,6 +545,7 @@ !macro TVSERVER_GET_VERSION _var SetRegView 32 + ${LOG_TEXT} "DEBUG" "MACRO:TVSERVER_GET_VERSION" ${If} ${TVServerIsInstalled} ${OrIf} ${TVClientIsInstalled} @@ -509,12 +595,17 @@ LangString TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED ${LANG_ENGLISH} "Your operating system is not recommended by $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" LangString TEXT_MSGBOX_ERROR_ADMIN ${LANG_ENGLISH} "You need administration rights to install $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)" LangString TEXT_MSGBOX_ERROR_VCREDIST ${LANG_ENGLISH} "Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" -LangString TEXT_MSGBOX_ERROR_DOTNET ${LANG_ENGLISH} "Microsoft .Net Framework 2 is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_DOTNET20 ${LANG_ENGLISH} "Microsoft .Net Framework 2.0 SP2 is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_DOTNET20_SP ${LANG_ENGLISH} "Microsoft .Net Framework 2.0 is installed.$\r$\nBut Service Pack 2 is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_DOTNET35 ${LANG_ENGLISH} "Microsoft .Net Framework 3.5 SP1 is not installed.$\r$\nIt is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" +LangString TEXT_MSGBOX_ERROR_DOTNET35_SP ${LANG_ENGLISH} "Microsoft .Net Framework 3.5 is installed.$\r$\nBut Service Pack 1 is a requirement for $(^Name).$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n$(TEXT_MSGBOX_MORE_INFO)" LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "$(^Name) is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." 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 TEXT_MSGBOX_ERROR_UPDATE_BUT_NOT_INSTALLED ${LANG_ENGLISH} "$(^Name) is not installed. It is not possible to install this update.$\r$\n$\r$\n$(TEXT_MSGBOX_INSTALLATION_CANCELD)" + 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" @@ -652,14 +743,14 @@ !insertmacro WordReplace !insertmacro un.WordReplace !macro ReadMPdir UNINSTALL_PREFIX DIR - ${LOG_TEXT} "DEBUG" "macro: ReadMPdir | DIR: ${DIR}" + ;${LOG_TEXT} "DEBUG" "macro: ReadMPdir | DIR: ${DIR}" Push "${DIR}" Call ${UNINSTALL_PREFIX}GET_PATH_TEXT Pop $0 ${IfThen} $0 == -1 ${|} Goto error ${|} - ${LOG_TEXT} "DEBUG" "macro: ReadMPdir | text found in xml: '$0'" + ;${LOG_TEXT} "DEBUG" "macro: ReadMPdir | text found in xml: '$0'" ${${UNINSTALL_PREFIX}WordReplace} "$0" "%APPDATA%" "$UserAppData" "+" $0 ${${UNINSTALL_PREFIX}WordReplace} "$0" "%PROGRAMDATA%" "$CommonAppData" "+" $0 @@ -687,7 +778,7 @@ #*************************** !macro ReadConfig UNINSTALL_PREFIX PATH_TO_XML - ${LOG_TEXT} "DEBUG" "macro: ReadConfig | UNINSTALL_PREFIX: ${UNINSTALL_PREFIX} | PATH_TO_XML: ${PATH_TO_XML}" + ;${LOG_TEXT} "DEBUG" "macro: ReadConfig | UNINSTALL_PREFIX: ${UNINSTALL_PREFIX} | PATH_TO_XML: ${PATH_TO_XML}" IfFileExists "${PATH_TO_XML}\MediaPortalDirs.xml" 0 error @@ -740,7 +831,7 @@ StrCpy $MPdir.Config "$CommonAppData\Team MediaPortal\MediaPortal" StrCpy $MPdir.Plugins "$MPdir.Base\plugins" - StrCpy $MPdir.Log "$MPdir.Config\logs" + StrCpy $MPdir.Log "$MPdir.Config\log" StrCpy $MPdir.CustomInputDevice "$MPdir.Config\InputDeviceMappings" StrCpy $MPdir.CustomInputDefault "$MPdir.Base\InputDeviceMappings\defaults" StrCpy $MPdir.Skin "$MPdir.Base\skin" @@ -756,7 +847,7 @@ !define ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs ""` !define un.ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs "un."` !macro ReadMediaPortalDirs UNINSTALL_PREFIX INSTDIR - ${LOG_TEXT} "DEBUG" "macro ReadMediaPortalDirs" + ;${LOG_TEXT} "DEBUG" "macro ReadMediaPortalDirs" StrCpy $MPdir.Base "${INSTDIR}" SetShellVarContext current @@ -772,23 +863,23 @@ Call ${UNINSTALL_PREFIX}ReadConfig Pop $0 ${If} $0 != 0 ; an error occured - ${LOG_TEXT} "ERROR" "could not read '$MyDocs\Team MediaPortal\MediaPortalDirs.xml'" + ${LOG_TEXT} "ERROR" "Loading MediaPortalDirectories from MyDocs failed. ('$MyDocs\Team MediaPortal\MediaPortalDirs.xml')" + ${LOG_TEXT} "INFO" "Trying to load from installation directory now." Push "$MPdir.Base" Call ${UNINSTALL_PREFIX}ReadConfig Pop $0 ${If} $0 != 0 ; an error occured - ${LOG_TEXT} "ERROR" "could not read '$MPdir.Base\MediaPortalDirs.xml'" - - ${LOG_TEXT} "INFO" "no MediaPortalDirs.xml read. using LoadDefaultDirs" + ${LOG_TEXT} "ERROR" "Loading MediaPortalDirectories from InstallDir failed. ('$MPdir.Base\MediaPortalDirs.xml')" + ${LOG_TEXT} "INFO" "Using default paths for MediaPortalDirectories now." !insertmacro LoadDefaultDirs ${Else} - ${LOG_TEXT} "INFO" "read '$MPdir.Base\MediaPortalDirs.xml' successfully" + ${LOG_TEXT} "INFO" "Loaded MediaPortalDirectories from InstallDir successfully. ('$MPdir.Base\MediaPortalDirs.xml')" ${EndIf} ${Else} - ${LOG_TEXT} "INFO" "read '$MyDocs\Team MediaPortal\MediaPortalDirs.xml' successfully" + ${LOG_TEXT} "INFO" "Loaded MediaPortalDirectories from MyDocs successfully. ('$MyDocs\Team MediaPortal\MediaPortalDirs.xml')" ${EndIf} ${LOG_TEXT} "INFO" "Installer will use the following directories:" @@ -809,7 +900,6 @@ !endif # !USE_READ_MP_DIRS - #--------------------------------------------------------------------------- # COMPLETE MEDIAPORTAL CLEANUP #--------------------------------------------------------------------------- @@ -886,14 +976,48 @@ */ ${EndIf} !macroend +!macro NsisSilentUinstall REG_KEY +!if "${REG_KEY}" == "${TV3_REG_UNINSTALL}" + ${StopService} "TVservice" +!endif + 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" /S _?=$R1' + ;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 + ${LOG_TEXT} "INFO" ".: Operating System Check :." + GetVersion::WindowsName + Pop $R0 + ${LOG_TEXT} "INFO" "GetVersion::WindowsName: $R0" + !insertmacro GetServicePack $R1 $R2 + ${LOG_TEXT} "INFO" "GetServicePack major: $R1" + ${LOG_TEXT} "INFO" "GetServicePack minor: $R2" + + ; show error that the OS is not supported and abort the installation ${If} ${AtMostWin2000Srv} StrCpy $0 "OSabort" @@ -949,6 +1073,12 @@ ; do nothing ${EndIf} + ${LOG_TEXT} "INFO" "============================" +!macroend + +!macro MediaPortalAdminCheck HideWarnings + ${LOG_TEXT} "INFO" ".: Administration Rights Check :." + ; check if current user is admin UserInfo::GetOriginalAccountType Pop $0 @@ -958,6 +1088,12 @@ Abort ${EndIf} + ${LOG_TEXT} "INFO" "============================" +!macroend + +!macro MediaPortalVCRedistCheck HideWarnings + ${LOG_TEXT} "INFO" ".: Microsoft Visual C++ Redistributable Check :." + ; check if VC Redist 2005 SP1 is installed ${IfNot} ${VCRedistIsInstalled} MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_VCREDIST)" IDNO +2 @@ -965,7 +1101,57 @@ Abort ${EndIf} + ${LOG_TEXT} "INFO" "============================" !macroend +!macro MediaPortalNetFrameworkCheck HideWarnings + ${LOG_TEXT} "INFO" ".: Microsoft .Net Framework Check :." + + ; check if .Net Framework 2.0 is installed + ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "Install" + ; check if .Net Framework 2.0 SP2 is installed + ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "SP" + + ; check if .Net Framework 3.5 is installed + ReadRegDWORD $2 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "Install" + ; check if .Net Framework 3.5 SP1 is installed + ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP" + + ${LOG_TEXT} "INFO" ".Net 2.0 installed? $0" + ${LOG_TEXT} "INFO" ".Net 2.0 ServicePack: $1" + ${LOG_TEXT} "INFO" ".Net 3.5 installed? $2" + ${LOG_TEXT} "INFO" ".Net 3.5 ServicePack: $3" + + ${If} ${IsWinVISTA} + ${AndIf} ${RunningX64} ; 3.5 is installed, check for sp1 + ${LOG_TEXT} "INFO" "OS is Vista64, .Net 3.5 is installed." + + ${If} $3 < 1 ; if 3.5, but no sp1 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + + ${ElseIf} $0 != 1 ; if no 2.0 + + ${If} $2 != 1 ; if no 3.5 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET20)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${ElseIf} $3 < 1 ; if 3.5, but no sp1 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + + ${ElseIf} $1 < 2 ; if 2.0, but no sp2 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET20_SP)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + + ${LOG_TEXT} "INFO" "============================" +!macroend + !endif # !___COMMON_MP_MACROS__NSH___ Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-03-30 19:04:09 UTC (rev 2752) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-04-01 08:16:20 UTC (rev 2753) @@ -675,7 +675,7 @@ File "..\Applications\Abstractor\bin\${Build_Type}\*.*" ; create start menu shortcuts - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" "$DIR_INSTALL\Translator\Translator.exe" "" "$DIR_INSTALL\Translator\Translator.exe" 0 + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Abstractor.lnk" "$DIR_INSTALL\Abstractor\Abstractor.exe" "" "$DIR_INSTALL\Abstractor\Abstractor.exe" 0 ${MementoSectionEnd} !macro Remove_${SectionAbstractor} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-04-11 01:58:06
|
Revision: 2782 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2782&view=rev Author: chef_koch Date: 2009-04-11 01:47:41 +0000 (Sat, 11 Apr 2009) Log Message: ----------- reformatting, trying get a better structure added new page to choose between Server and Service Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/include/ trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh trunk/plugins/IR Server Suite/setup/languages/ trunk/plugins/IR Server Suite/setup/languages/English.nsh trunk/plugins/IR Server Suite/setup/pages/ trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh Removed Paths: ------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh trunk/plugins/IR Server Suite/setup/setup-languages.nsh Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh 2009-04-10 23:20:32 UTC (rev 2781) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -1,161 +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. -# -#**********************************************************************************************************# - -!include WordFunc.nsh -!include FileFunc.nsh - -!insertmacro VersionCompare -!insertmacro GetParent - -##### Add/Remove/Reinstall page -Var ReinstallPageCheck - -Function PageReinstall - ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "InstallPath" - ${If} $R0 == "" - Abort - ${EndIf} - - ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" - ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" - ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" - ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" - StrCpy $R0 $R0.$R1.$R2.$R3 - - ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0 - ${If} $R0 == 0 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" - StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" - StrCpy $R0 "2" - ${ElseIf} $R0 == 1 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" - ${ElseIf} $R0 == 2 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" - ${Else} - Abort - ${EndIf} - - nsDialogs::Create /NOUNLOAD 1018 - - ${NSD_CreateLabel} 0 0 100% 24u $R1 - Pop $R1 - - ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 - Pop $R2 - ${NSD_OnClick} $R2 PageReinstallUpdateSelection - - ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 - Pop $R3 - ${NSD_OnClick} $R3 PageReinstallUpdateSelection - - ${If} $ReinstallPageCheck != 2 - SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${Else} - SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0 - ${EndIf} - - nsDialogs::Show -FunctionEnd - -Function PageReinstallUpdateSelection - Pop $R1 - - ${NSD_GetState} $R2 $R1 - - ${If} $R1 == ${BST_CHECKED} - StrCpy $ReinstallPageCheck 1 - ${Else} - StrCpy $ReinstallPageCheck 2 - ${EndIf} - -FunctionEnd - -Function PageLeaveReinstall - ${NSD_GetState} $R2 $R1 - - StrCmp $R0 "1" 0 +2 - StrCmp $R1 "1" doUninstall finish - StrCmp $R0 "2" 0 +3 - StrCmp $R1 "1" finish doUninstall - - doUninstall: - ; check if MP is already installed - ReadRegStr $R0 HKLM "${REG_UNINSTALL}" UninstallString - ${If} ${FileExists} "$R0" - ; get parent folder of uninstallation EXE (RO) and save it to R1 - ${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' - 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} - - ; if reboot flag is set, abort the installation, and continue the installer on next startup - ${If} ${FileExists} "$INSTDIR\rebootflag" - MessageBox MB_OK|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "$(^Name)" $EXEPATH - Quit - ${EndIf} - - finish: -FunctionEnd - - - -LangString TEXT_ADDREMOVE_HEADER ${LANG_ENGLISH} "Already Installed" -LangString TEXT_ADDREMOVE_HEADER2_REPAIR ${LANG_ENGLISH} "Choose the maintenance option to perform." -LangString TEXT_ADDREMOVE_HEADER2_UPDOWN ${LANG_ENGLISH} "Choose how you want to install $(^Name)." -LangString TEXT_ADDREMOVE_INFO_REPAIR ${LANG_ENGLISH} "$(^Name) ${VERSION} is already installed. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_INFO_UPGRADE ${LANG_ENGLISH} "An older version of $(^Name) is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_INFO_DOWNGRADE ${LANG_ENGLISH} "A newer version of $(^Name) is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue." -LangString TEXT_ADDREMOVE_REPAIR_OPT1 ${LANG_ENGLISH} "Add/Remove/Reinstall components" -LangString TEXT_ADDREMOVE_REPAIR_OPT2 ${LANG_ENGLISH} "Uninstall $(^Name)" -LangString TEXT_ADDREMOVE_UPDOWN_OPT1 ${LANG_ENGLISH} "Uninstall before installing" -LangString TEXT_ADDREMOVE_UPDOWN_OPT2 ${LANG_ENGLISH} "Do not uninstall" \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh 2009-04-10 23:20:32 UTC (rev 2781) +++ trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -1,130 +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 - -#**********************************************************************************************************# -# -# File Association -# -# code was taken from: -# http://nsis.sourceforge.net/File_Association -# -#**********************************************************************************************************# - -# USAGE: - -;!include "registerExtension.nsh" -;... -# later, inside a section: -;${registerExtension} "c:\myplayer.exe" ".mkv" "MKV File" - -;${unregisterExtension} ".mkv" "MKV File" - -#**********************************************************************************************************# - -!ifndef ___FILE_ASSOCIATION__NSH___ -!define ___FILE_ASSOCIATION__NSH___ - - -!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 - pop $R2 - push $1 - push $0 - ReadRegStr $1 HKCR $R1 "" - StrCmp $1 "" "${Index}-NoBackup" - StrCmp $1 "OptionsFile" "${Index}-NoBackup" - WriteRegStr HKCR $R1 "backup_val" $1 -"${Index}-NoBackup:" - WriteRegStr HKCR $R1 "" $R0 - ReadRegStr $0 HKCR $R0 "" - StrCmp $0 "" 0 "${Index}-Skip" - WriteRegStr HKCR $R0 "" $R0 - WriteRegStr HKCR "$R0\shell" "" "open" - WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" -"${Index}-Skip:" - WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' - WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" - WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' - pop $0 - pop $1 -!undef Index -!macroend - -!macro ___UnRegisterExtension___ - pop $R1 ; description - pop $R0 ; extension -!define Index "Line${__LINE__}" - ReadRegStr $1 HKCR $R0 "" - StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it - ReadRegStr $1 HKCR $R0 "backup_val" - StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key - DeleteRegKey HKCR $R0 - Goto "${Index}-NoOwn" -"${Index}-Restore:" - WriteRegStr HKCR $R0 "" $1 - DeleteRegValue HKCR $R0 "backup_val" - DeleteRegKey HKCR $R1 ;Delete key with association name settings -"${Index}-NoOwn:" -!undef Index -!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___ - Copied: trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh (from rev 2778, trunk/plugins/IR Server Suite/setup/CommonNSIS/include-FileAssociation.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -0,0 +1,130 @@ +#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 + +#**********************************************************************************************************# +# +# File Association +# +# code was taken from: +# http://nsis.sourceforge.net/File_Association +# +#**********************************************************************************************************# + +# USAGE: + +;!include "registerExtension.nsh" +;... +# later, inside a section: +;${registerExtension} "c:\myplayer.exe" ".mkv" "MKV File" + +;${unregisterExtension} ".mkv" "MKV File" + +#**********************************************************************************************************# + +!ifndef ___FILE_ASSOCIATION__NSH___ +!define ___FILE_ASSOCIATION__NSH___ + + +!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 + pop $R2 + push $1 + push $0 + ReadRegStr $1 HKCR $R1 "" + StrCmp $1 "" "${Index}-NoBackup" + StrCmp $1 "OptionsFile" "${Index}-NoBackup" + WriteRegStr HKCR $R1 "backup_val" $1 +"${Index}-NoBackup:" + WriteRegStr HKCR $R1 "" $R0 + ReadRegStr $0 HKCR $R0 "" + StrCmp $0 "" 0 "${Index}-Skip" + WriteRegStr HKCR $R0 "" $R0 + WriteRegStr HKCR "$R0\shell" "" "open" + WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" +"${Index}-Skip:" + WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' + WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" + WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' + pop $0 + pop $1 +!undef Index +!macroend + +!macro ___UnRegisterExtension___ + pop $R1 ; description + pop $R0 ; extension +!define Index "Line${__LINE__}" + ReadRegStr $1 HKCR $R0 "" + StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it + ReadRegStr $1 HKCR $R0 "backup_val" + StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key + DeleteRegKey HKCR $R0 + Goto "${Index}-NoOwn" +"${Index}-Restore:" + WriteRegStr HKCR $R0 "" $1 + DeleteRegValue HKCR $R0 "backup_val" + DeleteRegKey HKCR $R1 ;Delete key with association name settings +"${Index}-NoOwn:" +!undef Index +!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___ + Added: trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -0,0 +1,13 @@ +# These macros are used to simplify the translation files +# so that translators have to deal with as little with the +# scripting language as possible. + +!macro LANG_LOAD LANGLOAD + !insertmacro MUI_LANGUAGE "${LANGLOAD}" + !include "languages\${LANGLOAD}.nsh" + !undef LANG +!macroend + +!macro LANG_STRING NAME VALUE + LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}" +!macroend \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/languages/English.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/languages/English.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -0,0 +1,55 @@ +!define LANG "ENGLISH" ; Must be the lang name define my NSIS + +!insertmacro LANG_STRING ^UninstallLink "Uninstall $(^Name)" + +!insertmacro LANG_STRING TEXT_MSGBOX_REMOVE_ALL "Do you want to remove your User settings?$\r$\nAttention: This will remove all your customised settings including Skins and Databases." + + + +# Descriptions for components (sections) +!insertmacro LANG_STRING DESC_SectionInputService "A windows service that provides access to your IR devices." + +!insertmacro LANG_STRING DESC_SectionGroupMP "MediaPortal plugins." +!insertmacro LANG_STRING DESC_SectionMPControlPlugin "Connects to the Input Service to control MediaPortal." +!insertmacro LANG_STRING DESC_SectionMPBlastZonePlugin "Lets you control your IR devices from within the MediaPortal GUI." +!insertmacro LANG_STRING DESC_SectionTV2BlasterPlugin "For tuning external channels (on Set Top Boxes) with the default MediaPortal TV engine." + +!insertmacro LANG_STRING DESC_SectionGroupTV3 "MediaPortal TV Server plugins." +!insertmacro LANG_STRING DESC_SectionTV3BlasterPlugin "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." +!insertmacro LANG_STRING DESC_SectionGroupMCE "Windows Media Center add-ons." + +!insertmacro LANG_STRING DESC_SectionDebugClient "Simple testing tool for troubleshooting input and communications problems." +!insertmacro LANG_STRING DESC_SectionIRFileTool "Tool for learning, modifying, testing, correcting and converting IR command files." +!insertmacro LANG_STRING DESC_SectionKeyboardInputRelay "Relays keyboard input to the Input Service to act on keypresses like remote buttons." +!insertmacro LANG_STRING DESC_SectionTranslator "Control your whole PC." +!insertmacro LANG_STRING DESC_SectionTrayLauncher "Simple program to launch an application of your choosing when a particular button is pressed." +!insertmacro LANG_STRING DESC_SectionVirtualRemote "Simulated remote control. Includes PC application, web, and Smart Devices versions." + +!insertmacro LANG_STRING DESC_SectionIRBlast "Command line tools for blasting IR codes." +!insertmacro LANG_STRING DESC_SectionDboxTuner "Command line tuner for Dreambox devices." +!insertmacro LANG_STRING DESC_SectionHcwPvrTuner "Command line tuner for Hauppauge PVR devices." +!insertmacro LANG_STRING DESC_SectionMCEBlaster "For tuning external channels (on Set Top Boxes) with Windows Media Center." + +# Strings for \xC2ddRemove-Page +!insertmacro LANG_STRING TEXT_ADDREMOVE_HEADER "Already Installed" +!insertmacro LANG_STRING TEXT_ADDREMOVE_HEADER2_REPAIR "Choose the maintenance option to perform." +!insertmacro LANG_STRING TEXT_ADDREMOVE_HEADER2_UPDOWN "Choose how you want to install $(^Name)." +!insertmacro LANG_STRING TEXT_ADDREMOVE_INFO_REPAIR "$(^Name) ${VERSION} is already installed. Select the operation you want to perform and click Next to continue." +!insertmacro LANG_STRING TEXT_ADDREMOVE_INFO_UPGRADE "An older version of $(^Name) is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue." +!insertmacro LANG_STRING TEXT_ADDREMOVE_INFO_DOWNGRADE "A newer version of $(^Name) is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue." +!insertmacro LANG_STRING TEXT_ADDREMOVE_REPAIR_OPT1 "Add/Remove/Reinstall components" +!insertmacro LANG_STRING TEXT_ADDREMOVE_REPAIR_OPT2 "Uninstall $(^Name)" +!insertmacro LANG_STRING TEXT_ADDREMOVE_UPDOWN_OPT1 "Uninstall before installing" +!insertmacro LANG_STRING TEXT_ADDREMOVE_UPDOWN_OPT2 "Do not uninstall" + +# Strings for ServerServiceMode-Page +!insertmacro LANG_STRING ServerServiceModePage_HEADER "TEXT_ServerServiceMode_HEADER" +!insertmacro LANG_STRING ServerServiceModePage_HEADER2 "TEXT_ServerServiceMode_HEADER2" +!insertmacro LANG_STRING ServerServiceModePage_INFO "TEXT_ServerServiceMode_INFO" + +!insertmacro LANG_STRING ServerServiceModePage_OPT0 "TEXT_ServerServiceMode_OPT0" +!insertmacro LANG_STRING ServerServiceModePage_OPT0_DESC "TEXT_ServerServiceMode_OPT0_DESC" + +!insertmacro LANG_STRING ServerServiceModePage_OPT1 "TEXT_ServerServiceMode_OPT1" +!insertmacro LANG_STRING ServerServiceModePage_OPT1_DESC "TEXT_ServerServiceMode_OPT1_DESC" + Copied: trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh (from rev 2778, trunk/plugins/IR Server Suite/setup/CommonNSIS/include-AddRemovePage.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -0,0 +1,157 @@ +#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. +# +#**********************************************************************************************************# + +!ifndef ___ADD_REMOVE_PAGE__NSH___ +!define ___ADD_REMOVE_PAGE__NSH___ + +!macro AddRemovePage RegKey + +!include WordFunc.nsh +!include FileFunc.nsh + +!insertmacro VersionCompare +!insertmacro GetParent + +##### Add/Remove/Reinstall page +Var ReinstallPageCheck + +Function PageReinstall + ReadRegStr $R0 HKLM "${RegKey}" "InstallPath" + ${If} $R0 == "" + Abort + ${EndIf} + + ReadRegDWORD $R0 HKLM "${RegKey}" "VersionMajor" + ReadRegDWORD $R1 HKLM "${RegKey}" "VersionMinor" + ReadRegDWORD $R2 HKLM "${RegKey}" "VersionRevision" + ReadRegDWORD $R3 HKLM "${RegKey}" "VersionBuild" + StrCpy $R0 $R0.$R1.$R2.$R3 + + ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0 + ${If} $R0 == 0 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" + StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" + StrCpy $R0 "2" + ${ElseIf} $R0 == 1 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + StrCpy $R0 "1" + ${ElseIf} $R0 == 2 + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + StrCpy $R0 "1" + ${Else} + Abort + ${EndIf} + + nsDialogs::Create /NOUNLOAD 1018 + + ${NSD_CreateLabel} 0 0 100% 24u $R1 + Pop $R1 + + ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 + Pop $R2 + ${NSD_OnClick} $R2 PageReinstallUpdateSelection + + ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 + Pop $R3 + ${NSD_OnClick} $R3 PageReinstallUpdateSelection + + ${If} $ReinstallPageCheck != 2 + SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${Else} + SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${EndIf} + + nsDialogs::Show +FunctionEnd + +Function PageReinstallUpdateSelection + Pop $R1 + + ${NSD_GetState} $R2 $R1 + + ${If} $R1 == ${BST_CHECKED} + StrCpy $ReinstallPageCheck 1 + ${Else} + StrCpy $ReinstallPageCheck 2 + ${EndIf} + +FunctionEnd + +Function PageLeaveReinstall + ${NSD_GetState} $R2 $R1 + + StrCmp $R0 "1" 0 +2 + StrCmp $R1 "1" doUninstall finish + StrCmp $R0 "2" 0 +3 + StrCmp $R1 "1" finish doUninstall + + doUninstall: + ; check if MP is already installed + ReadRegStr $R0 HKLM "${RegKey}" UninstallString + ${If} ${FileExists} "$R0" + ; get parent folder of uninstallation EXE (RO) and save it to R1 + ${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' + 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} + + ; if reboot flag is set, abort the installation, and continue the installer on next startup + ${If} ${FileExists} "$INSTDIR\rebootflag" + MessageBox MB_OK|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "$(^Name)" $EXEPATH + Quit + ${EndIf} + + finish: +FunctionEnd + +!macroend + +!endif # !___ADD_REMOVE_PAGE__NSH___ Added: trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -0,0 +1,83 @@ +#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 + +!ifndef ___SERVER_SERVICE_MODE_PAGE__NSH___ +!define ___SERVER_SERVICE_MODE_PAGE__NSH___ + +!include WordFunc.nsh +!include FileFunc.nsh + +!insertmacro VersionCompare +!insertmacro GetParent + +##### Add/Remove/Reinstall page +Var ServerServiceMode +Var ServerServiceModePage.optBtn0 +Var ServerServiceModePage.optBtn0.state +Var ServerServiceModePage.optBtn1 +Var ServerServiceModePage.optBtn1.state + +Function PageServerServiceMode + !insertmacro MUI_HEADER_TEXT "$(ServerServiceModePage_HEADER)" "$(ServerServiceModePage_HEADER2)" + + nsDialogs::Create /NOUNLOAD 1018 + + ${NSD_CreateLabel} 0 0 100% 24u "$(ServerServiceModePage_INFO)" + Pop $R1 + + + ${NSD_CreateRadioButton} 20u 30u -30u 8u "$(ServerServiceModePage_OPT0)" + Pop $ServerServiceModePage.optBtn0 + ${NSD_OnClick} $ServerServiceModePage.optBtn0 PageServerServiceModeUpdateSelection + + ${NSD_CreateLabel} 30u 45u 100% 24u "$(ServerServiceModePage_OPT0_DESC)" + + + ${NSD_CreateRadioButton} 20u 70u -30u 8u "$(ServerServiceModePage_OPT1)" + Pop $ServerServiceModePage.optBtn1 + ${NSD_OnClick} $ServerServiceModePage.optBtn1 PageServerServiceModeUpdateSelection + + ${NSD_CreateLabel} 30u 85u 100% 24u "$(ServerServiceModePage_OPT1_DESC)" + + + SendMessage $ServerServiceModePage.optBtn0 ${BM_SETCHECK} ${BST_CHECKED} 0 + + nsDialogs::Show +FunctionEnd + +Function PageServerServiceModeUpdateSelection + + ${NSD_GetState} $ServerServiceModePage.optBtn0 $ServerServiceModePage.optBtn0.state + ${NSD_GetState} $ServerServiceModePage.optBtn1 $ServerServiceModePage.optBtn1.state + + ${If} $ServerServiceModePage.optBtn1.state == ${BST_CHECKED} + StrCpy $ServerServiceMode 1 + ${Else} + StrCpy $ServerServiceMode 0 + ${EndIf} + +FunctionEnd + +!endif # !___SERVER_SERVICE_MODE_PAGE__NSH___ Deleted: trunk/plugins/IR Server Suite/setup/setup-languages.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/setup-languages.nsh 2009-04-10 23:20:32 UTC (rev 2781) +++ trunk/plugins/IR Server Suite/setup/setup-languages.nsh 2009-04-11 01:47:41 UTC (rev 2782) @@ -1,55 +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 header contains multilanguage strings for the setup routine -# -#**********************************************************************************************************# - -# ENGLISH -LangString DESC_SectionInputService ${LANG_ENGLISH} "A windows service that provides access to your IR devices." -LangString DESC_SectionGroupMP ${LANG_ENGLISH} "MediaPortal plugins." -LangString DESC_SectionMPControlPlugin ${LANG_ENGLISH} "Connects to the Input Service to control MediaPortal." -LangString DESC_SectionMPBlastZonePlugin ${LANG_ENGLISH} "Lets you control your IR devices from within the MediaPortal GUI." -LangString DESC_SectionTV2BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the default MediaPortal TV engine." -LangString DESC_SectionGroupTV3 ${LANG_ENGLISH} "MediaPortal TV Server plugins." -LangString DESC_SectionTV3BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." -LangString DESC_SectionGroupMCE ${LANG_ENGLISH} "Windows Media Center add-ons." -LangString DESC_SectionMCEBlaster ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with Windows Media Center." -LangString DESC_SectionTranslator ${LANG_ENGLISH} "Control your whole PC." -LangString DESC_SectionTrayLauncher ${LANG_ENGLISH} "Simple program to launch an application of your choosing when a particular button is pressed." -LangString DESC_SectionVirtualRemote ${LANG_ENGLISH} "Simulated remote control. Includes PC application, web, and Smart Devices versions." -LangString DESC_SectionIRBlast ${LANG_ENGLISH} "Command line tools for blasting IR codes." -LangString DESC_SectionIRFileTool ${LANG_ENGLISH} "Tool for learning, modifying, testing, correcting and converting IR command files." -LangString DESC_SectionKeyboardInputRelay ${LANG_ENGLISH} "Relays keyboard input to the Input Service to act on keypresses like remote buttons." -LangString DESC_SectionDboxTuner ${LANG_ENGLISH} "Command line tuner for Dreambox devices." -LangString DESC_SectionHcwPvrTuner ${LANG_ENGLISH} "Command line tuner for Hauppauge PVR devices." -LangString DESC_SectionDebugClient ${LANG_ENGLISH} "Simple testing tool for troubleshooting input and communications problems." - - -LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" - -LangString TEXT_MSGBOX_REMOVE_ALL ${LANG_ENGLISH} "Do you want to remove your User settings?$\r$\nAttention: This will remove all your customised settings including Skins and Databases." Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-04-10 23:20:32 UTC (rev 2781) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-04-11 01:47:41 UTC (rev 2782) @@ -76,14 +76,17 @@ !include Memento.nsh !include WinVer.nsh +!include include\LanguageMacros.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 +!include pages\AddRemovePage.nsh +!insertmacro AddRemovePage "${REG_UNINSTALL}" +!include pages\ServerServiceMode.nsh + ; FileFunc macros !insertmacro GetParent @@ -132,6 +135,7 @@ # INSTALLER INTERFACE #--------------------------------------------------------------------------- !insertmacro MUI_PAGE_WELCOME +;Page custom PageServerServiceMode Page custom PageReinstall PageLeaveReinstall !insertmacro MUI_PAGE_LICENSE "..\Documentation\LICENSE.GPL" !insertmacro MUI_PAGE_COMPONENTS @@ -173,7 +177,8 @@ !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH -!insertmacro MUI_LANGUAGE "English" +# Installer languages +!insertmacro LANG_LOAD "English" ;====================================== ;====================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-04-15 20:17:23
|
Revision: 2801 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2801&view=rev Author: chef_koch Date: 2009-04-15 20:17:16 +0000 (Wed, 15 Apr 2009) Log Message: ----------- splitted common mp macros into separate files updated all import files from mp svn ServerServiceMode-Page is fully working now Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh trunk/plugins/IR Server Suite/setup/languages/English.nsh trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/GetVersion-plugin/ trunk/plugins/IR Server Suite/setup/XML-plugin/ trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh Removed Paths: ------------- trunk/plugins/IR Server Suite/setup/CommonNSIS/ Modified: trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh 2009-04-15 14:42:01 UTC (rev 2800) +++ trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -1,7 +1,7 @@ -#region Copyright (C) 2005-2008 Team MediaPortal +#region Copyright (C) 2005-2009 Team MediaPortal /* - * Copyright (C) 2005-2008 Team MediaPortal + * Copyright (C) 2005-2009 Team MediaPortal * http://www.team-mediaportal.com * * This Program is free software; you can redistribute it and/or modify @@ -23,65 +23,176 @@ #endregion -#**********************************************************************************************************# -# -# File Association -# -# code was taken from: -# http://nsis.sourceforge.net/File_Association -# -#**********************************************************************************************************# +/* +_____________________________________________________________________________ -# USAGE: + File Association +_____________________________________________________________________________ -;!include "registerExtension.nsh" -;... -# later, inside a section: -;${registerExtension} "c:\myplayer.exe" ".mkv" "MKV File" + Based on code taken from http://nsis.sourceforge.net/File_Association -;${unregisterExtension} ".mkv" "MKV File" + Usage in script: + 1. !include "FileFunc.nsh" + 2. [Section|Function] + ${FileAssociationFunction} "Param1" "Param2" "..." $var + [SectionEnd|FunctionEnd] -#**********************************************************************************************************# + FileAssociationFunction=[RegisterExtension|UnRegisterExtension] -!ifndef ___FILE_ASSOCIATION__NSH___ -!define ___FILE_ASSOCIATION__NSH___ +_____________________________________________________________________________ + ${RegisterExtension} "[executable]" "[extension]" "[description]" -!define RegisterExtension `!insertmacro RegisterExtension ""` -!define un.RegisterExtension `!insertmacro RegisterExtension "un."` -!define UnRegisterExtension `!insertmacro UnRegisterExtension ""` -!define un.UnRegisterExtension `!insertmacro UnRegisterExtension "un."` +"[executable]" ; executable which opens the file format + ; +"[extension]" ; extension, which represents the file format to open + ; +"[description]" ; description for the extension. This will be display in Windows Explorer. + ; -!macro ___RegisterExtension___ + + ${UnRegisterExtension} "[extension]" "[description]" + +"[extension]" ; extension, which represents the file format to open + ; +"[description]" ; description for the extension. This will be display in Windows Explorer. + ; + +_____________________________________________________________________________ + + Macros +_____________________________________________________________________________ + + Change log window verbosity (default: 3=no script) + + Example: + !include "FileAssociation.nsh" + !insertmacro RegisterExtension + ${FileAssociation_VERBOSE} 4 # all verbosity + !insertmacro UnRegisterExtension + ${FileAssociation_VERBOSE} 3 # no script +*/ + + +!ifndef FileAssociation_INCLUDED +!define FileAssociation_INCLUDED + +!include Util.nsh + +!verbose push +!verbose 3 +!ifndef _FileAssociation_VERBOSE + !define _FileAssociation_VERBOSE 3 +!endif +!verbose ${_FileAssociation_VERBOSE} +!define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE` +!verbose pop + +!macro FileAssociation_VERBOSE _VERBOSE + !verbose push + !verbose 3 + !undef _FileAssociation_VERBOSE + !define _FileAssociation_VERBOSE ${_VERBOSE} + !verbose pop +!macroend + + + +!macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION + !verbose push + !verbose ${_FileAssociation_VERBOSE} + Push `${_EXECUTABLE}` + Push `${_EXTENSION}` + Push `${_DESCRIPTION}` + ${CallArtificialFunction} RegisterExtension_ + !verbose pop +!macroend + +!macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION + !verbose push + !verbose ${_FileAssociation_VERBOSE} + Push `${_EXTENSION}` + Push `${_DESCRIPTION}` + ${CallArtificialFunction} UnRegisterExtension_ + !verbose pop +!macroend + + + +!define RegisterExtension `!insertmacro RegisterExtensionCall` +!define un.RegisterExtension `!insertmacro RegisterExtensionCall` + +!macro RegisterExtension +!macroend + +!macro un.RegisterExtension +!macroend + +!macro RegisterExtension_ + !verbose push + !verbose ${_FileAssociation_VERBOSE} + + Exch $R2 ;desc + Exch + Exch $R1 ;ext + Exch + Exch 2 + Exch $R0 ;exe + Exch 2 + Push $0 + Push $1 + !define Index "Line${__LINE__}" - pop $R0 ; ext name - pop $R1 - pop $R2 - push $1 - push $0 ReadRegStr $1 HKCR $R1 "" StrCmp $1 "" "${Index}-NoBackup" StrCmp $1 "OptionsFile" "${Index}-NoBackup" WriteRegStr HKCR $R1 "backup_val" $1 + "${Index}-NoBackup:" WriteRegStr HKCR $R1 "" $R0 ReadRegStr $0 HKCR $R0 "" StrCmp $0 "" 0 "${Index}-Skip" - WriteRegStr HKCR $R0 "" $R0 - WriteRegStr HKCR "$R0\shell" "" "open" - WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" + WriteRegStr HKCR $R0 "" $R0 + WriteRegStr HKCR "$R0\shell" "" "open" + WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" + "${Index}-Skip:" WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' - pop $0 - pop $1 !undef Index + + Pop $1 + Pop $0 + Pop $R2 + Pop $R1 + Pop $R0 + + !verbose pop !macroend -!macro ___UnRegisterExtension___ - pop $R1 ; description - pop $R0 ; extension + + +!define UnRegisterExtension `!insertmacro UnRegisterExtensionCall` +!define un.UnRegisterExtension `!insertmacro UnRegisterExtensionCall` + +!macro UnRegisterExtension +!macroend + +!macro un.UnRegisterExtension +!macroend + +!macro UnRegisterExtension_ + !verbose push + !verbose ${_FileAssociation_VERBOSE} + + Exch $R1 ;desc + Exch + Exch $R0 ;ext + Exch + Push $0 + Push $1 + !define Index "Line${__LINE__}" ReadRegStr $1 HKCR $R0 "" StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it @@ -89,42 +200,21 @@ StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key DeleteRegKey HKCR $R0 Goto "${Index}-NoOwn" + "${Index}-Restore:" WriteRegStr HKCR $R0 "" $1 DeleteRegValue HKCR $R0 "backup_val" DeleteRegKey HKCR $R1 ;Delete key with association name settings + "${Index}-NoOwn:" !undef Index -!macroend - - -Function RegisterExtension - !insertmacro ___RegisterExtension___ -FunctionEnd -Function un.RegisterExtension - !insertmacro ___RegisterExtension___ -FunctionEnd -Function UnRegisterExtension - !insertmacro ___UnRegisterExtension___ -FunctionEnd -Function un.UnRegisterExtension - !insertmacro ___UnRegisterExtension___ -FunctionEnd + Pop $1 + Pop $0 + Pop $R1 + Pop $R0 - -!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 + !verbose pop !macroend - -!macro UnRegisterExtension UNINSTALL_PREFIX extension description - Push "${extension}" ; ".mkv" - Push "${description}" ; "MKV File" - Call ${UNINSTALL_PREFIX}UnRegisterExtension -!macroend -!endif # !___FILE_ASSOCIATION__NSH___ - +!endif # !FileAssociation_INCLUDED Added: trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -0,0 +1,40 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + + +!ifndef IrssSystemRegistry_INCLUDED +!define IrssSystemRegistry_INCLUDED + +!define AutoRunPath 'HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"' + +!macro SetAutoRun name executablePath + WriteRegStr ${AutoRunPath} '${name}' '${executablePath}' +!macroend + +!macro RemoveAutoRun name + WriteRegStr ${AutoRunPath} '${name}' '' +!macroend + +!endif # !IrssSystemRegistry_INCLUDED Modified: trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh 2009-04-15 14:42:01 UTC (rev 2800) +++ trunk/plugins/IR Server Suite/setup/include/LanguageMacros.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -1,13 +1,54 @@ -# These macros are used to simplify the translation files -# so that translators have to deal with as little with the -# scripting language as possible. +#region Copyright (C) 2005-2009 Team MediaPortal +/* + * Copyright (C) 2005-2009 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 + +/* +_____________________________________________________________________________ + + LanguageMacros +_____________________________________________________________________________ + + These macros are used to simplify the translation files + so that translators have to deal with as little with the + scripting language as possible. +*/ + + +!ifndef ___LanguageMacros__NSH___ +!define ___LanguageMacros__NSH___ + + !macro LANG_LOAD LANGLOAD +!ifdef MUI_INCLUDED !insertmacro MUI_LANGUAGE "${LANGLOAD}" - !include "languages\${LANGLOAD}.nsh" +!endif + !include "${svn_InstallScripts}\languages\${LANGLOAD}.nsh" !undef LANG !macroend !macro LANG_STRING NAME VALUE LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}" -!macroend \ No newline at end of file +!macroend + +!endif # !___LanguageMacros__NSH___ Copied: trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh (from rev 2800, trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -0,0 +1,135 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + +/* +_____________________________________________________________________________ + + NSIS logging system +_____________________________________________________________________________ + + These macros for writing a log file during the installation process, + which can be used for debugging the installation process. + + Disable Logging to file by defining NO_INSTALL_LOG in host script. + !define NO_INSTALL_LOG +*/ + + +!ifndef LoggingMacros_INCLUDED +!define LoggingMacros_INCLUDED + + +!define prefixERROR "[ERROR !!!] " +!define prefixDEBUG "[ DEBUG ] " +!define prefixINFO "[ INFO] " + +!ifndef NO_INSTALL_LOG + +!include FileFunc.nsh + +Var LogFile +Var TempInstallLog + + +!define LOG_OPEN `!insertmacro LOG_OPEN ""` +!define un.LOG_OPEN `!insertmacro LOG_OPEN "un."` +!macro LOG_OPEN UNINSTALL_PREFIX + GetTempFileName $TempInstallLog + FileOpen $LogFile "$TempInstallLog" w + + ${${UNINSTALL_PREFIX}GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + ${LOG_TEXT} "INFO" "$(^Name) ${UNINSTALL_PREFIX}installation" + ${LOG_TEXT} "INFO" "Logging started: $0.$1.$2 $4:$5:$6" + ${LOG_TEXT} "INFO" "${UNINSTALL_PREFIX}installer version: ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}" + ${LOG_TEXT} "INFO" "============================================================================================" +!macroend + + +!define LOG_CLOSE `!insertmacro LOG_CLOSE ""` +!define un.LOG_CLOSE `!insertmacro LOG_CLOSE "un."` +!macro LOG_CLOSE UNINSTALL_PREFIX + SetShellVarContext all + + ${${UNINSTALL_PREFIX}GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + ${LOG_TEXT} "INFO" "============================================================================================" + ${LOG_TEXT} "INFO" "Logging stopped: $0.$1.$2 $4:$5:$6" + ${LOG_TEXT} "INFO" "${UNINSTALL_PREFIX}installer version: ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}" + ${LOG_TEXT} "INFO" "$(^Name) ${UNINSTALL_PREFIX}installation" + + FileClose $LogFile + +!ifdef INSTALL_LOG_FILE + CopyFiles "$TempInstallLog" "${INSTALL_LOG_FILE}" +!else + !ifndef COMMON_APPDATA + !error "$\r$\n$\r$\nCOMMON_APPDATA is not defined!$\r$\n$\r$\n" + !endif + + ${${UNINSTALL_PREFIX}GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + CopyFiles "$TempInstallLog" "${COMMON_APPDATA}\logs\${UNINSTALL_PREFIX}install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}_$2-$1-$0_$4-$5-$6.log" + + Delete "$TempInstallLog" + +!endif +!macroend + + +!define LOG_TEXT `!insertmacro LOG_TEXT` +!macro LOG_TEXT LEVEL TEXT + +!if "${LEVEL}" != "DEBUG" + !if "${LEVEL}" != "ERROR" + !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}" + !endif + !else + DetailPrint "${prefix${LEVEL}}${TEXT}" + !endif +!endif + + FileWrite $LogFile "${prefix${LEVEL}}${TEXT}$\r$\n" + +!macroend + +!else #NO_INSTALL_LOG + +!define LOG_OPEN `!insertmacro LOG_OPEN` +!macro LOG_OPEN +!macroend + +!define LOG_CLOSE `!insertmacro LOG_CLOSE` +!macro LOG_CLOSE +!macroend + +!define LOG_TEXT `!insertmacro LOG_TEXT` +!macro LOG_TEXT LEVEL TEXT + DetailPrint "${prefix${LEVEL}}${TEXT}" +!macroend + +!endif #NO_INSTALL_LOG + +!endif # !LoggingMacros_INCLUDED Copied: trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh (from rev 2800, trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -0,0 +1,292 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + + +!ifndef ___MediaPortalDirectories__NSH___ +!define ___MediaPortalDirectories__NSH___ + +!include LogicLib.nsh +!include "${svn_InstallScripts}\include\LoggingMacros.nsh" + + +!AddPluginDir "${svn_InstallScripts}\XML-plugin\Plugin" +!include "${svn_InstallScripts}\XML-plugin\Include\XML.nsh" + +#--------------------------------------------------------------------------- +# Read Special MediaPortal directories from xml +# +# enable it by defining USE_READ_MP_DIRS in parent script +#--------------------------------------------------------------------------- + +Var MyDocs +Var UserAppData +Var CommonAppData + +Var MPdir.Base + +Var MPdir.Config +Var MPdir.Plugins +Var MPdir.Log +Var MPdir.CustomInputDevice +Var MPdir.CustomInputDefault +Var MPdir.Skin +Var MPdir.Language +Var MPdir.Database +Var MPdir.Thumbs +Var MPdir.Weather +Var MPdir.Cache +Var MPdir.BurnerSupport + +#*************************** +#*************************** + +!macro GET_PATH_TEXT + + Pop $R0 + + ${xml::GotoPath} "/Config" $0 + ${If} $0 != 0 + ${LOG_TEXT} "ERROR" "xml::GotoPath /Config" + Goto error + ${EndIf} + + loop: + + ${xml::FindNextElement} "Dir" $0 $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::FindNextElement >/Dir< >$0<" + Goto error + ${EndIf} + + ${xml::ElementPath} $0 + ${xml::GetAttribute} "id" $0 $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::GetAttribute >id< >$0<" + Goto error + ${EndIf} + ${IfThen} $0 == $R0 ${|} Goto foundDir ${|} + + Goto loop + + + foundDir: + ${xml::ElementPath} $0 + ${xml::GotoPath} "$0/Path" $1 + ${If} $1 != 0 + ${LOG_TEXT} "ERROR" "xml::GotoPath >$0/Path<" + Goto error + ${EndIf} + + ${xml::GetText} $0 $1 + ${If} $1 != 0 + ; maybe the path is only empty, which means MPdir.Base + #MessageBox MB_OK "error: xml::GetText" + #Goto error + StrCpy $0 "" + ${EndIf} + + Push $0 + Goto end + + error: + Push "-1" + + end: + +!macroend +Function GET_PATH_TEXT + !insertmacro GET_PATH_TEXT +FunctionEnd +Function un.GET_PATH_TEXT + !insertmacro GET_PATH_TEXT +FunctionEnd + +#*************************** +#*************************** + +!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}" + + Push "${DIR}" + Call ${UNINSTALL_PREFIX}GET_PATH_TEXT + Pop $0 + ${IfThen} $0 == -1 ${|} Goto error ${|} + + ;${LOG_TEXT} "DEBUG" "macro: ReadMPdir | text found in xml: '$0'" + ${${UNINSTALL_PREFIX}WordReplace} "$0" "%APPDATA%" "$UserAppData" "+" $0 + ${${UNINSTALL_PREFIX}WordReplace} "$0" "%PROGRAMDATA%" "$CommonAppData" "+" $0 + + ${${UNINSTALL_PREFIX}GetRoot} "$0" $1 + + ${IfThen} $1 == "" ${|} StrCpy $0 "$MPdir.Base\$0" ${|} + + ; TRIM \ AT THE END + StrLen $1 "$0" + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + IntOp $2 $1 - 1 + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + StrCpy $3 $0 1 $2 + #${DEBUG_MSG} "1 $1$\r$\n2 $2$\r$\n3 $3" + + ${If} $3 == "\" + StrCpy $MPdir.${DIR} $0 $2 + ${Else} + StrCpy $MPdir.${DIR} $0 + ${EndIf} + +!macroend + +#*************************** +#*************************** + +!macro ReadConfig UNINSTALL_PREFIX PATH_TO_XML + ;${LOG_TEXT} "DEBUG" "macro: ReadConfig | UNINSTALL_PREFIX: ${UNINSTALL_PREFIX} | PATH_TO_XML: ${PATH_TO_XML}" + + IfFileExists "${PATH_TO_XML}\MediaPortalDirs.xml" 0 error + + + #${xml::LoadFile} "$EXEDIR\MediaPortalDirsXP.xml" $0 + ${xml::LoadFile} "$0\MediaPortalDirs.xml" $0 + ${IfThen} $0 != 0 ${|} Goto error ${|} + + #</Dir> Log CustomInputDevice CustomInputDefault Skin Language Database Thumbs Weather Cache BurnerSupport + + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Config + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Plugins + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Log + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" CustomInputDevice + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" CustomInputDefault + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Skin + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Language + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Database + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Thumbs + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Weather + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" Cache + !insertmacro ReadMPdir "${UNINSTALL_PREFIX}" BurnerSupport + + + Push "0" + Goto end + + error: + Push "-1" + + end: + +!macroend +Function ReadConfig + Pop $0 + + !insertmacro ReadConfig "" "$0" +FunctionEnd +Function un.ReadConfig + Pop $0 + + !insertmacro ReadConfig "un." "$0" +FunctionEnd + +#*************************** +#*************************** + +!macro LoadDefaultDirs + + StrCpy $MPdir.Config "$CommonAppData\Team MediaPortal\MediaPortal" + + StrCpy $MPdir.Plugins "$MPdir.Base\plugins" + StrCpy $MPdir.Log "$MPdir.Config\log" + StrCpy $MPdir.CustomInputDevice "$MPdir.Config\InputDeviceMappings" + StrCpy $MPdir.CustomInputDefault "$MPdir.Base\InputDeviceMappings\defaults" + StrCpy $MPdir.Skin "$MPdir.Base\skin" + StrCpy $MPdir.Language "$MPdir.Base\language" + StrCpy $MPdir.Database "$MPdir.Config\database" + StrCpy $MPdir.Thumbs "$MPdir.Config\thumbs" + StrCpy $MPdir.Weather "$MPdir.Base\weather" + StrCpy $MPdir.Cache "$MPdir.Config\cache" + StrCpy $MPdir.BurnerSupport "$MPdir.Base\Burner" + +!macroend + +!define ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs ""` +!define un.ReadMediaPortalDirs `!insertmacro ReadMediaPortalDirs "un."` +!macro ReadMediaPortalDirs UNINSTALL_PREFIX INSTDIR + ;${LOG_TEXT} "DEBUG" "macro ReadMediaPortalDirs" + + StrCpy $MPdir.Base "${INSTDIR}" + SetShellVarContext current + StrCpy $MyDocs "$DOCUMENTS" + StrCpy $UserAppData "$APPDATA" + SetShellVarContext all + StrCpy $CommonAppData "$APPDATA" + + + !insertmacro LoadDefaultDirs + + Push "$MyDocs\Team MediaPortal" + Call ${UNINSTALL_PREFIX}ReadConfig + Pop $0 + ${If} $0 != 0 ; an error occured + ${LOG_TEXT} "ERROR" "Loading MediaPortalDirectories from MyDocs failed. ('$MyDocs\Team MediaPortal\MediaPortalDirs.xml')" + ${LOG_TEXT} "INFO" "Trying to load from installation directory now." + + Push "$MPdir.Base" + Call ${UNINSTALL_PREFIX}ReadConfig + Pop $0 + ${If} $0 != 0 ; an error occured + ${LOG_TEXT} "ERROR" "Loading MediaPortalDirectories from InstallDir failed. ('$MPdir.Base\MediaPortalDirs.xml')" + ${LOG_TEXT} "INFO" "Using default paths for MediaPortalDirectories now." + !insertmacro LoadDefaultDirs + + ${Else} + ${LOG_TEXT} "INFO" "Loaded MediaPortalDirectories from InstallDir successfully. ('$MPdir.Base\MediaPortalDirs.xml')" + ${EndIf} + + ${Else} + ${LOG_TEXT} "INFO" "Loaded MediaPortalDirectories from MyDocs successfully. ('$MyDocs\Team MediaPortal\MediaPortalDirs.xml')" + ${EndIf} + + ${LOG_TEXT} "INFO" "Installer will use the following directories:" + ${LOG_TEXT} "INFO" " Base: $MPdir.Base" + ${LOG_TEXT} "INFO" " Config: $MPdir.Config" + ${LOG_TEXT} "INFO" " Plugins: $MPdir.Plugins" + ${LOG_TEXT} "INFO" " Log: $MPdir.Log" + ${LOG_TEXT} "INFO" " CustomInputDevice: $MPdir.CustomInputDevice" + ${LOG_TEXT} "INFO" " CustomInputDefault: $MPdir.CustomInputDefault" + ${LOG_TEXT} "INFO" " Skin: $MPdir.Skin" + ${LOG_TEXT} "INFO" " Language: $MPdir.Language" + ${LOG_TEXT} "INFO" " Database: $MPdir.Database" + ${LOG_TEXT} "INFO" " Thumbs: $MPdir.Thumbs" + ${LOG_TEXT} "INFO" " Weather: $MPdir.Weather" + ${LOG_TEXT} "INFO" " Cache: $MPdir.Cache" + ${LOG_TEXT} "INFO" " BurnerSupport: $MPdir.BurnerSupport" +!macroend + +!endif # !___MediaPortalDirectories__NSH___ + Copied: trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh (from rev 2800, trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -0,0 +1,702 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + + +!ifndef ___COMMON_MP_MACROS__NSH___ +!define ___COMMON_MP_MACROS__NSH___ + + +!include LogicLib.nsh +!include x64.nsh +!include "${svn_InstallScripts}\include\LanguageMacros.nsh" +!include "${svn_InstallScripts}\include\LoggingMacros.nsh" + + +!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" +!endif + + +!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 + + + + +# references to additional plugins, if not used, these won't be included +!AddPluginDir "${svn_InstallScripts}\GetVersion-plugin\Plugins" + + + +#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 + +!macro DisableComponent SectionName AddText + !insertmacro UnselectSection "${SectionName}" + ; Make the unselected section read only + !insertmacro SetSectionFlag "${SectionName}" 16 + SectionGetText ${SectionName} $R0 + SectionSetText ${SectionName} "$R0${AddText}" +!macroend + + + +#**********************************************************************************************************# +# +# Useful macros for MediaPortal and addtional Software which can be used like other LogicLib expressions. +# +#**********************************************************************************************************# + + +#**********************************************************************************************************# +# LOGICLIB EXPRESSIONS + +;====================================== OLD MP INSTALLATION TESTs + +# old installations < 0.2.3.0 RC 3 +!macro _MP022IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87819CFA-1786-484D-B0DE-10B5FBF2625D}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MP022IsInstalled `"" MP022IsInstalled ""` + +!macro _MP023RC3IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0 RC3" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MP023RC3IsInstalled `"" MP023RC3IsInstalled ""` + +!macro _MP023IsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MP023IsInstalled `"" MP023IsInstalled ""` + +;====================================== OLD TVServer/TVClient INSTALLATION TESTs + +!macro _MSI_TVServerIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B738773-EE07-413D-AFB7-BB0AB04A5488}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MSI_TVServerIsInstalled `"" MSI_TVServerIsInstalled ""` + +!macro _MSI_TVClientIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ClearErrors + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F7444E89-5BC0-497E-9650-E50539860DE0}" "UninstallString" + IfErrors 0 `${_t}` + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FD9FD453-1C0C-4EDA-AEE6-D7CF0E9951CA}" "UninstallString" + IfErrors `${_f}` `${_t}` +!macroend +!define MSI_TVClientIsInstalled `"" MSI_TVClientIsInstalled ""` + +;====================================== + +!macro _MPIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${MP_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define MPIsInstalled `"" MPIsInstalled ""` + +!macro _TVServerIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP 0 `${_f}` + + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecServer" + StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` +!macroend +!define TVServerIsInstalled `"" TVServerIsInstalled ""` + +!macro _TVClientIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" + + IfFileExists $_LOGICLIB_TEMP 0 `${_f}` + + ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecClient" + StrCmp $_LOGICLIB_TEMP 1 `${_t}` `${_f}` +!macroend +!define TVClientIsInstalled `"" TVClientIsInstalled ""` + +;====================================== 3rd PARTY APPLICATION TESTs + +!macro _VCRedist2005IsInstalled _a _b _t _f + + ClearErrors + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors `${_f}` + + StrCpy $R1 $R0 3 + + StrCmp $R1 '5.1' lbl_winnt_XP + StrCmp $R1 '5.2' lbl_winnt_2003 + StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` + + + lbl_winnt_vista: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.762_none_11ecb0ab9b2caf3c.manifest" 0 `${_f}` + Goto `${_t}` + + lbl_winnt_2003: + lbl_winnt_XP: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_cbb27474.manifest" 0 `${_f}` + Goto `${_t}` +!macroend +!define VCRedist2005IsInstalled `"" VCRedist2005IsInstalled ""` + +!macro _VCRedist2008IsInstalled _a _b _t _f + + ClearErrors + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors `${_f}` + + StrCpy $R1 $R0 3 + + StrCmp $R1 '5.1' lbl_winnt_XP + StrCmp $R1 '5.2' lbl_winnt_2003 + StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` + + + lbl_winnt_vista: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.1_none_dcc7eae99ad0d9cf.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.21022.8_none_bdf22a22ab9e15d5.manifest" 0 `${_f}` + Goto `${_t}` + + lbl_winnt_2003: + lbl_winnt_XP: + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_405b0943.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.ATL_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_312cf0e9.manifest" 0 `${_f}` + Goto `${_t}` +!macroend +!define VCRedist2008IsInstalled `"" VCRedist2008IsInstalled ""` + +!macro _dotNetIsInstalled _a _b _t _f + SetRegView 32 + + !insertmacro _LOGICLIB_TEMP + + ReadRegStr $4 HKLM "Software\Microsoft\.NETFramework" "InstallRoot" + # remove trailing back slash + Push $4 + Exch $EXEDIR + Exch $EXEDIR + Pop $4 + # if the root directory doesn't exist .NET is not installed + IfFileExists $4 0 `${_f}` + + StrCpy $0 0 + + EnumStart: + + EnumRegKey $2 HKLM "Software\Microsoft\.NETFramework\Policy" $0 + IntOp $0 $0 + 1 + StrCmp $2 "" `${_f}` + + StrCpy $1 0 + + EnumPolicy: + + EnumRegValue $3 HKLM "Software\Microsoft\.NETFramework\Policy\$2" $1 + IntOp $1 $1 + 1 + StrCmp $3 "" EnumStart + IfFileExists "$4\$2.$3" `${_t}` EnumPolicy +!macroend +!define dotNetIsInstalled `"" dotNetIsInstalled ""` + +#**********************************************************************************************************# +# Get MP infos +!macro MP_GET_INSTALL_DIR _var + SetRegView 32 + ;${LOG_TEXT} "DEBUG" "MACRO:MP_GET_INSTALL_DIR" + + ${If} ${MP023IsInstalled} + ReadRegStr ${_var} HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" + ${LOG_TEXT} "INFO" "MediaPortal v0.2.3 installation dir found: ${_var}" + ${ElseIf} ${MPIsInstalled} + ReadRegStr ${_var} HKLM "${MP_REG_UNINSTALL}" "InstallPath" + ${LOG_TEXT} "INFO" "MediaPortal installation dir found: ${_var}" + ${Else} + StrCpy ${_var} "" + ${LOG_TEXT} "INFO" "No MediaPortal installation found: _var will be empty" + ${EndIf} + +!macroend + +!macro TVSERVER_GET_INSTALL_DIR _var + SetRegView 32 + ;${LOG_TEXT} "DEBUG" "MACRO:TVSERVER_GET_INSTALL_DIR" + + ${If} ${TVServerIsInstalled} + ${OrIf} ${TVClientIsInstalled} + ReadRegStr ${_var} HKLM "${TV3_REG_UNINSTALL}" "InstallPath" + ${LOG_TEXT} "INFO" "TVServer/Client installation dir found: ${_var}" + ${Else} + StrCpy ${_var} "" + ${LOG_TEXT} "INFO" "No TVServer/Client installation found: _var will be empty" + ${EndIf} + +!macroend + +!macro MP_GET_VERSION _var + SetRegView 32 + ${LOG_TEXT} "DEBUG" "MACRO:MP_GET_VERSION" + + ${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 + ${LOG_TEXT} "DEBUG" "MACRO:TVSERVER_GET_VERSION" + + ${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 + + ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + ; $0="01" day + ; $1="04" month + ; $2="2005" year + ; $3="Friday" day of week name + ; $4="16" hour + ; $5="05" minute + ; $6="50" seconds + + StrCpy ${_var} "BACKUP_$1-$0_$4-$5" + +!macroend + + + /* +; Section flag test +!macro _MPIsInstalled _a _b _t _f + !insertmacro _LOGICLIB_TEMP + + ReadRegStr $MPBaseDir HKLM "${MP_REG_UNINSTALL}" "UninstallString" + ${If} $MPBaseDir == "" + # this fallback should only be enabled until MediaPortal 1.0 is out + ReadRegStr $MPBaseDir HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" + +#!define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" +#!define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" + + ${If} $MPBaseDir == "" + !insertmacro UnselectSection "${SecClient}" + ; Make the unselected section read only + !insertmacro SetSectionFlag "${SecClient}" 16 + SectionGetText ${SecClient} $R0 + SectionSetText ${SecClient} "$R0 ($(TEXT_MP_NOT_INSTALLED))" + ${EndIf} + ${EndIf} + SectionGetFlags `${_b}` $_LOGICLIB_TEMP + IntOp $_LOGICLIB_TEMP $_LOGICLIB_TEMP & `${_a}` + + !insertmacro _= $_LOGICLIB_TEMP `${_a}` `${_t}` `${_f}` + !macroend + + #!define MPIsInstalled `${SF_SELECTED} SectionFlagIsSet` +!define MPIsInstalled "!insertmacro _MPIsInstalled" + */ + +#--------------------------------------------------------------------------- +# 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 + +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" + +# 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" + +# 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" + +# 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" + +# Remove registry keys +DeleteRegKey HKLM "Software\Team MediaPortal" +DeleteRegKey HKCU "Software\Team MediaPortal" + +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 +!macro NsisSilentUinstall REG_KEY +!if "${REG_KEY}" == "${TV3_REG_UNINSTALL}" + ${StopService} "TVservice" +!endif + + 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" /S _?=$R1' + ;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 + ${LOG_TEXT} "INFO" ".: Operating System Check :." + + GetVersion::WindowsName + Pop $R0 + ${LOG_TEXT} "INFO" "GetVersion::WindowsName: $R0" + !insertmacro GetServicePack $R1 $R2 + ${LOG_TEXT} "INFO" "GetServicePack major: $R1" + ${LOG_TEXT} "INFO" "GetServicePack minor: $R2" + + + ; 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} + StrCpy $0 "OSabort" + ${EndIf} + + ; 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} + + ${LOG_TEXT} "INFO" "============================" +!macroend + +!macro MediaPortalAdminCheck HideWarnings + ${LOG_TEXT} "INFO" ".: Administration Rights Check :." + + ; 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} + + ${LOG_TEXT} "INFO" "============================" +!macroend + +!macro MediaPortalVCRedistCheck HideWarnings + ${LOG_TEXT} "INFO" ".: Microsoft Visual C++ Redistributable Check :." + + ; check if VC Redist 2005 SP1 is installed + #${IfNot} ${VCRedist2005IsInstalled} + # MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_VCREDIST_2005)" IDNO +2 + # ExecShell open "${WEB_REQUIREMENTS}" + # Abort + ; check if VC Redist 2008 SP1 is installed + ${IfNot} ${VCRedist2008IsInstalled} + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_VCREDIST_2008)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + + ${LOG_TEXT} "INFO" "============================" +!macroend + +!macro MediaPortalNetFrameworkCheck HideWarnings + ${LOG_TEXT} "INFO" ".: Microsoft .Net Framework Check :." + + ; check if .Net Framework 2.0 is installed + ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "Install" + ; check if .Net Framework 2.0 SP2 is installed + ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "SP" + + ; check if .Net Framework 3.5 is installed + ReadRegDWORD $2 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "Install" + ; check if .Net Framework 3.5 SP1 is installed + ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP" + + ${LOG_TEXT} "INFO" ".Net 2.0 installed? $0" + ${LOG_TEXT} "INFO" ".Net 2.0 ServicePack: $1" + ${LOG_TEXT} "INFO" ".Net 3.5 installed? $2" + ${LOG_TEXT} "INFO" ".Net 3.5 ServicePack: $3" + + ${If} ${IsWinVISTA} + ${AndIf} ${RunningX64} ; 3.5 is installed, check for sp1 + ${LOG_TEXT} "INFO" "OS is Vista64, .Net 3.5 is installed." + + ${If} $3 < 1 ; if 3.5, but no sp1 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + + ${ElseIf} $0 != 1 ; if no 2.0 + + ${If} $2 != 1 ; if no 3.5 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET20)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${ElseIf} $3 < 1 ; if 3.5, but no sp1 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + + ${ElseIf} $1 < 2 ; if 2.0, but no sp2 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET20_SP)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} + + ${LOG_TEXT} "INFO" "============================" +!macroend + +!endif # !___COMMON_MP_MACROS__NSH___ + Copied: trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh (from rev 2800, trunk/plugins/IR Server Suite/setup/CommonNSIS/include-CommonMPMacros.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -0,0 +1,131 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + + +!ifndef ProcessMacros_INCLUDED +!define ProcessMacros_INCLUDED + +!include LogicLib.nsh +!include "${svn_InstallScripts}\include\LoggingMacros.nsh" + +!define KillProcess `!insertmacro KillProcess` +!macro KillProcess Process + ${LOG_TEXT} "INFO" "KillProcess: ${Process}" + + StrCpy $R1 1 ; set counter to 1 + ${Do} + + nsExec::Exec '"taskkill" /F /IM "${Process}"' + + Pop $0 + + ${Select} $0 + ${Case} "0" + ${LOG_TEXT} "INFO" "KillProcess: ${Process} was killed successfully." + ${ExitDo} + ${Case} "128" + ${LOG_TEXT} "INFO" "KillProcess: ${Process} is not running." + ${ExitDo} + ${CaseElse} + + ${LOG_TEXT} "ERROR" "KillProcess: Unknown result: $0" + IntOp $R1 $R1 + 1 ; increase retry-counter +1 + ${If} $R1 > 5 ; try max. 5 times + ${ExitDo} + ${Else} + ${LOG_TEXT} "INFO" "KillProcess: Trying again. $R1/5" + ${EndIf} + + ${EndSelect} + ${Loop} +!macroend + +!define StopService `!insertmacro StopService` +!macro StopService Service + ${LOG_TEXT} "INFO" "StopService: ${Service}" + + StrCpy $R1 1 ; set counter to 1 + ${Do} + + nsExec::Exec 'net stop "${Service}"' + + Pop $0 + + ${Select} $0 + ${Case} "0" + ${LOG_TEXT} "INFO" "StopService: ${Service} was stopped successfully." + ${ExitDo} + ${Case} "2" + ${LOG_TEXT} "INFO" "StopService: ${Service} is not started." + ${ExitDo} + ${CaseElse} + + ${LOG_TEXT} "ERROR" "StopService: Unknown result: $0" + IntOp $R1 $R1 + 1 ; increase retry-counter +1 + ${If} $R1 > 5 ; try max. 5 times + ${ExitDo} + ${Else} + ${LOG_TEXT} "INFO" "StopService: Trying again. $R1/5" + ${EndIf} + + ${EndSelect} + ${Loop} +!macroend + +!define RenameDirectory `!insertmacro RenameDirectory` +!macro RenameDirectory DirPath NewDirPath + ${LOG_TEXT} "INFO" "RenameDirectory: Old path: ${DirPath}" + ${LOG_TEXT} "INFO" "RenameDirectory: New path: ${NewDirPath}" + + ${If} ${FileExists} "${DirPath}\*.*" + ${LOG_TEXT} "INFO" "RenameDirectory: Directory exists. Trying to rename." + + StrCpy $R1 1 ; set counter to 1 + ${Do} + + ClearErrors + Rename "${DirPath}" "${NewDirPath}" + + IntOp $R1 $R1 + 1 ; increase retry-counter +1 + ${IfNot} ${Errors} + ${LOG_TEXT} "INFO" "RenameDirectory: Renamed directory successfully." + ${ExitDo} + ${ElseIf} $R1 > 5 ; try max. 5 times + ${LOG_TEXT} "ERROR" "RenameDirectory: Renaming directory failed for some reason." + ${ExitDo} + ${Else} + ${LOG_TEXT} "INFO" "RenameDirectory: Trying again. $R1/5" + ${EndIf} + + ${Loop} + + ${Else} + ${LOG_TEXT} "INFO" "RenameDirectory: Directory does not exist. No need to rename: ${DirPath}" + ${EndIf} +!macroend + + + +!endif # !ProcessMacros_INCLUDED Modified: trunk/plugins/IR Server Suite/setup/languages/English.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-04-15 14:42:01 UTC (rev 2800) +++ trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -4,6 +4,8 @@ !insertmacro LANG_STRING TEXT_MSGBOX_REMOVE_ALL "Do you want to remove your User settings?$\r$\nAttention: This will remove all your customised settings including Skins and Databases." +!insertmacro LANG_STRING TEXT_MSGBOX_ERROR_ON_UNINSTALL "An error occured while trying to uninstall old version!$\r$\nDo you still want to continue the installation?" +!insertmacro LANG_STRING TEXT_MSGBOX_ERROR_REBOOT_REQUIRED "A reboot is required after a previous action. Reboot you system and try it again." # Descriptions for components (sections) @@ -30,7 +32,7 @@ !insertmacro LANG_STRING DESC_SectionHcwPvrTuner "Command line tuner for Hauppauge PVR devices." !insertmacro LANG_STRING DESC_SectionMCEBlaster "For tuning external channels (on Set Top Boxes) with Windows Media Center." -# Strings for \xC2ddRemove-Page +# Strings for AddRemove-Page !insertmacro LANG_STRING TEXT_ADDREMOVE_HEADER "Already Installed" !insertmacro LANG_STRING TEXT_ADDREMOVE_HEADER2_REPAIR "Choose the maintenance option to perform." !insertmacro LANG_STRING TEXT_ADDREMOVE_HEADER2_UPDOWN "Choose how you want to install $(^Name)." @@ -43,13 +45,13 @@ !insertmacro LANG_STRING TEXT_ADDREMOVE_UPDOWN_OPT2 "Do not uninstall" # Strings for ServerServiceMode-Page -!insertmacro LANG_STRING ServerServiceModePage_HEADER "TEXT_ServerServiceMode_HEADER" -!insertmacro LANG_STRING ServerServiceModePage_HEADER2 "TEXT_ServerServiceMode_HEADER2" -!insertmacro LANG_STRING ServerServiceModePage_INFO "TEXT_ServerServiceMode_INFO" +!insertmacro LANG_STRING ServerServiceModePage_HEADER "Choose the Server/Service Mode" +!insertmacro LANG_STRING ServerServiceModePage_HEADER2 "Choose whether you want to use InputService or IRServer" +!insertmacro LANG_STRING ServerServiceModePage_INFO "Some Plugins doesn't work together with a windows service. If you have such a remote listed below, choose IRServer." -!insertmacro LANG_STRING ServerServiceModePage_OPT0 "TEXT_ServerServiceMode_OPT0" -!insertmacro LANG_STRING ServerServiceModePage_OPT0_DESC "TEXT_ServerServiceMode_OPT0_DESC" +!insertmacro LANG_STRING ServerServiceModePage_OPT0 "InputService (recommended)" +!insertmacro LANG_STRING ServerServiceModePage_OPT0_DESC "The InputService is a windows service. If you don't know what to choose and you don't have a remote listed below, choose this option." -!insertmacro LANG_STRING ServerServiceModePage_OPT1 "TEXT_ServerServiceMode_OPT1" -!insertmacro LANG_STRING ServerServiceModePage_OPT1_DESC "TEXT_ServerServiceMode_OPT1_DESC" +!insertmacro LANG_STRING ServerServiceModePage_OPT1 "IRServer" +!insertmacro LANG_STRING ServerServiceModePage_OPT1_DESC "IRServer is a windows application. Choose this if you have one of the following remotes:$\r$\n Example remote" Modified: trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh 2009-04-15 14:42:01 UTC (rev 2800) +++ trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh 2009-04-15 20:17:16 UTC (rev 2801) @@ -32,38 +32,51 @@ !insertmacro VersionCompare !insertmacro GetParent -##### Add/Remove/Reinstall page +##### Server/Service Mode page +; $ServerServiceMode 0 = InputService +; $ServerServiceMode 1 = IRServer Var ServerServiceMode Var ServerServiceModePage.optBtn0 Var ServerServiceModePage.optBtn0.state Var ServerServiceModePage.optBtn1 Var ServerServiceModePage.optBtn1.state + Function PageServerServiceMode + + ; if input service is unselected, skip page + ${IfNot} ${SectionIsSelected} ${SectionInputService} + Abort + ${EndIf} + !insertmacro MUI_HEADER_TEXT "$(ServerServiceModePage_HEADER)" "$(ServerServiceModePage_HEADER2)" nsDialogs::Create /NOUNLOAD 1018 - ${NSD_CreateLabel} 0 0 100% 24u "$(ServerServiceModePage_INFO)" + ${NSD_CreateLabel} 0 0 300u 24u "$(ServerServiceModePage_INFO)" Pop $R1 - ${NSD_CreateRadioButton} 20u 30u -30u 8u "$(ServerServiceModePage_OPT0)" + ${NSD_CreateRadioButton} 10u 30u -30u 8u "$(ServerServiceModePage_OPT0)" Pop $ServerServiceModePage.optBtn0 ${NSD_OnClick} $ServerServiceModePage.optBtn0 PageServerServiceModeUpdateSelection - ${NSD_CreateLabel} 30u 45u 100% 24u "$(ServerServiceModePage_OPT0_DESC)" + ${NSD_CreateLabel} 20u 45u -20u 24u "$(ServerServiceModePage_OPT0_DESC)" - ${NSD_CreateRadioButton} 20u 70u -30u 8u "$(ServerServiceModePage_OPT1)" + ${NSD_CreateRadioButton} 10u 70u -30u 8u "$(ServerServiceModePage_OPT... [truncated message content] |
From: <che...@us...> - 2009-04-18 10:26:54
|
Revision: 2811 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2811&view=rev Author: chef_koch Date: 2009-04-18 10:26:44 +0000 (Sat, 18 Apr 2009) Log Message: ----------- fixed some issues installing the service itself Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh 2009-04-18 07:29:45 UTC (rev 2810) +++ trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh 2009-04-18 10:26:44 UTC (rev 2811) @@ -45,7 +45,7 @@ Function PageServerServiceMode ; if input service is unselected, skip page - ${IfNot} ${SectionIsSelected} ${SectionInputService} + ${IfNot} ${SectionIsSelected} SectionInputService Abort ${EndIf} Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-04-18 07:29:45 UTC (rev 2810) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-04-18 10:26:44 UTC (rev 2811) @@ -78,9 +78,13 @@ !include "include\*" -; FileFunc macros -!insertmacro GetParent +!include pages\AddRemovePage.nsh +!insertmacro AddRemovePage "${REG_UNINSTALL}" + +!include pages\ServerServiceMode.nsh + + ;====================================== Name "${PRODUCT_NAME}" @@ -160,7 +164,7 @@ !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES -!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishShow +;!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishShow !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME @@ -386,6 +390,17 @@ ; 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 + ; Install Server/Service + ; $ServerServiceMode 0 = InputService + ; $ServerServiceMode 1 = IRServer + ${If} $ServerServiceMode == 1 + ${LOG_TEXT} "INFO" "Adding IRServer to Autostart..." + !insertmacro SetAutoRun "IR Server" "$DIR_INSTALL\Input Service\IRServer.exe" + ${Else} + ${LOG_TEXT} "INFO" "Installing InputService..." + ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /install' + ${EndIf} + ${MementoSectionEnd} !macro Remove_${SectionInputService} ${LOG_TEXT} "INFO" "Removing Input Service..." @@ -1030,20 +1045,7 @@ ;====================================== ;====================================== -;======= Additional Pages ========= -;====================================== -;====================================== - -!include pages\AddRemovePage.nsh -!insertmacro AddRemovePage "${REG_UNINSTALL}" - -!include pages\ServerServiceMode.nsh - - -;====================================== -;====================================== - Function .onInit ${LOG_OPEN} @@ -1069,19 +1071,8 @@ Function .onInstSuccess -${IfNot} ${SectionIsSelected} ${SectionInputService} +${If} ${SectionIsSelected} ${SectionInputService} - ; Install Server/Service - ; $ServerServiceMode 0 = InputService - ; $ServerServiceMode 1 = IRServer - ${If} $ServerServiceMode == 1 - ${LOG_TEXT} "INFO" "Adding IRServer to Autostart..." - !insertmacro SetAutoRun "IR Server" "$DIR_INSTALL\Input Service\IRServer.exe" - ${Else} - ${LOG_TEXT} "INFO" "Installing InputService..." - ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /install' - ${EndIf} - ; start Server/Service ; $ServerServiceMode 0 = InputService ; $ServerServiceMode 1 = IRServer @@ -1207,7 +1198,7 @@ FunctionEnd ;====================================== - +/* Function FinishShow ; This function is called, after the Finish Page creation is finished @@ -1217,6 +1208,7 @@ ShowWindow $mui.FinishPage.Run ${SW_HIDE} ${EndIf} FunctionEnd +*/ ;====================================== ;====================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-05-31 17:02:02
|
Revision: 2878 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2878&view=rev Author: chef_koch Date: 2009-05-31 17:01:57 +0000 (Sun, 31 May 2009) Log Message: ----------- major changes for the installer routine on installation old one will automatically uninstalled Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/include/DumpLog.nsh Added: trunk/plugins/IR Server Suite/setup/include/DumpLog.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/DumpLog.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/DumpLog.nsh 2009-05-31 17:01:57 UTC (rev 2878) @@ -0,0 +1,83 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + +/* +_____________________________________________________________________________ + + DUMP LOG +_____________________________________________________________________________ +*/ + + +!ifndef ___DUMP_LOG__NSH___ +!define ___DUMP_LOG__NSH___ + + +!define LVM_GETITEMCOUNT 0x1004 +!define LVM_GETITEMTEXT 0x102D + +Function DumpLog + Exch $5 + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $6 + + FindWindow $0 "#32770" "" $HWNDPARENT + GetDlgItem $0 $0 1016 + StrCmp $0 0 exit + FileOpen $5 $5 "w" + StrCmp $5 "" exit + SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6 + System::Alloc ${NSIS_MAX_STRLEN} + Pop $3 + StrCpy $2 0 + System::Call "*(i, i, i, i, i, i, i, i, i) i \ + (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1" + loop: StrCmp $2 $6 done + System::Call "User32::SendMessageA(i, i, i, i) i \ + ($0, ${LVM_GETITEMTEXT}, $2, r1)" + System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)" + FileWrite $5 "$4$\r$\n" + IntOp $2 $2 + 1 + Goto loop + done: + FileClose $5 + System::Free $1 + System::Free $3 + exit: + Pop $6 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + Exch $5 +FunctionEnd + + +!endif # !___DUMP_LOG__NSH___ Modified: trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh 2009-05-31 13:50:12 UTC (rev 2877) +++ trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh 2009-05-31 17:01:57 UTC (rev 2878) @@ -34,88 +34,131 @@ and modified for our needs. */ -!ifndef UninstallModePage +!ifndef ___ADD_REMOVE_PAGE__NSH___ !define ___ADD_REMOVE_PAGE__NSH___ -!macro AddRemovePage RegKey - !include WordFunc.nsh !include FileFunc.nsh ##### Add/Remove/Reinstall page -Var ReinstallPageCheck +Var ReinstallMode +Var ReinstallModePage.optBtn1 +Var ReinstallModePage.optBtn1.state +Var ReinstallModePage.optBtn2 +Var ReinstallModePage.optBtn2.state -Function PageReinstall - ReadRegStr $R0 HKLM "${RegKey}" "InstallPath" - ${If} $R0 == "" +Function PageReinstallMode + ; check if software is already installed + ${If} $PREVIOUS_VERSION == "" Abort ${EndIf} - ReadRegDWORD $R0 HKLM "${RegKey}" "VersionMajor" - ReadRegDWORD $R1 HKLM "${RegKey}" "VersionMinor" - ReadRegDWORD $R2 HKLM "${RegKey}" "VersionRevision" - ReadRegDWORD $R3 HKLM "${RegKey}" "VersionBuild" - StrCpy $R0 $R0.$R1.$R2.$R3 - ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0 - ${If} $R0 == 0 - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" - StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" - StrCpy $R0 "2" - ${ElseIf} $R0 == 1 + ; save current values to stack + Push $R0 + Push $R1 + Push $R2 + Push $R3 + + + ; set string for control texts + ${If} $PREVIOUS_VERSION_STATE == "newer" StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" - ${ElseIf} $R0 == 2 + + ${ElseIf} $PREVIOUS_VERSION_STATE == "older" StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" - StrCpy $R0 "1" + + ${ElseIf} $PREVIOUS_VERSION_STATE == "same" + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" + StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" + ${Else} + MessageBox MB_ICONSTOP "Unknown value of PREVIOUS_VERSION_STATE, aborting" /SD IDOK Abort ${EndIf} + + ; create controls nsDialogs::Create /NOUNLOAD 1018 + Pop $R0 - ${NSD_CreateLabel} 0 0 100% 24u $R1 + ${NSD_CreateLabel} 0 0 300u 24u $R1 Pop $R1 ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 - Pop $R2 - ${NSD_OnClick} $R2 PageReinstallUpdateSelection + Pop $ReinstallModePage.optBtn1 + ${NSD_OnClick} $ReinstallModePage.optBtn1 PageReinstallModeUpdateSelection ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 - Pop $R3 - ${NSD_OnClick} $R3 PageReinstallUpdateSelection + Pop $ReinstallModePage.optBtn2 + ${NSD_OnClick} $ReinstallModePage.optBtn2 PageReinstallModeUpdateSelection - ${If} $ReinstallPageCheck != 2 - SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0 + + ; set current ReinstallMode to option buttons + ${If} $ReinstallMode == 2 + ${NSD_Check} $ReinstallModePage.optBtn2 ${Else} - SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${NSD_Check} $ReinstallModePage.optBtn1 ${EndIf} + nsDialogs::Show -FunctionEnd -Function PageReinstallUpdateSelection + ; restore values from stack + Pop $R3 + Pop $R2 Pop $R1 + Pop $R0 +FunctionEnd - ${NSD_GetState} $R2 $R1 +Function PageReinstallModeUpdateSelection - ${If} $R1 == ${BST_CHECKED} - StrCpy $ReinstallPageCheck 1 + ${NSD_GetState} $ReinstallModePage.optBtn1 $ReinstallModePage.optBtn1.state + ${NSD_GetState} $ReinstallModePage.optBtn2 $ReinstallModePage.optBtn2.state + + ${If} $ReinstallModePage.optBtn2.state == ${BST_CHECKED} + StrCpy $ReinstallMode 2 ${Else} - StrCpy $ReinstallPageCheck 2 + StrCpy $ReinstallMode 1 ${EndIf} FunctionEnd -Function PageLeaveReinstall +Function PageLeaveReinstallMode + + StrCpy $EXPRESS_UPDATE 0 + + ; Uninstall is selected + ${If} $PREVIOUS_VERSION_STATE == "same" + ${AndIf} $ReinstallMode == 2 + + StrCpy $EXPRESS_UPDATE 1 + Call RunUninstaller + Quit + + ${EndIf} + + + ; ExpressUpdate is selected + ${If} $PREVIOUS_VERSION_STATE != "same" + ${AndIf} $ReinstallMode == 1 + + StrCpy $EXPRESS_UPDATE 1 !insertmacro LoadPreviousSettings + Call LoadPreviousSettings + + ${EndIf} + +FunctionEnd + +/* ${NSD_GetState} $R2 $R1 StrCmp $R0 "1" 0 +2 @@ -152,7 +195,6 @@ finish: FunctionEnd +*/ -!macroend - !endif # !___ADD_REMOVE_PAGE__NSH___ Modified: trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh 2009-05-31 13:50:12 UTC (rev 2877) +++ trunk/plugins/IR Server Suite/setup/pages/ServerServiceMode.nsh 2009-05-31 17:01:57 UTC (rev 2878) @@ -33,64 +33,81 @@ !insertmacro GetParent ##### Server/Service Mode page -; $ServerServiceMode 0 = InputService -; $ServerServiceMode 1 = IRServer +; $ServerServiceMode "InputService" = InputService +; $ServerServiceMode "IRServer" = IRServer +Var PREVIOUS_ServerServiceMode Var ServerServiceMode -Var ServerServiceModePage.optBtn0 -Var ServerServiceModePage.optBtn0.state -Var ServerServiceModePage.optBtn1 -Var ServerServiceModePage.optBtn1.state +Var ServerServiceModePage.optBtnInputService +Var ServerServiceModePage.optBtnInputService.state +Var ServerServiceModePage.optBtnIRServer +Var ServerServiceModePage.optBtnIRServer.state Function PageServerServiceMode + Push $R0 - ; if input service is unselected, skip page + ; skip page if InputService/IRServer is unselected ${IfNot} ${SectionIsSelected} SectionInputService Abort ${EndIf} + ; skip page if previous settings are used for update + ${If} $EXPRESS_UPDATE == 1 + Abort + ${EndIf} + !insertmacro MUI_HEADER_TEXT "$(ServerServiceModePage_HEADER)" "$(ServerServiceModePage_HEADER2)" nsDialogs::Create /NOUNLOAD 1018 + Pop $R0 ${NSD_CreateLabel} 0 0 300u 24u "$(ServerServiceModePage_INFO)" - Pop $R1 + Pop $R0 ${NSD_CreateRadioButton} 10u 30u -10u 8u "$(ServerServiceModePage_OPT0)" - Pop $ServerServiceModePage.optBtn0 - ${NSD_OnClick} $ServerServiceModePage.optBtn0 PageServerServiceModeUpdateSelection + Pop $ServerServiceModePage.optBtnInputService + ${NSD_OnClick} $ServerServiceModePage.optBtnInputService PageServerServiceModeUpdateSelection ${NSD_CreateLabel} 20u 45u -20u 24u "$(ServerServiceModePage_OPT0_DESC)" + Pop $R0 ${NSD_CreateRadioButton} 10u 70u -10u 8u "$(ServerServiceModePage_OPT1)" - Pop $ServerServiceModePage.optBtn1 - ${NSD_OnClick} $ServerServiceModePage.optBtn1 PageServerServiceModeUpdateSelection + Pop $ServerServiceModePage.optBtnIRServer + ${NSD_OnClick} $ServerServiceModePage.optBtnIRServer PageServerServiceModeUpdateSelection ${NSD_CreateLabel} 20u 85u -20u 24u "$(ServerServiceModePage_OPT1_DESC)" + Pop $R0 + ; set current ServerServiceMode to option buttons - ${If} $ServerServiceMode == 1 - ${NSD_Check} $ServerServiceModePage.optBtn1 + ${If} $ServerServiceMode == "IRServer" + ${NSD_Check} $ServerServiceModePage.optBtnIRServer ${Else} - ${NSD_Check} $ServerServiceModePage.optBtn0 + ${NSD_Check} $ServerServiceModePage.optBtnInputService ${EndIf} nsDialogs::Show + + Pop $R0 FunctionEnd Function PageServerServiceModeUpdateSelection - ${NSD_GetState} $ServerServiceModePage.optBtn0 $ServerServiceModePage.optBtn0.state - ${NSD_GetState} $ServerServiceModePage.optBtn1 $ServerServiceModePage.optBtn1.state + ${NSD_GetState} $ServerServiceModePage.optBtnInputService $ServerServiceModePage.optBtnInputService.state + ${NSD_GetState} $ServerServiceModePage.optBtnIRServer $ServerServiceModePage.optBtnIRServer.state - ${If} $ServerServiceModePage.optBtn1.state == ${BST_CHECKED} - StrCpy $ServerServiceMode 1 + ${If} $ServerServiceModePage.optBtnIRServer.state == ${BST_CHECKED} + StrCpy $ServerServiceMode "IRServer" ${Else} - StrCpy $ServerServiceMode 0 + StrCpy $ServerServiceMode "InputService" ${EndIf} FunctionEnd +Function PageLeaveServerServiceMode + +FunctionEnd + !endif # !___SERVER_SERVICE_MODE_PAGE__NSH___ Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-05-31 13:50:12 UTC (rev 2877) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-05-31 17:01:57 UTC (rev 2878) @@ -26,7 +26,9 @@ ;!define svn_InstallScripts "${svn_ROOT_IRSS}\setup\CommonNSIS" !define svn_InstallScripts "." +SetCompressor /SOLID /FINAL lzma + #--------------------------------------------------------------------------- # DEFINES #--------------------------------------------------------------------------- @@ -54,9 +56,6 @@ !define VERSION "Test Build ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}" !endif -BrandingText "${PRODUCT_NAME} - ${VERSION} by ${PRODUCT_PUBLISHER}" -SetCompressor /SOLID /FINAL lzma - ; enable logging !define INSTALL_LOG @@ -65,8 +64,25 @@ ; if you want to set custom path to logfile, uncomment the following line #!define INSTALL_LOG_FILE "$DESKTOP\install_$(^Name).log" -;====================================== +#--------------------------------------------------------------------------- +# VARIABLES +#--------------------------------------------------------------------------- +Var DIR_INSTALL +Var DIR_MEDIAPORTAL +Var DIR_TVSERVER + +Var PREVIOUS_INSTALLDIR +Var PREVIOUS_VERSION +Var PREVIOUS_VERSION_STATE +Var EXPRESS_UPDATE + +Var frominstall + + +#--------------------------------------------------------------------------- +# INCLUDES +#--------------------------------------------------------------------------- !include x64.nsh !include MUI2.nsh !include Sections.nsh @@ -78,15 +94,13 @@ !include "include\*" - !include pages\AddRemovePage.nsh -!insertmacro AddRemovePage "${REG_UNINSTALL}" - !include pages\ServerServiceMode.nsh -;====================================== - +#--------------------------------------------------------------------------- +# INSTALLER ATTRIBUTES +#--------------------------------------------------------------------------- Name "${PRODUCT_NAME}" OutFile "..\${PRODUCT_NAME} - ${VERSION}.exe" InstallDir "" @@ -95,11 +109,9 @@ ShowUninstDetails show CRCCheck On -; Variables -Var DIR_INSTALL -Var DIR_MEDIAPORTAL -Var DIR_TVSERVER +BrandingText "${PRODUCT_NAME} - ${VERSION} by ${PRODUCT_PUBLISHER}" + #--------------------------------------------------------------------------- # INSTALLER INTERFACE settings #--------------------------------------------------------------------------- @@ -126,15 +138,21 @@ !define MUI_UNFINISHPAGE_NOAUTOCLOSE + #--------------------------------------------------------------------------- # INSTALLER INTERFACE #--------------------------------------------------------------------------- !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "..\Documentation\LICENSE.GPL" -Page custom PageReinstall + +Page custom PageReinstallMode PageLeaveReinstallMode + +!define MUI_PAGE_CUSTOMFUNCTION_PRE PageComponentsPre !insertmacro MUI_PAGE_COMPONENTS -Page custom PageServerServiceMode +Page custom PageServerServiceMode PageLeaveServerServiceMode + +/* ; MediaPortal install path !define MUI_PAGE_HEADER_TEXT "Choose MediaPortal Location" !define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install MediaPortal plugins." @@ -154,30 +172,34 @@ !define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreTV !define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveTV !insertmacro MUI_PAGE_DIRECTORY +*/ ; Main app install path -!define MUI_PAGE_HEADER_TEXT "Choose ${PRODUCT_NAME} Location" -!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install ${PRODUCT_NAME}." -!define MUI_DIRECTORYPAGE_TEXT_TOP "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 Install to start the installation." -!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "${PRODUCT_NAME} Folder" !define MUI_DIRECTORYPAGE_VARIABLE "$DIR_INSTALL" +!define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre !insertmacro MUI_PAGE_DIRECTORY +!define MUI_PAGE_CUSTOMFUNCTION_PRE PageInstfilesShow !insertmacro MUI_PAGE_INSTFILES + ;!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishShow !insertmacro MUI_PAGE_FINISH + +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.WelcomePagePre !insertmacro MUI_UNPAGE_WELCOME +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre !insertmacro MUI_UNPAGE_FINISH # Installer languages !insertmacro LANG_LOAD "English" -;====================================== -;====================================== - +#--------------------------------------------------------------------------- +# INSTALLER SETTINGS +#--------------------------------------------------------------------------- !macro SectionList MacroName ; This macro used to perform operation on multiple sections. ; List all of your components in following manner here. @@ -186,7 +208,7 @@ !insertmacro "${MacroName}" "SectionMPCommon" !insertmacro "${MacroName}" "SectionMPControlPlugin" !insertmacro "${MacroName}" "SectionMPBlastZonePlugin" - #!insertmacro "${MacroName}" "SectionTV2BlasterPlugin" +; !insertmacro "${MacroName}" "SectionTV2BlasterPlugin" !insertmacro "${MacroName}" "SectionTV3Common" !insertmacro "${MacroName}" "SectionTV3BlasterPlugin" @@ -210,49 +232,63 @@ ;====================================== -!macro Initialize +!macro RunUninstaller SILENT - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} + ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "UninstallString" + ${If} ${FileExists} "$R0" - ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" - ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" - ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" +!if "${SILENT}" != "silent" + ; Run uninstaller nonsilent, hide the installer windows + HideWindow +!endif - ${If} ${RunningX64} - SetRegView 32 - ${EnableX64FSRedirection} - ${Endif} + ; get installation dir from uninstaller.exe path + ${GetParent} $R0 $R1 - ; Get MediaPortal installation directory ... - ${If} $DIR_MEDIAPORTAL == "" - !insertmacro MP_GET_INSTALL_DIR "$DIR_MEDIAPORTAL" - ${Endif} + ; clearerrors, to catch if uninstall fails + ClearErrors + ; copy uninstaller to temp, to make sure uninstaller.exe in instdir is deleted, too + CopyFiles $R0 "$TEMP\uninstall-temp.exe" - ; Get MediaPortal TV Server installation directory ... - ${If} $DIR_TVSERVER == "" - !insertmacro TVSERVER_GET_INSTALL_DIR "$DIR_TVSERVER" - ${Endif} + ; launch uninstaller + ${If} $PREVIOUS_VERSION_STATE == "same" + ${AndIf} $EXPRESS_UPDATE == "1" + ExecWait '"$TEMP\uninstall-temp.exe" _?=$R1' + ${Else} - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} +!if "${SILENT}" != "silent" + ExecWait '"$TEMP\uninstall-temp.exe" /frominstall _?=$R1' +!else + ExecWait '"$TEMP\uninstall-temp.exe" /S _?=$R1' +!endif - ; Get IR Server Suite installation directory ... - ${If} $DIR_INSTALL == "" - StrCpy '$DIR_INSTALL' '$PROGRAMFILES\${PRODUCT_NAME}' - ${Endif} + ${EndIf} + ${EndIf} + !macroend +Function RunUninstaller -;====================================== -;====================================== + ; old (un)installers should be called silently + ${If} $PREVIOUS_VERSION == "" + !insertmacro RunUninstaller "silent" + ${Else} + !insertmacro RunUninstaller "NoSilent" + ${EndIf} -Section "-Prepare" +FunctionEnd +Section "-prepare" + + ; uninstall old version if necessary + ${If} ${Silent} + + !insertmacro RunUninstaller "silent" + + ${EndIf} + + +/* OBSOLETE since irss is uninstalled before DetailPrint "Preparing to install ..." IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" StopInputService SkipStopInputService @@ -262,7 +298,7 @@ SkipStopInputService: Sleep 100 - +*/ SectionEnd ;====================================== @@ -274,15 +310,7 @@ ; Use the all users context SetShellVarContext all - ; Create install directory - CreateDirectory "$DIR_INSTALL" - ; 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" - - ; Create app data directories SetOutPath "$DIR_INSTALL" File "..\Documentation\${PRODUCT_NAME}.chm" @@ -300,8 +328,6 @@ File /r /x .svn "..\Set Top Boxes\*.*" SetOverwrite on - ; Create a start menu shortcut folder - CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" SectionEnd @@ -315,14 +341,14 @@ SetShellVarContext all + ;not needed anymore since uninstall is launched before + ;${LOG_TEXT} "INFO" "Removing current IRServer from Autostart..." + ;!insertmacro RemoveAutoRun "IR Server" + ;${LOG_TEXT} "INFO" "Uninstalling current InputService..." + ;ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /uninstall' - ${LOG_TEXT} "INFO" "Removing current IRServer from Autostart..." - !insertmacro RemoveAutoRun "IR Server" - ${LOG_TEXT} "INFO" "Uninstalling current InputService..." - ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /uninstall' - ${LOG_TEXT} "INFO" "Installing Input Service..." SetOutPath "$DIR_INSTALL\Input Service" File "..\Input Service\Input Service\bin\${Build_Type}\*.*" @@ -391,9 +417,7 @@ 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 ; Install Server/Service - ; $ServerServiceMode 0 = InputService - ; $ServerServiceMode 1 = IRServer - ${If} $ServerServiceMode == 1 + ${If} $ServerServiceMode == "IRServer" ${LOG_TEXT} "INFO" "Adding IRServer to Autostart..." !insertmacro SetAutoRun "IR Server" "$DIR_INSTALL\Input Service\IRServer.exe" ${Else} @@ -541,12 +565,13 @@ Delete /REBOOTOK "$MPdir.Plugins\Process\TV2BlasterPlugin.*" !macroend +;====================================== */ -;====================================== SectionGroupEnd ;====================================== + Var RestartTvService !macro StopTVService ${If} $RestartTvService != 0 @@ -669,8 +694,9 @@ ;====================================== SectionGroupEnd + +;====================================== */ -;====================================== SectionGroup "Tools" SectionGroupTools @@ -984,8 +1010,6 @@ ; 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 !if ${VER_BUILD} == 0 @@ -995,16 +1019,34 @@ 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 registry settings + WriteRegStr HKLM "${REG_UNINSTALL}" "ServerServiceMode" "$ServerServiceMode" + + ; 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 product version into the registry + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionMajor" "${VER_MAJOR}" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionMinor" "${VER_MINOR}" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionRevision" "${VER_REVISION}" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionBuild" "${VER_BUILD}" + ; 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" "${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 + WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayName" "${PRODUCT_NAME}" + WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayVersion" "${VERSION}" + WriteRegStr HKLM "${REG_UNINSTALL}" "Publisher" "${PRODUCT_PUBLISHER}" + WriteRegStr HKLM "${REG_UNINSTALL}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" + WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayIcon" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" + WriteRegStr HKLM "${REG_UNINSTALL}" "UninstallString" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "NoModify" 1 + WriteRegDWORD HKLM "${REG_UNINSTALL}" "NoRepair" 1 + ; Write the uninstaller + WriteUninstaller "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" + ; Store the install log StrCpy $0 "$APPDATA\${PRODUCT_NAME}\Logs\Install.log" Push $0 @@ -1013,23 +1055,23 @@ SectionEnd ;====================================== -;====================================== Section "Uninstall" ; Use the all users context SetShellVarContext all - ;First removes all optional components + ; First removes all optional components !insertmacro SectionList "RemoveSection" ; start tvservice, if it was closed before !insertmacro StartTVService + ; do not remove anything in appdata + ;DetailPrint "Removing Set Top Box presets ..." + ;RMDir /R "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" + ; Remove files and uninstaller - DetailPrint "Removing Set Top Box presets ..." - RMDir /R "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" - DetailPrint "Removing program files ..." RMDir /R /REBOOTOK "$DIR_INSTALL" @@ -1041,42 +1083,141 @@ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" DeleteRegKey HKLM "Software\${PRODUCT_NAME}" + + ${If} $frominstall == 1 + Quit + ${EndIf} SectionEnd -;====================================== -;====================================== +#--------------------------------------------------------------------------- +# SOME MACROS AND FUNCTIONS +#--------------------------------------------------------------------------- -Function .onInit - ${LOG_OPEN} +!macro CheckMediaPortalPaths - !insertmacro Initialize - ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL + ${If} ${RunningX64} + SetRegView 32 + ${EnableX64FSRedirection} + ${Endif} - ; first read the old installation status + ; Get MediaPortal installation directory ... + ${If} $DIR_MEDIAPORTAL == "" + !insertmacro MP_GET_INSTALL_DIR "$DIR_MEDIAPORTAL" + ${Endif} + + ; Get MediaPortal TV Server installation directory ... + ${If} $DIR_TVSERVER == "" + !insertmacro TVSERVER_GET_INSTALL_DIR "$DIR_TVSERVER" + ${Endif} + + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} + +!macroend + +!macro ReadPreviousVersion + Push $R0 + Push $R1 + Push $R2 + Push $R3 + + ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" + ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" + ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" + ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" + ${If} $R0 == "" + ${OrIf} $R1 == "" + ${OrIf} $R2 == "" + ${OrIf} $R3 == "" + StrCpy $PREVIOUS_VERSION "" + ${Else} + StrCpy $PREVIOUS_VERSION $R0.$R1.$R2.$R3 + ${EndIf} + + ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $PREVIOUS_VERSION $R0 + ${If} $R0 == 0 + StrCpy $PREVIOUS_VERSION_STATE "same" + ${ElseIf} $R0 == 1 + StrCpy $PREVIOUS_VERSION_STATE "newer" + ${ElseIf} $R0 == 2 + StrCpy $PREVIOUS_VERSION_STATE "older" + ${Else} + StrCpy $PREVIOUS_VERSION_STATE "" + ${EndIf} + + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 +!macroend + +!macro ReadPreviousSettings + + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} + + ; read and analyze previous version + !insertmacro ReadPreviousVersion + + ; read previous used directories + ReadRegStr $PREVIOUS_INSTALLDIR HKLM "Software\${PRODUCT_NAME}" "Install_Dir" + #ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" + #ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" + !insertmacro CheckMediaPortalPaths ; if not installed, path == "" + + ; read previous settings + ReadRegStr $PREVIOUS_ServerServiceMode HKLM "${REG_UNINSTALL}" "ServerServiceMode" +!macroend + +Function LoadPreviousSettings + ; reset DIR_INSTALL + ${If} $PREVIOUS_INSTALLDIR != "" + StrCpy '$DIR_INSTALL' '$PREVIOUS_INSTALLDIR' + ${Else} + StrCpy '$DIR_INSTALL' '$PROGRAMFILES\${PRODUCT_NAME}' + ${EndIf} + + ; reset ServerServiceMode + ${If} $PREVIOUS_ServerServiceMode == "InputService" + ${OrIf} $PREVIOUS_ServerServiceMode == "IRServer" + StrCpy $ServerServiceMode $PREVIOUS_ServerServiceMode + ${Else} + StrCpy $ServerServiceMode "InputService" + ${EndIf} + + ; reset previous component selection from registry ${MementoSectionRestore} + ; update component selection, according to possible selections Call .onSelChange - - ; on default set mode to service - StrCpy $ServerServiceMode 0 FunctionEnd -;====================================== +#--------------------------------------------------------------------------- +# INSTALLER CALLBACKS +#--------------------------------------------------------------------------- +Function .onInit + ${LOG_OPEN} + !insertmacro ReadPreviousSettings + Call LoadPreviousSettings + ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL + +FunctionEnd + Function .onInstFailed ${LOG_CLOSE} FunctionEnd -;====================================== - Function .onInstSuccess ${If} ${SectionIsSelected} ${SectionInputService} ; start Server/Service - ; $ServerServiceMode 0 = InputService - ; $ServerServiceMode 1 = IRServer - ${If} $ServerServiceMode == 1 + ${If} $ServerServiceMode == "IRServer" ${LOG_TEXT} "INFO" "Starting IRServer..." Exec "$DIR_INSTALL\Input Service\IRServer.exe" ${Else} @@ -1090,14 +1231,12 @@ ${LOG_CLOSE} FunctionEnd -;====================================== - Function .onSelChange ; disable/remove common files for MediaPortal plugins if all MediaPortal plugins are unselected ${IfNot} ${SectionIsSelected} ${SectionMPControlPlugin} ${AndIfNot} ${SectionIsSelected} ${SectionMPBlastZonePlugin} -# ${AndIfNot} ${SectionIsSelected} ${SectionTV2BlasterPlugin} +; ${AndIfNot} ${SectionIsSelected} ${SectionTV2BlasterPlugin} !insertmacro UnselectSection ${SectionMPCommon} ${Else} !insertmacro SelectSection ${SectionMPCommon} @@ -1114,90 +1253,78 @@ ;====================================== +Function PageComponentsPre + ; skip page if previous settings are used for update + ${If} $EXPRESS_UPDATE == 1 + Abort + ${EndIf} +FunctionEnd + +/* Function DirectoryPreMP + ; skip page if no MediaPortal plugins are selected ${IfNot} ${SectionIsSelected} ${SectionGroupMP} Abort ${EndIf} + + ; skip page if previous settings are used for update and DIR_MEDIAPORTAL is valid + ${If} $EXPRESS_UPDATE == 1 + ${AndIf} $DIR_MEDIAPORTAL != "" + Abort + ${EndIf} FunctionEnd Function DirectoryLeaveMP - /* ; verify if the dir is valid ${IfNot} ${FileExists} "$DIR_MEDIAPORTAL\MediaPortal.exe" MessageBox MB_OK|MB_ICONEXCLAMATION "MediaPortal is not found in this directory. Please specify the correct path to MediaPortal." Abort ${EndIf} - */ - ; refresh MP subdirs, if it user has changed the path again + ; refresh MP subdirs, if user has changed the path again ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL FunctionEnd -;====================================== - Function DirectoryPreTV + ; skip page if no TvServer plugins are selected ${IfNot} ${SectionIsSelected} ${SectionGroupTV3} Abort ${EndIf} + + ; skip page if previous settings are used for update and DIR_TVSERVER is valid + ${If} $EXPRESS_UPDATE == 1 + ${AndIf} $DIR_TVSERVER != "" + Abort + ${EndIf} FunctionEnd Function DirectoryLeaveTV - /* ; verify if the dir is valid - ${IfNot} ${FileExists} "$DIR_MEDIAPORTAL\MediaPortal.exe" - MessageBox MB_OK|MB_ICONEXCLAMATION "MediaPortal is not found in this directory. Please specify the correct path to MediaPortal." + ${IfNot} ${FileExists} "$DIR_TVSERVER\TvService.exe" + MessageBox MB_OK|MB_ICONEXCLAMATION "TvServer is not found in this directory. Please specify the correct path to TVServer." Abort ${EndIf} - */ FunctionEnd +*/ -;====================================== +Function PageDirectoryPre + ; skip page if previous settings are used for update + ${If} $EXPRESS_UPDATE == 1 + Abort + ${EndIf} +FunctionEnd -!define LVM_GETITEMCOUNT 0x1004 -!define LVM_GETITEMTEXT 0x102D - -Function DumpLog - Exch $5 - Push $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $6 - - FindWindow $0 "#32770" "" $HWNDPARENT - GetDlgItem $0 $0 1016 - StrCmp $0 0 exit - FileOpen $5 $5 "w" - StrCmp $5 "" exit - SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6 - System::Alloc ${NSIS_MAX_STRLEN} - Pop $3 - StrCpy $2 0 - System::Call "*(i, i, i, i, i, i, i, i, i) i \ - (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1" - loop: StrCmp $2 $6 done - System::Call "User32::SendMessageA(i, i, i, i) i \ - ($0, ${LVM_GETITEMTEXT}, $2, r1)" - System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)" - FileWrite $5 "$4$\r$\n" - IntOp $2 $2 + 1 - Goto loop - done: - FileClose $5 - System::Free $1 - System::Free $3 - exit: - Pop $6 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 - Exch $5 +Function PageInstfilesShow + + ${If} $EXPRESS_UPDATE != "" + + Call RunUninstaller + BringToFront + + ${EndIf} + FunctionEnd -;====================================== /* Function FinishShow ; This function is called, after the Finish Page creation is finished @@ -1210,35 +1337,60 @@ FunctionEnd */ -;====================================== -;====================================== +#--------------------------------------------------------------------------- +# UNINSTALLER CALLBACKS +#--------------------------------------------------------------------------- +Function un.onInit -Function un.onUninstSuccess - HideWindow - MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." + !insertmacro ReadPreviousSettings + ${un.ReadMediaPortalDirs} $DIR_MEDIAPORTAL + + ; parse parameters + ClearErrors + ${un.GetParameters} $R0 + + ${un.GetOptions} $R0 "/frominstall" $R1 + ${Unless} ${Errors} + StrCpy $frominstall 1 + ${EndUnless} FunctionEnd ;====================================== -Function un.onInit +Function un.WelcomePagePre - !insertmacro Initialize - ${un.ReadMediaPortalDirs} $DIR_MEDIAPORTAL + ${If} $frominstall == 1 + Abort + ${EndIf} - 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 -;====================================== -;====================================== +Function un.ConfirmPagePre -; Section descriptions + ${If} $frominstall == 1 + Abort + ${EndIf} + +FunctionEnd + +Function un.FinishPagePre + + ${If} $frominstall == 1 + SetRebootFlag false + Abort + ${EndIf} + +FunctionEnd + +#--------------------------------------------------------------------------- +# SECTION DESCRIPTIONS +#--------------------------------------------------------------------------- !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SectionInputService} "$(DESC_SectionInputService)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMP} "$(DESC_SectionGroupMP)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "$(DESC_SectionMPControlPlugin)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "$(DESC_SectionMPBlastZonePlugin)" -# !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" +; !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupTV3} "$(DESC_SectionGroupTV3)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" ; !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMCE} "$(DESC_SectionGroupMCE)" @@ -1253,6 +1405,3 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SectionHcwPvrTuner} "$(DESC_SectionHcwPvrTuner)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionDebugClient} "$(DESC_SectionDebugClient)" !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;====================================== -;====================================== \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-05-31 17:56:01
|
Revision: 2881 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2881&view=rev Author: chef_koch Date: 2009-05-31 17:55:51 +0000 (Sun, 31 May 2009) Log Message: ----------- input service should be stopped before (un)installing Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh 2009-05-31 17:37:46 UTC (rev 2880) +++ trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh 2009-05-31 17:55:51 UTC (rev 2881) @@ -151,7 +151,7 @@ ${If} $PREVIOUS_VERSION_STATE != "same" ${AndIf} $ReinstallMode == 1 - StrCpy $EXPRESS_UPDATE 1 !insertmacro LoadPreviousSettings + StrCpy $EXPRESS_UPDATE 1 Call LoadPreviousSettings ${EndIf} Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-05-31 17:37:46 UTC (rev 2880) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-05-31 17:55:51 UTC (rev 2881) @@ -335,6 +335,8 @@ ${MementoSection} "Input Service" SectionInputService ${LOG_TEXT} "INFO" "Installing Input Service..." + ${StopService} "Input Service" + ${KILLPROCESS} "IRServer.exe" ${KILLPROCESS} "Input Service Configuration.exe" ; Use the all users context @@ -428,6 +430,8 @@ ${MementoSectionEnd} !macro Remove_${SectionInputService} ${LOG_TEXT} "INFO" "Removing Input Service..." + ${StopService} "Input Service" + ${KILLPROCESS} "IRServer.exe" ${KILLPROCESS} "Input Service Configuration.exe" ${LOG_TEXT} "INFO" "Removing IRServer from Autostart..." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-06-01 17:42:06
|
Revision: 2886 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2886&view=rev Author: chef_koch Date: 2009-06-01 17:42:00 +0000 (Mon, 01 Jun 2009) Log Message: ----------- some fixes and changes, after applying the rework to mp and tvsetup Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh trunk/plugins/IR Server Suite/setup/languages/English.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh 2009-05-31 23:08:00 UTC (rev 2885) +++ trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh 2009-06-01 17:42:00 UTC (rev 2886) @@ -30,16 +30,11 @@ !include LogicLib.nsh !include x64.nsh +!include "${svn_InstallScripts}\include\WinVerEx.nsh" !include "${svn_InstallScripts}\include\LanguageMacros.nsh" !include "${svn_InstallScripts}\include\LoggingMacros.nsh" -!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" !endif @@ -94,6 +89,10 @@ !macroend */ + +#--------------------------------------------------------------------------- +# SECTION MACROS +#--------------------------------------------------------------------------- !macro FinishSection SecName ;This macro reads section flag set by user and removes the section ;if it is not selected. @@ -118,16 +117,58 @@ !insertmacro "Remove_${${SecName}}" !macroend -!macro DisableComponent SectionName AddText - !insertmacro UnselectSection "${SectionName}" - ; Make the unselected section read only - !insertmacro SetSectionFlag "${SectionName}" 16 - SectionGetText ${SectionName} $R0 - SectionSetText ${SectionName} "$R0${AddText}" + + +!macro EnableSection SectionName SectionTitle +/* + ; check the component + ;!insertmacro SelectSection "${SectionName}" + ; remove the read only flag to the section, see Sections.nsh of official NSIS header files + ;!insertmacro ClearSectionFlag "${SectionName}" "${SF_RO}" + ${If} ${SectionIsSectionGroup} "${SectionName}" + !insertmacro SetSectionFlag "${SectionName}" "${SF_EXPAND}" + ${EndIf} + ; set new text for the component + SectionSetText "${SectionName}" "${SectionTitle}" +*/ !macroend +!macro DisableSection SectionName SectionTitle AddText + ; uncheck the component, so that it won't be installed + !insertmacro UnselectSection "${SectionName}" + ; add the read only flag to the section, see Sections.nsh of official NSIS header files + !insertmacro SetSectionFlag "${SectionName}" ${SF_RO} + ${If} ${SectionIsSectionGroup} "${SectionName}" + !insertmacro ClearSectionFlag "${SectionName}" ${SF_EXPAND} + ${EndIf} + ; set new text for the component + SectionSetText "${SectionName}" "${SectionTitle}${AddText}" +!macroend +#--------------------------------------------------------------------------- +# COMMANDLINE PARAMETERS +#--------------------------------------------------------------------------- +; gets comandline parameter +!macro InitCommandlineParameterCall UNINSTALL + ${${UNINSTALL}GetParameters} $R0 + ${LOG_TEXT} "DEBUG" "commandline parameters: $R0" +!macroend +!define InitCommandlineParameter `!insertmacro InitCommandlineParameterCall ""` +!define un.InitCommandlineParameter `!insertmacro InitCommandlineParameterCall "un."` + +; check for special parameter and set the their variables, need InitCommandlineParameter first +!macro ReadCommandlineParameterCall UNINSTALL Parameter + ClearErrors + ${${UNINSTALL}GetOptions} $R0 "/${Parameter}" $R1 + ${IfNot} ${Errors} + StrCpy $${Parameter} 1 + ${EndUnless} +!macroend +!define ReadCommandlineParameter `!insertmacro ReadCommandlineParameterCall ""` +!define un.ReadCommandlineParameter `!insertmacro ReadCommandlineParameterCall "un."` + + #**********************************************************************************************************# # # Useful macros for MediaPortal and addtional Software which can be used like other LogicLib expressions. @@ -143,30 +184,27 @@ # old installations < 0.2.3.0 RC 3 !macro _MP022IsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP - ClearErrors ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87819CFA-1786-484D-B0DE-10B5FBF2625D}" "UninstallString" - IfErrors `${_f}` `${_t}` + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MP022IsInstalled `"" MP022IsInstalled ""` !macro _MP023RC3IsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0 RC3" "UninstallString" - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MP023RC3IsInstalled `"" MP023RC3IsInstalled ""` !macro _MP023IsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0" "UninstallString" - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MP023IsInstalled `"" MP023IsInstalled ""` @@ -175,23 +213,22 @@ !macro _MSI_TVServerIsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP - ClearErrors ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B738773-EE07-413D-AFB7-BB0AB04A5488}" "UninstallString" - IfErrors `${_f}` `${_t}` + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MSI_TVServerIsInstalled `"" MSI_TVServerIsInstalled ""` !macro _MSI_TVClientIsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP - ClearErrors ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F7444E89-5BC0-497E-9650-E50539860DE0}" "UninstallString" - IfErrors 0 `${_t}` + IfFileExists $_LOGICLIB_TEMP `${_t}` + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FD9FD453-1C0C-4EDA-AEE6-D7CF0E9951CA}" "UninstallString" - IfErrors `${_f}` `${_t}` + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MSI_TVClientIsInstalled `"" MSI_TVClientIsInstalled ""` @@ -199,20 +236,18 @@ !macro _MPIsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "${MP_REG_UNINSTALL}" "UninstallString" - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MPIsInstalled `"" MPIsInstalled ""` !macro _TVServerIsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" - IfFileExists $_LOGICLIB_TEMP 0 `${_f}` ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecServer" @@ -222,10 +257,9 @@ !macro _TVClientIsInstalled _a _b _t _f SetRegView 32 + !insertmacro _LOGICLIB_TEMP - !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" - IfFileExists $_LOGICLIB_TEMP 0 `${_f}` ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "MementoSection_SecClient" @@ -279,14 +313,14 @@ lbl_winnt_vista: IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.manifest" 0 `${_f}` IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.1_none_dcc7eae99ad0d9cf.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.21022.8_none_bdf22a22ab9e15d5.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.30729.1_none_e29d1181971ae11e.manifest" 0 `${_f}` Goto `${_t}` lbl_winnt_2003: lbl_winnt_XP: IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e.manifest" 0 `${_f}` IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_405b0943.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.ATL_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_312cf0e9.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.ATL_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_d01483b2.manifest" 0 `${_f}` Goto `${_t}` !macroend !define VCRedist2008IsInstalled `"" VCRedist2008IsInstalled ""` @@ -409,6 +443,42 @@ !macroend +!macro ReadPreviousVersion + Push $R0 + Push $R1 + Push $R2 + Push $R3 + + ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" + ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" + ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" + ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" + ${If} $R0 == "" + ${OrIf} $R1 == "" + ${OrIf} $R2 == "" + ${OrIf} $R3 == "" + StrCpy $PREVIOUS_VERSION "" + ${Else} + StrCpy $PREVIOUS_VERSION $R0.$R1.$R2.$R3 + ${EndIf} + + ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $PREVIOUS_VERSION $R0 + ${If} $R0 == 0 + StrCpy $PREVIOUS_VERSION_STATE "same" + ${ElseIf} $R0 == 1 + StrCpy $PREVIOUS_VERSION_STATE "newer" + ${ElseIf} $R0 == 2 + StrCpy $PREVIOUS_VERSION_STATE "older" + ${Else} + StrCpy $PREVIOUS_VERSION_STATE "" + ${EndIf} + + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 +!macroend + /* ; Section flag test !macro _MPIsInstalled _a _b _t _f @@ -438,21 +508,95 @@ #!define MPIsInstalled `${SF_SELECTED} SectionFlagIsSet` !define MPIsInstalled "!insertmacro _MPIsInstalled" - */ +*/ + +!macro UpdateBackupSections + ${If} ${FileExists} "$MPdir.Base\*.*" + !insertmacro EnableSection "${SecBackupInstDir}" "Installation directory" + ${Else} + !insertmacro DisableSection "${SecBackupInstDir}" "Installation directory" " " + ${EndIf} + + ${If} ${FileExists} "$MPdir.Config\*.*" + !insertmacro EnableSection "${SecBackupConfig}" "Configuration directory" + ${Else} + !insertmacro DisableSection "${SecBackupConfig}" "Configuration directory" " " + ${EndIf} + + ${If} ${FileExists} "$MPdir.Thumbs\*.*" + !insertmacro EnableSection "${SecBackupThumbs}" "Thumbs directory" + ${Else} + !insertmacro DisableSection "${SecBackupThumbs}" "Thumbs directory" " " + ${EndIf} + + ${If} ${SectionIsReadOnly} ${SecBackupInstDir} + ${AndIf} ${SectionIsReadOnly} ${SecBackupConfig} + ${AndIf} ${SectionIsReadOnly} ${SecBackupThumbs} + !insertmacro DisableSection "${SecBackup}" "Backup" " " + ${Else} + !insertmacro EnableSection "${SecBackup}" "Backup" + ${EndIf} +!macroend + + +!macro BackupConfigDir + ${LOG_TEXT} "INFO" "Creating backup of configuration dir" + + ${WordReplace} "$MPdir.Thumbs" "$MPdir.Config\" "" "+" $R1 ; is thumbs a subdir of config? + ${If} "$R1" == "$MPdir.Thumbs" ; no replace >> thumbs is not a subdir of config + ${LOG_TEXT} "INFO" "BackupConfigDir: Thumbs is NOT a subdir of config" + + ${LOG_TEXT} "INFO" "BackupConfigDir: Copying complete config-dir" + CreateDirectory "$MPdir.Config_$R0" + CopyFiles /SILENT "$MPdir.Config\*.*" "$MPdir.Config_$R0" + ${Else} + ${LOG_TEXT} "INFO" "BackupConfigDir: Thumbs is a subdir of config" + + ${LOG_TEXT} "INFO" "BackupConfigDir: Rename thumbs-dir to get it out of config-dir" + Rename "$MPdir.Thumbs" "$MPdir.Config$R0$R1" + + ${LOG_TEXT} "INFO" "BackupConfigDir: Copying complete config-dir" + CreateDirectory "$MPdir.Config_$R0" + CopyFiles /SILENT "$MPdir.Config\*.*" "$MPdir.Config_$R0" + + ${LOG_TEXT} "INFO" "BackupConfigDir: Rename thumbs-dir to get it back in config-dir" + Rename "$MPdir.Config$R0$R1" "$MPdir.Thumbs" + ${EndIf} +!macroend + +!macro BackupThumbsDir + ${LOG_TEXT} "INFO" "Creating backup of thumbs dir" + + ${WordReplace} "$MPdir.Thumbs" "$MPdir.Config\" "" "+" $R1 ; is thumbs a subdir of config? + ${If} "$R1" == "$MPdir.Thumbs" ; no replace >> thumbs is not a subdir of config + ${LOG_TEXT} "INFO" "BackupThumbsDir: Thumbs is NOT a subdir of config" + + ${LOG_TEXT} "INFO" "BackupThumbsDir: Copying complete thumbs-dir" + CreateDirectory "$MPdir.Thumbs_$R0" + CopyFiles /SILENT "$MPdir.Thumbs\*.*" "$MPdir.Thumbs_$R0" + ${Else} + ${LOG_TEXT} "INFO" "BackupThumbsDir: Thumbs is a subdir of config" + + ${LOG_TEXT} "INFO" "BackupThumbsDir: Copying complete thumbs-dir" + CreateDirectory "$MPdir.Config_$R0\$R1" ; create thumbsdir in config-backupdir + CopyFiles /SILENT "$MPdir.Thumbs\*.*" "$MPdir.Config_$R0\$R1" + ${EndIf} +!macroend + + #--------------------------------------------------------------------------- # COMPLETE MEDIAPORTAL CLEANUP #--------------------------------------------------------------------------- !macro CompleteMediaPortalCleanup # make and uninstallation of the other app, which may be still installed -!if "${NAME}" == "MediaPortal" +!if "${PRODUCT_NAME}" == "MediaPortal" !insertmacro NSISuninstall "${TV3_REG_UNINSTALL}" -!else - !if "${NAME}" == "MediaPortal TV Server / Client" - !insertmacro NSISuninstall "${MP_REG_UNINSTALL}" - !endif !endif +!if "${PRODUCT_NAME}" == "MediaPortal TV Server / Client" + !insertmacro NSISuninstall "${MP_REG_UNINSTALL}" +!endif SetShellVarContext all # Delete new MediaPortal ( >= 0.2.3 RC3 ) and TVengine 3 directories @@ -484,9 +628,15 @@ RMDir /r /REBOOTOK "$LOCALAPPDATA\Microsoft\Windows\Start Menu\Programs\MediaPortal" # Remove registry keys +DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" +DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" + DeleteRegKey HKLM "Software\Team MediaPortal" DeleteRegKey HKCU "Software\Team MediaPortal" +DeleteRegKey HKLM "Software\Team MediaPortal" +DeleteRegKey HKCU "Software\Team MediaPortal" + DeleteRegKey HKLM "Software\MediaPortal" DeleteRegKey HKCU "Software\MediaPortal" @@ -542,26 +692,66 @@ ${EndIf} !macroend +!macro RunUninstaller SILENT + ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "UninstallString" + ${If} ${FileExists} "$R0" + +!if "${SILENT}" != "silent" + ; Run uninstaller nonsilent, hide the installer windows + HideWindow +!endif + + ; get installation dir from uninstaller.exe path + ${GetParent} $R0 $R1 + + ; clearerrors, to catch if uninstall fails + ClearErrors + ; copy uninstaller to temp, to make sure uninstaller.exe in instdir is deleted, too + CopyFiles $R0 "$TEMP\uninstall-temp.exe" + + ; launch uninstaller + ${If} $PREVIOUS_VERSION_STATE == "same" + ${AndIf} $EXPRESS_UPDATE == "1" + ExecWait '"$TEMP\uninstall-temp.exe" _?=$R1' + ${Else} + +!if "${SILENT}" != "silent" + ExecWait '"$TEMP\uninstall-temp.exe" /frominstall _?=$R1' +!else + ExecWait '"$TEMP\uninstall-temp.exe" /S _?=$R1' +!endif + + ${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 +!macro MediaPortalOperatingSystemCheck ${LOG_TEXT} "INFO" ".: Operating System Check :." + + !insertmacro GetServicePack $R1 $R2 + ${LOG_TEXT} "INFO" "GetServicePack-Macro:: major: $R1" + ${LOG_TEXT} "INFO" "GetServicePack-Macro:: minor: $R2" + GetVersion::WindowsName Pop $R0 - ${LOG_TEXT} "INFO" "GetVersion::WindowsName: $R0" - !insertmacro GetServicePack $R1 $R2 - ${LOG_TEXT} "INFO" "GetServicePack major: $R1" - ${LOG_TEXT} "INFO" "GetServicePack minor: $R2" + ${LOG_TEXT} "INFO" "GetVersion-Plugin::WindowsName: $R0" ; show error that the OS is not supported and abort the installation - ${If} ${AtMostWin2000Srv} + ${If} ${AtMostWin2000} + ${LOG_TEXT} "INFO" "OSTest::AtMostWin2000" StrCpy $0 "OSabort" + ${ElseIf} ${IsWinXP} + ${LOG_TEXT} "INFO" "OSTest::IsWinXP" !insertmacro GetServicePack $R1 $R2 ${If} $R2 > 0 StrCpy $0 "OSwarnBetaSP" @@ -571,13 +761,18 @@ StrCpy $0 "OSok" ${EndIf} - ${ElseIf} ${IsWinXP64} - StrCpy $0 "OSabort" + ;${ElseIf} ${IsWinXP64} + ${If} ${RunningX64} + ${LOG_TEXT} "INFO" "OSTest::IsWinXP::x64" + StrCpy $0 "OSabort" + ${EndIf} ${ElseIf} ${IsWin2003} + ${LOG_TEXT} "INFO" "OSTest::IsWin2003" StrCpy $0 "OSwarn" ${ElseIf} ${IsWinVISTA} + ${LOG_TEXT} "INFO" "OSTest::IsWinVISTA" !insertmacro GetServicePack $R1 $R2 ${If} $R2 > 0 StrCpy $0 "OSwarnBetaSP" @@ -588,9 +783,11 @@ ${EndIf} ${ElseIf} ${IsWin2008} + ${LOG_TEXT} "INFO" "OSTest::IsWin2008" StrCpy $0 "OSwarn" ${Else} + ${LOG_TEXT} "INFO" "OSTest::unknown OS" StrCpy $0 "OSabort" ${EndIf} @@ -600,15 +797,11 @@ 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} + MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" ${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} + MessageBox MB_YESNO|MB_ICONEXCLAMATION "You are using a beta Service Pack! $(TEXT_MSGBOX_ERROR_WIN_NOT_RECOMMENDED)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" ${Else} ; do nothing ${EndIf} @@ -616,7 +809,7 @@ ${LOG_TEXT} "INFO" "============================" !macroend -!macro MediaPortalAdminCheck HideWarnings +!macro MediaPortalAdminCheck ${LOG_TEXT} "INFO" ".: Administration Rights Check :." ; check if current user is admin @@ -631,14 +824,9 @@ ${LOG_TEXT} "INFO" "============================" !macroend -!macro MediaPortalVCRedistCheck HideWarnings +!macro MediaPortalVCRedistCheck ${LOG_TEXT} "INFO" ".: Microsoft Visual C++ Redistributable Check :." - ; check if VC Redist 2005 SP1 is installed - #${IfNot} ${VCRedist2005IsInstalled} - # MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_VCREDIST_2005)" IDNO +2 - # ExecShell open "${WEB_REQUIREMENTS}" - # Abort ; check if VC Redist 2008 SP1 is installed ${IfNot} ${VCRedist2008IsInstalled} MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_VCREDIST_2008)" IDNO +2 @@ -649,54 +837,101 @@ ${LOG_TEXT} "INFO" "============================" !macroend -!macro MediaPortalNetFrameworkCheck HideWarnings +!macro MediaPortalNetFrameworkCheck ${LOG_TEXT} "INFO" ".: Microsoft .Net Framework Check :." - ; check if .Net Framework 2.0 is installed - ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "Install" - ; check if .Net Framework 2.0 SP2 is installed - ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727" "SP" - ; check if .Net Framework 3.5 is installed - ReadRegDWORD $2 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "Install" + ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "Install" ; check if .Net Framework 3.5 SP1 is installed - ReadRegDWORD $3 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP" + ReadRegDWORD $1 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" "SP" - ${LOG_TEXT} "INFO" ".Net 2.0 installed? $0" - ${LOG_TEXT} "INFO" ".Net 2.0 ServicePack: $1" - ${LOG_TEXT} "INFO" ".Net 3.5 installed? $2" - ${LOG_TEXT} "INFO" ".Net 3.5 ServicePack: $3" + ${LOG_TEXT} "INFO" ".Net 3.5 installed? $0" + ${LOG_TEXT} "INFO" ".Net 3.5 ServicePack: $1" - ${If} ${IsWinVISTA} - ${AndIf} ${RunningX64} ; 3.5 is installed, check for sp1 - ${LOG_TEXT} "INFO" "OS is Vista64, .Net 3.5 is installed." + ${If} $0 != 1 ; if no 3.5 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${ElseIf} $1 < 1 ; if 3.5, but no sp1 + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 + ExecShell open "${WEB_REQUIREMENTS}" + Abort + ${EndIf} - ${If} $3 < 1 ; if 3.5, but no sp1 - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" - Abort - ${EndIf} + ${LOG_TEXT} "INFO" "============================" +!macroend - ${ElseIf} $0 != 1 ; if no 2.0 - ${If} $2 != 1 ; if no 3.5 - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET20)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" - Abort - ${ElseIf} $3 < 1 ; if 3.5, but no sp1 - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" - Abort - ${EndIf} +!if "${PRODUCT_NAME}" == "MediaPortal" - ${ElseIf} $1 < 2 ; if 2.0, but no sp2 - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET20_SP)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" +!macro DoPreInstallChecks + + ; OS and other common initialization checks are done in the following NSIS header file + !insertmacro MediaPortalOperatingSystemCheck + !insertmacro MediaPortalAdminCheck + !insertmacro MediaPortalVCRedistCheck + !insertmacro MediaPortalNetFrameworkCheck + + ; check if old mp 0.2.2 is installed + ${If} ${MP022IsInstalled} + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_MP022)" Abort ${EndIf} - ${LOG_TEXT} "INFO" "============================" + ; check if old mp 0.2.3 RC3 is installed + ${If} ${MP023RC3IsInstalled} + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_MP023RC3)" + Abort + ${EndIf} + + ; check if old mp 0.2.3 is installed. + ${If} ${MP023IsInstalled} + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_MP023)" + Abort + ${EndIf} + + ; check if reboot is required + ${If} ${FileExists} "$MPdir.Base\rebootflag" + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" + Abort + ${EndIf} + !macroend +!endif + +!if "${PRODUCT_NAME}" == "MediaPortal TV Server / Client" + +!macro DoPreInstallChecks + + ; OS and other common initialization checks are done in the following NSIS header file + !insertmacro MediaPortalOperatingSystemCheck + !insertmacro MediaPortalAdminCheck + !insertmacro MediaPortalVCRedistCheck + !insertmacro MediaPortalNetFrameworkCheck + + ; check if old msi based client plugin is installed. + ${If} ${MSI_TVClientIsInstalled} + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_MSI_CLIENT)" + Abort + ${EndIf} + + ; check if old msi based server is installed. + ${If} ${MSI_TVServerIsInstalled} + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_MSI_SERVER)" + Abort + ${EndIf} + + ; check if reboot is required + ${If} ${FileExists} "$INSTDIR\rebootflag" + MessageBox MB_OK|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" + Abort + ${EndIf} + +!macroend + +!endif + + !endif # !___COMMON_MP_MACROS__NSH___ Modified: trunk/plugins/IR Server Suite/setup/languages/English.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-05-31 23:08:00 UTC (rev 2885) +++ trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-06-01 17:42:00 UTC (rev 2886) @@ -2,6 +2,9 @@ !insertmacro LANG_STRING ^UninstallLink "Uninstall $(^Name)" +!insertmacro LANG_STRING TEXT_MP_NOT_INSTALLED "MediaPortal not installed" +!insertmacro LANG_STRING TEXT_TVSERVER_NOT_INSTALLED "TVServer not installed" + !insertmacro LANG_STRING TEXT_MSGBOX_REMOVE_ALL "Do you want to remove your User settings?$\r$\nAttention: This will remove all your customised settings including Skins and Databases." !insertmacro LANG_STRING TEXT_MSGBOX_ERROR_ON_UNINSTALL "An error occured while trying to uninstall old version!$\r$\nDo you still want to continue the installation?" @@ -45,6 +48,7 @@ !insertmacro LANG_STRING TEXT_ADDREMOVE_UPDOWN_OPT1 "Upgrade $(^Name) using previous settings (recommended)" !insertmacro LANG_STRING TEXT_ADDREMOVE_UPDOWN_OPT2 "Change settings (advanced)" + # Strings for ServerServiceMode-Page !insertmacro LANG_STRING ServerServiceModePage_HEADER "Choose the Server/Service Mode" !insertmacro LANG_STRING ServerServiceModePage_HEADER2 "Choose whether you want to use InputService or IRServer" Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-05-31 23:08:00 UTC (rev 2885) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-06-01 17:42:00 UTC (rev 2886) @@ -26,9 +26,7 @@ ;!define svn_InstallScripts "${svn_ROOT_IRSS}\setup\CommonNSIS" !define svn_InstallScripts "." -SetCompressor /SOLID /FINAL lzma - #--------------------------------------------------------------------------- # DEFINES #--------------------------------------------------------------------------- @@ -56,6 +54,8 @@ !define VERSION "Test Build ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}" !endif +SetCompressor /SOLID /FINAL lzma + ; enable logging !define INSTALL_LOG @@ -81,7 +81,7 @@ #--------------------------------------------------------------------------- -# INCLUDES +# INCLUDE FILES #--------------------------------------------------------------------------- !include x64.nsh !include MUI2.nsh @@ -179,13 +179,11 @@ !define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre !insertmacro MUI_PAGE_DIRECTORY -!define MUI_PAGE_CUSTOMFUNCTION_PRE PageInstfilesShow !insertmacro MUI_PAGE_INSTFILES - -;!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishShow !insertmacro MUI_PAGE_FINISH +; UnInstaller Interface !define MUI_PAGE_CUSTOMFUNCTION_PRE un.WelcomePagePre !insertmacro MUI_UNPAGE_WELCOME !define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre @@ -194,11 +192,15 @@ !define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre !insertmacro MUI_UNPAGE_FINISH -# Installer languages + +#--------------------------------------------------------------------------- +# INSTALLER LANGUAGES +#--------------------------------------------------------------------------- !insertmacro LANG_LOAD "English" + #--------------------------------------------------------------------------- -# INSTALLER SETTINGS +# USEFUL MACROS #--------------------------------------------------------------------------- !macro SectionList MacroName ; This macro used to perform operation on multiple sections. @@ -232,41 +234,6 @@ ;====================================== -!macro RunUninstaller SILENT - - ReadRegStr $R0 HKLM "${REG_UNINSTALL}" "UninstallString" - ${If} ${FileExists} "$R0" - -!if "${SILENT}" != "silent" - ; Run uninstaller nonsilent, hide the installer windows - HideWindow -!endif - - ; get installation dir from uninstaller.exe path - ${GetParent} $R0 $R1 - - ; clearerrors, to catch if uninstall fails - ClearErrors - ; copy uninstaller to temp, to make sure uninstaller.exe in instdir is deleted, too - CopyFiles $R0 "$TEMP\uninstall-temp.exe" - - ; launch uninstaller - ${If} $PREVIOUS_VERSION_STATE == "same" - ${AndIf} $EXPRESS_UPDATE == "1" - ExecWait '"$TEMP\uninstall-temp.exe" _?=$R1' - ${Else} - -!if "${SILENT}" != "silent" - ExecWait '"$TEMP\uninstall-temp.exe" /frominstall _?=$R1' -!else - ExecWait '"$TEMP\uninstall-temp.exe" /S _?=$R1' -!endif - - ${EndIf} - - ${EndIf} - -!macroend Function RunUninstaller ; old (un)installers should be called silently @@ -278,13 +245,23 @@ FunctionEnd + +#--------------------------------------------------------------------------- +# SECTIONS and REMOVEMACROS +#--------------------------------------------------------------------------- Section "-prepare" + DetailPrint "Uninstalling old version ..." ; uninstall old version if necessary ${If} ${Silent} !insertmacro RunUninstaller "silent" + ${ElseIf} $EXPRESS_UPDATE != "" + + Call RunUninstaller + BringToFront + ${EndIf} @@ -315,6 +292,8 @@ SetOutPath "$DIR_INSTALL" File "..\Documentation\${PRODUCT_NAME}.chm" + + CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" ; Create app data directories CreateDirectory "$APPDATA\${PRODUCT_NAME}" @@ -1093,26 +1072,25 @@ ${EndIf} SectionEnd + #--------------------------------------------------------------------------- # SOME MACROS AND FUNCTIONS #--------------------------------------------------------------------------- +!macro GetMediaPortalPaths -!macro CheckMediaPortalPaths - ${If} ${RunningX64} SetRegView 32 ${EnableX64FSRedirection} ${Endif} ; Get MediaPortal installation directory ... - ${If} $DIR_MEDIAPORTAL == "" - !insertmacro MP_GET_INSTALL_DIR "$DIR_MEDIAPORTAL" + !insertmacro MP_GET_INSTALL_DIR $DIR_MEDIAPORTAL + ${If} $DIR_MEDIAPORTAL != "" + ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL ${Endif} ; Get MediaPortal TV Server installation directory ... - ${If} $DIR_TVSERVER == "" - !insertmacro TVSERVER_GET_INSTALL_DIR "$DIR_TVSERVER" - ${Endif} + !insertmacro TVSERVER_GET_INSTALL_DIR $DIR_TVSERVER ${If} ${RunningX64} SetRegView 64 @@ -1121,44 +1099,7 @@ !macroend -!macro ReadPreviousVersion - Push $R0 - Push $R1 - Push $R2 - Push $R3 - - ReadRegDWORD $R0 HKLM "${REG_UNINSTALL}" "VersionMajor" - ReadRegDWORD $R1 HKLM "${REG_UNINSTALL}" "VersionMinor" - ReadRegDWORD $R2 HKLM "${REG_UNINSTALL}" "VersionRevision" - ReadRegDWORD $R3 HKLM "${REG_UNINSTALL}" "VersionBuild" - ${If} $R0 == "" - ${OrIf} $R1 == "" - ${OrIf} $R2 == "" - ${OrIf} $R3 == "" - StrCpy $PREVIOUS_VERSION "" - ${Else} - StrCpy $PREVIOUS_VERSION $R0.$R1.$R2.$R3 - ${EndIf} - - ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $PREVIOUS_VERSION $R0 - ${If} $R0 == 0 - StrCpy $PREVIOUS_VERSION_STATE "same" - ${ElseIf} $R0 == 1 - StrCpy $PREVIOUS_VERSION_STATE "newer" - ${ElseIf} $R0 == 2 - StrCpy $PREVIOUS_VERSION_STATE "older" - ${Else} - StrCpy $PREVIOUS_VERSION_STATE "" - ${EndIf} - - Pop $R3 - Pop $R2 - Pop $R1 - Pop $R0 -!macroend - -!macro ReadPreviousSettings - +Function ReadPreviousSettings ${If} ${RunningX64} SetRegView 64 ${DisableX64FSRedirection} @@ -1171,18 +1112,18 @@ ReadRegStr $PREVIOUS_INSTALLDIR HKLM "Software\${PRODUCT_NAME}" "Install_Dir" #ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" #ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" - !insertmacro CheckMediaPortalPaths ; if not installed, path == "" + !insertmacro GetMediaPortalPaths ; if not installed, path == "" ; read previous settings ReadRegStr $PREVIOUS_ServerServiceMode HKLM "${REG_UNINSTALL}" "ServerServiceMode" -!macroend +FunctionEnd Function LoadPreviousSettings ; reset DIR_INSTALL ${If} $PREVIOUS_INSTALLDIR != "" - StrCpy '$DIR_INSTALL' '$PREVIOUS_INSTALLDIR' + StrCpy $DIR_INSTALL "$PREVIOUS_INSTALLDIR" ${Else} - StrCpy '$DIR_INSTALL' '$PROGRAMFILES\${PRODUCT_NAME}' + StrCpy $DIR_INSTALL "$PROGRAMFILES\${PRODUCT_NAME}" ${EndIf} ; reset ServerServiceMode @@ -1193,22 +1134,44 @@ StrCpy $ServerServiceMode "InputService" ${EndIf} + ; reset previous component selection from registry ${MementoSectionRestore} - ; update component selection, according to possible selections - Call .onSelChange + ; set sections, according to possible selections + ${If} "$DIR_MEDIAPORTAL" != "" + !insertmacro EnableSection "${SectionMPControlPlugin}" "MP Control Plugin" + !insertmacro EnableSection "${SectionMPBlastZonePlugin}" "MP Blast Zone Plugin" + ;!insertmacro EnableSection "${SectionTV2BlasterPlugin}" "TV2 Blaster Plugin" + !insertmacro EnableSection "${SectionGroupMP}" "MediaPortal plugins" + ${else} + !insertmacro DisableSection "${SectionMPControlPlugin}" "MP Control Plugin" " " + !insertmacro DisableSection "${SectionMPBlastZonePlugin}" "MP Blast Zone Plugin" " " + ;!insertmacro DisableSection "${SectionTV2BlasterPlugin}" "TV2 Blaster Plugin" " " + !insertmacro DisableSection "${SectionGroupMP}" "MediaPortal plugins" " ($(TEXT_MP_NOT_INSTALLED))" + ${Endif} + + ${If} "$DIR_TVSERVER" != "" + !insertmacro EnableSection "${SectionTV3BlasterPlugin}" "TV Server Blaster Plugin" + !insertmacro EnableSection "${SectionGroupTV3}" "TV Server plugins" + ${else} + !insertmacro DisableSection "${SectionTV3BlasterPlugin}" "TV Server Blaster Plugin" " " + !insertmacro DisableSection "${SectionGroupTV3}" "TV Server plugins" " ($(TEXT_TVSERVER_NOT_INSTALLED))" + ${Endif} + + ; update component selection + Call .onSelChange FunctionEnd + #--------------------------------------------------------------------------- # INSTALLER CALLBACKS #--------------------------------------------------------------------------- Function .onInit ${LOG_OPEN} - !insertmacro ReadPreviousSettings + Call ReadPreviousSettings Call LoadPreviousSettings - ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL FunctionEnd @@ -1318,17 +1281,6 @@ ${EndIf} FunctionEnd -Function PageInstfilesShow - - ${If} $EXPRESS_UPDATE != "" - - Call RunUninstaller - BringToFront - - ${EndIf} - -FunctionEnd - /* Function FinishShow ; This function is called, after the Finish Page creation is finished @@ -1341,22 +1293,20 @@ FunctionEnd */ + #--------------------------------------------------------------------------- # UNINSTALLER CALLBACKS #--------------------------------------------------------------------------- Function un.onInit - !insertmacro ReadPreviousSettings + ReadRegStr $PREVIOUS_INSTALLDIR HKLM "Software\${PRODUCT_NAME}" "Install_Dir" + ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" + ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" ${un.ReadMediaPortalDirs} $DIR_MEDIAPORTAL - ; parse parameters - ClearErrors - ${un.GetParameters} $R0 + ${un.InitCommandlineParameter} + ${un.ReadCommandlineParameter} "frominstall" - ${un.GetOptions} $R0 "/frominstall" $R1 - ${Unless} ${Errors} - StrCpy $frominstall 1 - ${EndUnless} FunctionEnd ;====================================== @@ -1386,6 +1336,7 @@ FunctionEnd + #--------------------------------------------------------------------------- # SECTION DESCRIPTIONS #--------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-06-08 18:19:38
|
Revision: 2905 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2905&view=rev Author: chef_koch Date: 2009-06-08 18:19:27 +0000 (Mon, 08 Jun 2009) Log Message: ----------- installer checks if Translator and TrayLauncher are in AutoRun, If so those will be readded during installation Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh 2009-06-07 23:01:08 UTC (rev 2904) +++ trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh 2009-06-08 18:19:27 UTC (rev 2905) @@ -37,4 +37,16 @@ WriteRegStr ${AutoRunPath} '${name}' '' !macroend +!macro GetAutoRun name variable + ReadRegStr ${variable} ${AutoRunPath} '${name}' +!macroend + +!macro _IsAutoRun _a _b _t _f + !insertmacro _LOGICLIB_TEMP + + !insertmacro GetAutoRun `${_b}` $_LOGICLIB_TEMP + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define IsAutoRun `"" IsAutoRun` + !endif # !IrssSystemRegistry_INCLUDED Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-06-07 23:01:08 UTC (rev 2904) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-06-08 18:19:27 UTC (rev 2905) @@ -81,6 +81,9 @@ Var PREVIOUS_VERSION_STATE Var EXPRESS_UPDATE +Var AutoRunTranslator +Var AutoRunTrayLauncher + Var frominstall @@ -836,6 +839,11 @@ ; create start menu shortcuts CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" "$DIR_INSTALL\Translator\Translator.exe" "" "$DIR_INSTALL\Translator\Translator.exe" 0 + + ; check if Translator is an autorun app + ${If} $AutoRunTranslator == 1 + !insertmacro SetAutoRun "Translator" "$DIR_INSTALL\Translator\Translator.exe" + ${EndIf} ${MementoSectionEnd} !macro Remove_${SectionTranslator} ${LOG_TEXT} "INFO" "Removing Translator..." @@ -864,6 +872,11 @@ ; create start menu shortcuts CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Tray Launcher.lnk" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" "" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" 0 + + ; check if TrayLauncher is an autorun app + ${If} $AutoRunTrayLauncher == 1 + !insertmacro SetAutoRun "Tray Launcher" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" + ${EndIf} ${MementoSectionEnd} !macro Remove_${SectionTrayLauncher} ${LOG_TEXT} "INFO" "Removing Tray Launcher..." @@ -1147,6 +1160,21 @@ ; read previous settings ReadRegStr $PREVIOUS_ServerServiceMode HKLM "${REG_UNINSTALL}" "ServerServiceMode" + + + ; check if Translator is an autorun app + ${If} ${IsAutoRun} "Translator" + StrCpy $AutoRunTranslator 1 + ${Else} + StrCpy $AutoRunTranslator 0 + ${EndIf} + + ; check if TrayLauncher is an autorun app + ${If} ${IsAutoRun} "Tray Launcher" + StrCpy $AutoRunTrayLauncher 1 + ${Else} + StrCpy $AutoRunTrayLauncher 0 + ${EndIf} FunctionEnd Function LoadPreviousSettings This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-06-14 11:30:49
|
Revision: 2917 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2917&view=rev Author: chef_koch Date: 2009-06-14 11:30:47 +0000 (Sun, 14 Jun 2009) Log Message: ----------- updated additional files from mpsvn Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh 2009-06-11 13:20:11 UTC (rev 2916) +++ trunk/plugins/IR Server Suite/setup/include/FileAssociation.nsh 2009-06-14 11:30:47 UTC (rev 2917) @@ -32,7 +32,7 @@ Based on code taken from http://nsis.sourceforge.net/File_Association Usage in script: - 1. !include "FileFunc.nsh" + 1. !include "FileAssociation.nsh" 2. [Section|Function] ${FileAssociationFunction} "Param1" "Param2" "..." $var [SectionEnd|FunctionEnd] @@ -82,39 +82,39 @@ !verbose push !verbose 3 !ifndef _FileAssociation_VERBOSE - !define _FileAssociation_VERBOSE 3 + !define _FileAssociation_VERBOSE 3 !endif !verbose ${_FileAssociation_VERBOSE} !define FileAssociation_VERBOSE `!insertmacro FileAssociation_VERBOSE` !verbose pop !macro FileAssociation_VERBOSE _VERBOSE - !verbose push - !verbose 3 - !undef _FileAssociation_VERBOSE - !define _FileAssociation_VERBOSE ${_VERBOSE} - !verbose pop + !verbose push + !verbose 3 + !undef _FileAssociation_VERBOSE + !define _FileAssociation_VERBOSE ${_VERBOSE} + !verbose pop !macroend !macro RegisterExtensionCall _EXECUTABLE _EXTENSION _DESCRIPTION - !verbose push - !verbose ${_FileAssociation_VERBOSE} - Push `${_EXECUTABLE}` - Push `${_EXTENSION}` - Push `${_DESCRIPTION}` - ${CallArtificialFunction} RegisterExtension_ - !verbose pop + !verbose push + !verbose ${_FileAssociation_VERBOSE} + Push `${_DESCRIPTION}` + Push `${_EXTENSION}` + Push `${_EXECUTABLE}` + ${CallArtificialFunction} RegisterExtension_ + !verbose pop !macroend !macro UnRegisterExtensionCall _EXTENSION _DESCRIPTION - !verbose push - !verbose ${_FileAssociation_VERBOSE} - Push `${_EXTENSION}` - Push `${_DESCRIPTION}` - ${CallArtificialFunction} UnRegisterExtension_ - !verbose pop + !verbose push + !verbose ${_FileAssociation_VERBOSE} + Push `${_EXTENSION}` + Push `${_DESCRIPTION}` + ${CallArtificialFunction} UnRegisterExtension_ + !verbose pop !macroend @@ -132,35 +132,30 @@ !verbose push !verbose ${_FileAssociation_VERBOSE} - Exch $R2 ;desc + Exch $R2 ;exe Exch Exch $R1 ;ext Exch Exch 2 - Exch $R0 ;exe + Exch $R0 ;desc Exch 2 Push $0 Push $1 -!define Index "Line${__LINE__}" - ReadRegStr $1 HKCR $R1 "" - StrCmp $1 "" "${Index}-NoBackup" - StrCmp $1 "OptionsFile" "${Index}-NoBackup" - WriteRegStr HKCR $R1 "backup_val" $1 + ReadRegStr $1 HKCR $R1 "" ; read current file association + StrCmp "$1" "" NoBackup ; is it empty + StrCmp "$1" "$R0" NoBackup ; is it our own + WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value +NoBackup: + WriteRegStr HKCR $R1 "" "$R0" ; set our file association -"${Index}-NoBackup:" - WriteRegStr HKCR $R1 "" $R0 - ReadRegStr $0 HKCR $R0 "" - StrCmp $0 "" 0 "${Index}-Skip" - WriteRegStr HKCR $R0 "" $R0 + WriteRegStr HKCR "$R0" "" "$R0" WriteRegStr HKCR "$R0\shell" "" "open" WriteRegStr HKCR "$R0\DefaultIcon" "" "$R2,0" -"${Index}-Skip:" - WriteRegStr HKCR "$R0\shell\open\command" "" '$R2 "%1"' + WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"' WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0" - WriteRegStr HKCR "$R0\shell\edit\command" "" '$R2 "%1"' -!undef Index + WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"' Pop $1 Pop $0 @@ -193,21 +188,19 @@ Push $0 Push $1 -!define Index "Line${__LINE__}" ReadRegStr $1 HKCR $R0 "" - StrCmp $1 $R1 0 "${Index}-NoOwn" ; only do this if we own it + StrCmp $1 $R1 0 NoOwn ; only do this if we own it ReadRegStr $1 HKCR $R0 "backup_val" - StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key + StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key DeleteRegKey HKCR $R0 - Goto "${Index}-NoOwn" + Goto NoOwn -"${Index}-Restore:" +Restore: WriteRegStr HKCR $R0 "" $1 DeleteRegValue HKCR $R0 "backup_val" DeleteRegKey HKCR $R1 ;Delete key with association name settings -"${Index}-NoOwn:" -!undef Index +NoOwn: Pop $1 Pop $0 Modified: trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh 2009-06-11 13:20:11 UTC (rev 2916) +++ trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh 2009-06-14 11:30:47 UTC (rev 2917) @@ -23,6 +23,9 @@ #endregion +!if "${NSIS_VERSION}" != "v2.45" + !error "$\r$\n$\r$\nPlease update your NSIS installation to latest version. http://nsis.sourceforge.net$\r$\n$\r$\n" +!endif !ifndef ___COMMON_MP_MACROS__NSH___ !define ___COMMON_MP_MACROS__NSH___ @@ -755,7 +758,7 @@ !insertmacro GetServicePack $R1 $R2 ${If} $R2 > 0 StrCpy $0 "OSwarnBetaSP" - ${ElseIf} $R1 < 2 + ${ElseIf} $R1 < 3 StrCpy $0 "OSabort" ${Else} StrCpy $0 "OSok" @@ -786,6 +789,14 @@ ${LOG_TEXT} "INFO" "OSTest::IsWin2008" StrCpy $0 "OSwarn" + ${ElseIf} ${IsWin7} + ${LOG_TEXT} "INFO" "OSTest::IsWin7" + StrCpy $0 "OSok" + + ${ElseIf} ${IsWin2008R2} + ${LOG_TEXT} "INFO" "OSTest::IsWin2008R2" + StrCpy $0 "OSwarn" + ${Else} ${LOG_TEXT} "INFO" "OSTest::unknown OS" StrCpy $0 "OSabort" Modified: trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh 2009-06-11 13:20:11 UTC (rev 2916) +++ trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh 2009-06-14 11:30:47 UTC (rev 2917) @@ -99,8 +99,13 @@ ${LOG_TEXT} "INFO" "RenameDirectory: Old path: ${DirPath}" ${LOG_TEXT} "INFO" "RenameDirectory: New path: ${NewDirPath}" +${If} ${FileExists} "${DirPath}\*.*" + + ${LOG_TEXT} "INFO" "RenameDirectory: Directory exists. Trying to remove if empty." + RMDir "${DirPath}" + ${If} ${FileExists} "${DirPath}\*.*" - ${LOG_TEXT} "INFO" "RenameDirectory: Directory exists. Trying to rename." + ${LOG_TEXT} "INFO" "RenameDirectory: Directory still exists, means it is not empty. Trying to rename." StrCpy $R1 1 ; set counter to 1 ${Do} @@ -122,8 +127,14 @@ ${Loop} ${Else} + ${LOG_TEXT} "INFO" "RenameDirectory: Directory does not exist anymore. No need to rename: ${DirPath}" + ${EndIf} + +${Else} + ${LOG_TEXT} "INFO" "RenameDirectory: Directory does not exist. No need to rename: ${DirPath}" - ${EndIf} + +${EndIf} !macroend Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-06-11 13:20:11 UTC (rev 2916) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-06-14 11:30:47 UTC (rev 2917) @@ -113,8 +113,9 @@ !include "include\ProcessMacros.nsh" !include "include\WinVerEx.nsh" -!include pages\AddRemovePage.nsh -!include pages\ServerServiceMode.nsh +!include "pages\AddRemovePage.nsh" +!include "pages\ServerServiceMode.nsh" +;!include "pages\UninstallModePage.nsh" #--------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-06-20 01:14:36
|
Revision: 2944 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2944&view=rev Author: chef_koch Date: 2009-06-20 00:31:06 +0000 (Sat, 20 Jun 2009) Log Message: ----------- added UninstallModePage.nsh tve2blaster plugin will be removed on installation uuninstallation: removed confirm page Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/languages/English.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/pages/UninstallModePage.nsh Modified: trunk/plugins/IR Server Suite/setup/languages/English.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-06-19 23:38:21 UTC (rev 2943) +++ trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-06-20 00:31:06 UTC (rev 2944) @@ -49,6 +49,20 @@ !insertmacro LANG_STRING TEXT_ADDREMOVE_UPDOWN_OPT2 "Change settings (advanced)" +# Strings for UninstallMode-Page +!insertmacro LANG_STRING TEXT_UNMODE_HEADER "Uninstallation Mode" +!insertmacro LANG_STRING TEXT_UNMODE_HEADER2 "Please choose the mode, you want to do the uninstallation." +!insertmacro LANG_STRING TEXT_UNMODE_OPT0 "Standard Uninstall (recommended)" +!insertmacro LANG_STRING TEXT_UNMODE_OPT1 "Complete Uninstallation for ${PRODUCT_NAME}" +;!insertmacro LANG_STRING TEXT_UNMODE_OPT2 "Full MediaPortal Products cleanup" +!insertmacro LANG_STRING TEXT_UNMODE_OPT0_DESC "Only the main application will be uninstalled. Userfiles and settings won't be deleted (recommended)" +!insertmacro LANG_STRING TEXT_UNMODE_OPT1_DESC "This will uninstall ${PRODUCT_NAME} and remove all userfiles" +;!insertmacro LANG_STRING TEXT_UNMODE_OPT2_DESC "This will also remove all files, folders, databases, settings and registry keys which might be leftovers from older MediaPortal versions." +!insertmacro LANG_STRING TEXT_UNMODE_OPT1_MSGBOX "Are you sure that you want to do a Complete Uninstallation? This can not be undone!" +;!insertmacro LANG_STRING TEXT_UNMODE_OPT2_MSGBOX "Are you sure that you want to do a Full MediaPortal Products cleanup? This can not be undone!" + + + # Strings for ServerServiceMode-Page !insertmacro LANG_STRING ServerServiceModePage_HEADER "Choose the Server/Service Mode" !insertmacro LANG_STRING ServerServiceModePage_HEADER2 "Choose whether you want to use InputService or IRServer" Added: trunk/plugins/IR Server Suite/setup/pages/UninstallModePage.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/UninstallModePage.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/pages/UninstallModePage.nsh 2009-06-20 00:31:06 UTC (rev 2944) @@ -0,0 +1,113 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + +/* +_____________________________________________________________________________ + + UninstallModePage +_____________________________________________________________________________ +*/ + +!ifndef UninstallModePage_INCLUDED +!define UninstallModePage_INCLUDED + + +Var UnInstallMode +Var uninstModePage.optBtn0 +Var uninstModePage.optBtn0.state +Var uninstModePage.optBtn1 +Var uninstModePage.optBtn1.state +;Var uninstModePage.optBtn2 +;Var uninstModePage.optBtn2.state + +Function un.UninstallModePage + ${If} $frominstall == 1 + StrCpy $UnInstallMode 0 + Abort + ${EndIf} + + !insertmacro MUI_HEADER_TEXT "$(TEXT_UNMODE_HEADER)" "$(TEXT_UNMODE_HEADER2)" + + nsDialogs::Create /NOUNLOAD 1018 + + ;${NSD_CreateLabel} 0 0 100% 24u "$(TEXT_UNMODE_INFO)" + ;Pop $R1 + + + ${NSD_CreateRadioButton} 20u 20u -20u 8u "$(TEXT_UNMODE_OPT0)" + Pop $uninstModePage.optBtn0 + ${NSD_OnClick} $uninstModePage.optBtn0 un.UninstallModePageUpdateSelection + + ${NSD_CreateLabel} 30u 30u -30u 24u "$(TEXT_UNMODE_OPT0_DESC)" + + + ${NSD_CreateRadioButton} 20u 60u -20u 8u "$(TEXT_UNMODE_OPT1)" + Pop $uninstModePage.optBtn1 + ${NSD_OnClick} $uninstModePage.optBtn1 un.UninstallModePageUpdateSelection + + ${NSD_CreateLabel} 30u 70u -30u 24u "$(TEXT_UNMODE_OPT1_DESC)" + + + ;${NSD_CreateRadioButton} 20u 100u -20u 8u "$(TEXT_UNMODE_OPT2)" + ;Pop $uninstModePage.optBtn2 + ;${NSD_OnClick} $uninstModePage.optBtn2 un.UninstallModePageUpdateSelection + + ;${NSD_CreateLabel} 30u 110u -30u 24u "$(TEXT_UNMODE_OPT2_DESC)" + + + SendMessage $uninstModePage.optBtn0 ${BM_SETCHECK} ${BST_CHECKED} 0 + + nsDialogs::Show +FunctionEnd + +Function un.UninstallModePageUpdateSelection + + ${NSD_GetState} $uninstModePage.optBtn0 $uninstModePage.optBtn0.state + ${NSD_GetState} $uninstModePage.optBtn1 $uninstModePage.optBtn1.state + ;${NSD_GetState} $uninstModePage.optBtn2 $uninstModePage.optBtn2.state + + ${If} $uninstModePage.optBtn1.state == ${BST_CHECKED} + StrCpy $UnInstallMode 1 + ;${ElseIf} $uninstModePage.optBtn2.state == ${BST_CHECKED} + ; StrCpy $UnInstallMode 2 + ${Else} + StrCpy $UnInstallMode 0 + ${EndIf} + +FunctionEnd + +Function un.UninstallModePageLeave + + ${If} $UnInstallMode == 1 + MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 "$(TEXT_UNMODE_OPT1_MSGBOX)" IDYES +2 + Abort + ;${ElseIf} $UnInstallMode == 2 + ; MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 "$(TEXT_UNMODE_OPT2_MSGBOX)" IDYES +2 + ; Abort + ${EndIf} + +FunctionEnd + +!endif # UninstallModePage_INCLUDED Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-06-19 23:38:21 UTC (rev 2943) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-06-20 00:31:06 UTC (rev 2944) @@ -115,7 +115,7 @@ !include "pages\AddRemovePage.nsh" !include "pages\ServerServiceMode.nsh" -;!include "pages\UninstallModePage.nsh" +!include "pages\UninstallModePage.nsh" #--------------------------------------------------------------------------- @@ -206,8 +206,9 @@ ; UnInstaller Interface !define MUI_PAGE_CUSTOMFUNCTION_PRE un.WelcomePagePre !insertmacro MUI_UNPAGE_WELCOME -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre -!insertmacro MUI_UNPAGE_CONFIRM +UninstPage custom un.UninstallModePage un.UninstallModePageLeave +;!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre +;!insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre !insertmacro MUI_UNPAGE_FINISH @@ -1025,6 +1026,9 @@ !insertmacro StartTVService !endif + ; removing tve2 blaster + Delete "$MPdir.Plugins\Process\TV2BlasterPlugin.dll" + ; Use the all users context SetShellVarContext all @@ -1114,7 +1118,13 @@ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" DeleteRegKey HKLM "Software\${PRODUCT_NAME}" + ${If} $UnInstallMode == 1 + ${LOG_TEXT} "INFO" "Removing User Settings" + RMDir /r "$APPDATA\${PRODUCT_NAME}" + + ${EndIf} + ${If} $frominstall == 1 Quit ${EndIf} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-07-13 17:59:32
|
Revision: 3009 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3009&view=rev Author: chemelli_sf Date: 2009-07-13 17:59:29 +0000 (Mon, 13 Jul 2009) Log Message: ----------- Update NSIS to store x86 registry keys (thx Ronilse for testing) NOTE: Old script is saved to do a quick rollback in case of need :P Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-07-12 23:24:56 UTC (rev 3008) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-07-13 17:59:29 UTC (rev 3009) @@ -90,7 +90,6 @@ #--------------------------------------------------------------------------- # INCLUDE FILES #--------------------------------------------------------------------------- -!include x64.nsh !include MUI2.nsh !include Sections.nsh !include LogicLib.nsh @@ -1130,11 +1129,6 @@ !ifdef MPplugins !macro GetMediaPortalPaths - ${If} ${RunningX64} - SetRegView 32 - ${EnableX64FSRedirection} - ${Endif} - ; Get MediaPortal installation directory ... !insertmacro MP_GET_INSTALL_DIR $DIR_MEDIAPORTAL ${If} $DIR_MEDIAPORTAL != "" @@ -1144,19 +1138,10 @@ ; Get MediaPortal TV Server installation directory ... !insertmacro TVSERVER_GET_INSTALL_DIR $DIR_TVSERVER - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} - -!macroend + !macroend !endif Function ReadPreviousSettings - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} ; read and analyze previous version !insertmacro ReadPreviousVersion @@ -1372,10 +1357,6 @@ # UNINSTALLER CALLBACKS #--------------------------------------------------------------------------- Function un.onInit - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" !ifdef MPplugins Added: trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi (rev 0) +++ trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi 2009-07-13 17:59:29 UTC (rev 3009) @@ -0,0 +1,1446 @@ +;====================================== +; IR Server Suite.nsi +; +; (C) Copyright Aaron Dinnage, 2008 +;====================================== + + +#--------------------------------------------------------------------------- +# 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 "." + +!define svn_MPplugins "..\MediaPortal Plugins" + + +#--------------------------------------------------------------------------- +# 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" + +!define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" +!define MEMENTO_REGISTRY_ROOT HKLM +!define MEMENTO_REGISTRY_KEY "${REG_UNINSTALL}" +!define COMMON_APPDATA "$APPDATA\${PRODUCT_NAME}" + +; VER_BUILD is set to zero for Release builds +!define VER_MAJOR 1 +!define VER_MINOR 4 +!define VER_REVISION 2 + +!ifndef VER_BUILD + !define VER_BUILD 0 +!endif + +!if ${VER_BUILD} == 0 # it's a stable release + !define VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}" +!else # it's an svn release + !define VERSION "Test Build ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}" +!endif + +SetCompressor /SOLID /FINAL lzma + +; enable logging +!define INSTALL_LOG + +; to use default path to logfile, COMMON_APPDATA has to be defined +; default logfile is: "${COMMON_APPDATA}\Logs\install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}.log" +; if you want to set custom path to logfile, uncomment the following line +#!define INSTALL_LOG_FILE "$DESKTOP\install_$(^Name).log" + + +#--------------------------------------------------------------------------- +# VARIABLES +#--------------------------------------------------------------------------- +Var DIR_INSTALL +!ifdef MPplugins +Var DIR_MEDIAPORTAL +Var DIR_TVSERVER +!endif + +Var PREVIOUS_INSTALLDIR +Var PREVIOUS_VERSION +Var PREVIOUS_VERSION_STATE +Var EXPRESS_UPDATE + +Var AutoRunTranslator +Var AutoRunTrayLauncher + +Var frominstall + + +#--------------------------------------------------------------------------- +# INCLUDE FILES +#--------------------------------------------------------------------------- +!include x64.nsh +!include MUI2.nsh +!include Sections.nsh +!include LogicLib.nsh +!include Library.nsh +!include FileFunc.nsh +!include Memento.nsh +!include WinVer.nsh + + + +!include "include\DumpLog.nsh" +;!include "include\FileAssociation.nsh" +!include "include\IrssSystemRegistry.nsh" +!include "include\LanguageMacros.nsh" +!include "include\LoggingMacros.nsh" +!ifdef MPplugins +!include "include\MediaPortalDirectories.nsh" +!endif +!include "include\MediaPortalMacros.nsh" +!include "include\ProcessMacros.nsh" +!include "include\WinVerEx.nsh" + +!include "pages\AddRemovePage.nsh" +!include "pages\ServerServiceMode.nsh" +!include "pages\UninstallModePage.nsh" + + +#--------------------------------------------------------------------------- +# INSTALLER ATTRIBUTES +#--------------------------------------------------------------------------- +Name "${PRODUCT_NAME}" +OutFile "..\${PRODUCT_NAME} - ${VERSION}.exe" +InstallDir "" + +ShowInstDetails show +ShowUninstDetails show +CRCCheck On + +BrandingText "${PRODUCT_NAME} - ${VERSION} by ${PRODUCT_PUBLISHER}" + + +#--------------------------------------------------------------------------- +# INSTALLER INTERFACE settings +#--------------------------------------------------------------------------- +!define MUI_ABORTWARNING +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico" +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico" + +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "images\header.bmp" +!if ${VER_BUILD} == 0 + !define MUI_WELCOMEFINISHPAGE_BITMAP "images\wizard.bmp" + !define MUI_UNWELCOMEFINISHPAGE_BITMAP "images\wizard.bmp" +!else + !define MUI_WELCOMEFINISHPAGE_BITMAP "images\wizard-svn.bmp" + !define MUI_UNWELCOMEFINISHPAGE_BITMAP "images\wizard-svn.bmp" +!endif +!define MUI_HEADERIMAGE_RIGHT + +!define MUI_COMPONENTSPAGE_SMALLDESC +!define MUI_FINISHPAGE_NOAUTOCLOSE +;!define MUI_FINISHPAGE_RUN_NOTCHECKED +;!define MUI_FINISHPAGE_RUN "$DIR_INSTALL\Input Service Configuration\Input Service Configuration.exe" +;!define MUI_FINISHPAGE_RUN_TEXT "Run Input Service Configuration" + +!define MUI_UNFINISHPAGE_NOAUTOCLOSE + + +#--------------------------------------------------------------------------- +# INSTALLER INTERFACE +#--------------------------------------------------------------------------- +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "..\IR Server Suite\Documentation\LICENSE.GPL" + +Page custom PageReinstallMode PageLeaveReinstallMode + +!define MUI_PAGE_CUSTOMFUNCTION_PRE PageComponentsPre +!insertmacro MUI_PAGE_COMPONENTS + +Page custom PageServerServiceMode PageLeaveServerServiceMode + +/* +; MediaPortal install path +!define MUI_PAGE_HEADER_TEXT "Choose MediaPortal Location" +!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install MediaPortal plugins." +!define MUI_DIRECTORYPAGE_TEXT_TOP "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 Next to continue." +!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "MediaPortal Folder" +!define MUI_DIRECTORYPAGE_VARIABLE "$DIR_MEDIAPORTAL" +!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreMP +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveMP +!insertmacro MUI_PAGE_DIRECTORY + +; TV Server install path +!define MUI_PAGE_HEADER_TEXT "Choose TV Server Location" +!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install TV Server plugins." +!define MUI_DIRECTORYPAGE_TEXT_TOP "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 Next to continue." +!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "TV Server Folder" +!define MUI_DIRECTORYPAGE_VARIABLE "$DIR_TVSERVER" +!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreTV +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveTV +!insertmacro MUI_PAGE_DIRECTORY +*/ + +; Main app install path +!define MUI_DIRECTORYPAGE_VARIABLE "$DIR_INSTALL" +!define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre +!insertmacro MUI_PAGE_DIRECTORY + +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + + +; UnInstaller Interface +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.WelcomePagePre +!insertmacro MUI_UNPAGE_WELCOME +UninstPage custom un.UninstallModePage un.UninstallModePageLeave +;!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre +;!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre +!insertmacro MUI_UNPAGE_FINISH + + +#--------------------------------------------------------------------------- +# INSTALLER LANGUAGES +#--------------------------------------------------------------------------- +!insertmacro LANG_LOAD "English" + + +#--------------------------------------------------------------------------- +# USEFUL MACROS +#--------------------------------------------------------------------------- +!macro SectionList MacroName + ; This macro used to perform operation on multiple sections. + ; List all of your components in following manner here. + !insertmacro "${MacroName}" "SectionInputService" + +!ifdef MPplugins + !insertmacro "${MacroName}" "SectionMPCommon" + !insertmacro "${MacroName}" "SectionMPControlPlugin" + !insertmacro "${MacroName}" "SectionMPBlastZonePlugin" +; !insertmacro "${MacroName}" "SectionTV2BlasterPlugin" + + !insertmacro "${MacroName}" "SectionTV3Common" + !insertmacro "${MacroName}" "SectionTV3BlasterPlugin" + +; !insertmacro "${MacroName}" "SectionMCEBlaster" +!endif + + #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}" "SectionDboxTuner" + !insertmacro "${MacroName}" "SectionHcwPvrTuner" +!macroend + +;====================================== + +Function RunUninstaller + + ; old (un)installers should be called silently + ${If} $PREVIOUS_VERSION == "" + !insertmacro RunUninstaller "silent" + ${Else} + !insertmacro RunUninstaller "NoSilent" + ${EndIf} + +FunctionEnd + + +#--------------------------------------------------------------------------- +# SECTIONS and REMOVEMACROS +#--------------------------------------------------------------------------- +Section "-prepare" + DetailPrint "Uninstalling old version ..." + + ; uninstall old version if necessary + ${If} ${Silent} + + !insertmacro RunUninstaller "silent" + + ${ElseIf} $EXPRESS_UPDATE != "" + + Call RunUninstaller + BringToFront + + ${EndIf} + + +/* OBSOLETE since irss is uninstalled before + DetailPrint "Preparing to install ..." + + 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 + SetOverwrite on + + + ; Create app data directories + SetOutPath "$DIR_INSTALL" + ;File "..\IR Server Suite\Documentation\${PRODUCT_NAME}.chm" + + + CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" + + ; Create app data directories + 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 "..\IR Server Suite\Set Top Boxes\*.*" + SetOverwrite on + + +SectionEnd + +;====================================== + +${MementoSection} "Input Service" SectionInputService + ${LOG_TEXT} "INFO" "Installing Input Service..." + ${StopService} "Input Service" + ${KILLPROCESS} "IRServer.exe" + ${KILLPROCESS} "Input Service Configuration.exe" + + ; Use the all users context + SetShellVarContext all + + + ;not needed anymore since uninstall is launched before + ;${LOG_TEXT} "INFO" "Removing current IRServer from Autostart..." + ;!insertmacro RemoveAutoRun "IR Server" + ;${LOG_TEXT} "INFO" "Uninstalling current InputService..." + ;ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /uninstall' + + + ${LOG_TEXT} "INFO" "Installing Input Service..." + SetOutPath "$DIR_INSTALL\Input Service" + File "..\IR Server Suite\Input Service\Input Service\bin\${Build_Type}\*.*" + + ${LOG_TEXT} "INFO" "Installing Input Service Configuration..." + SetOutPath "$DIR_INSTALL\Input Service Configuration" + File "..\IR Server Suite\Input Service\Input Service Configuration\bin\${Build_Type}\*.*" + + ${LOG_TEXT} "INFO" "Installing IR Server..." + SetOutPath "$DIR_INSTALL\Input Service" + File "..\IR Server Suite\Applications\IR Server\bin\${Build_Type}\*.*" + + + ${LOG_TEXT} "INFO" "Installing IR Server Plugins..." + SetOutPath "$DIR_INSTALL\IR Server Plugins" + + File "..\IR Server Suite\IR Server Plugins\Ads Tech PTV-335 Receiver\bin\${Build_Type}\Ads Tech PTV-335 Receiver.*" + File "..\IR Server Suite\IR Server Plugins\CoolCommand Receiver\bin\${Build_Type}\CoolCommand Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Custom HID Receiver\bin\${Build_Type}\Custom HID Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Direct Input Receiver\bin\${Build_Type}\Direct Input Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Direct Input Receiver\bin\${Build_Type}\Microsoft.DirectX.DirectInput.dll" + File "..\IR Server Suite\IR Server Plugins\Direct Input Receiver\bin\${Build_Type}\Microsoft.DirectX.dll" + File "..\IR Server Suite\IR Server Plugins\FusionRemote Receiver\bin\${Build_Type}\FusionRemote Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Girder Plugin\bin\${Build_Type}\Girder Plugin.*" + File "..\IR Server Suite\IR Server Plugins\HCW Receiver\bin\${Build_Type}\HCW Receiver.*" + File "..\IR Server Suite\IR Server Plugins\IgorPlug Receiver\bin\${Build_Type}\IgorPlug Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Imon USB Receivers\bin\${Build_Type}\Imon USB Receivers.*" + ;File "..\IR Server Suite\IR Server Plugins\IR501 Receiver\bin\${Build_Type}\IR501 Receiver.*" + File "..\IR Server Suite\IR Server Plugins\IR507 Receiver\bin\${Build_Type}\IR507 Receiver.*" + ;File "..\IR Server Suite\IR Server Plugins\Ira Transceiver\bin\${Build_Type}\Ira Transceiver.*" + File "..\IR Server Suite\IR Server Plugins\IRMan Receiver\bin\${Build_Type}\IRMan Receiver.*" + File "..\IR Server Suite\IR Server Plugins\IRTrans Transceiver\bin\${Build_Type}\IRTrans Transceiver.*" + ;File "..\IR Server Suite\IR Server Plugins\Keyboard Input\bin\${Build_Type}\Keyboard Input.*" + File "..\IR Server Suite\IR Server Plugins\LiveDrive Receiver\bin\${Build_Type}\LiveDrive Receiver.*" + File "..\IR Server Suite\IR Server Plugins\MacMini Receiver\bin\${Build_Type}\MacMini Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Microsoft MCE Transceiver\bin\${Build_Type}\Microsoft MCE Transceiver.*" + File "..\IR Server Suite\IR Server Plugins\Pinnacle Serial Receiver\bin\${Build_Type}\Pinnacle Serial Receiver.*" + ;File "..\IR Server Suite\IR Server Plugins\RC102 Receiver\bin\${Build_Type}\RC102 Receiver.*" + File "..\IR Server Suite\IR Server Plugins\RedEye Blaster\bin\${Build_Type}\RedEye Blaster.*" + File "..\IR Server Suite\IR Server Plugins\Serial IR Blaster\bin\${Build_Type}\Serial IR Blaster.*" + ;File "..\IR Server Suite\IR Server Plugins\Speech Receiver\bin\${Build_Type}\Speech Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Technotrend Receiver\bin\${Build_Type}\Technotrend Receiver.*" + File "..\IR Server Suite\IR Server Plugins\Technotrend Receiver\bin\${Build_Type}\ttBdaDrvApi_Dll.dll" + ;File "..\IR Server Suite\IR Server Plugins\Tira Transceiver\bin\${Build_Type}\Tira Transceiver.*" + File "..\IR Server Suite\IR Server Plugins\USB-UIRT Transceiver\bin\${Build_Type}\USB-UIRT Transceiver.*" + File "..\IR Server Suite\IR Server Plugins\Wii Remote Receiver\bin\${Build_Type}\Wii Remote Receiver.*" + File "..\IR Server Suite\IR Server Plugins\WiimoteLib\bin\${Build_Type}\WiimoteLib.*" + File "..\IR Server Suite\IR Server Plugins\Windows Message Receiver\bin\${Build_Type}\Windows Message Receiver.*" + File "..\IR Server Suite\IR Server Plugins\WinLirc Transceiver\bin\${Build_Type}\WinLirc Transceiver.*" + File "..\IR Server Suite\IR Server Plugins\X10 Transceiver\bin\${Build_Type}\X10 Transceiver.*" + File "..\IR Server Suite\IR Server Plugins\X10 Transceiver\bin\${Build_Type}\Interop.X10.dll" + File "..\IR Server Suite\IR Server Plugins\XBCDRC Receiver\bin\${Build_Type}\XBCDRC Receiver.*" + + ; Create App Data Folder for IR Server configuration files + CreateDirectory "$APPDATA\${PRODUCT_NAME}\Input Service" + + ; Copy Abstract Remote maps + SetOutPath "$APPDATA\${PRODUCT_NAME}\Input Service\Abstract Remote Maps" + SetOverwrite ifnewer + File /r /x .svn "..\IR Server Suite\Input Service\Input Service\Abstract Remote Maps\*.*" + File "..\IR Server Suite\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 + + ; Install Server/Service + ${If} $ServerServiceMode == "IRServer" + ${LOG_TEXT} "INFO" "Adding IRServer to Autostart..." + !insertmacro SetAutoRun "IR Server" "$DIR_INSTALL\Input Service\IRServer.exe" + ${Else} + ${LOG_TEXT} "INFO" "Installing InputService..." + ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /install' + ${EndIf} + +${MementoSectionEnd} +!macro Remove_${SectionInputService} + ${LOG_TEXT} "INFO" "Removing Input Service..." + ${StopService} "Input Service" + ${KILLPROCESS} "IRServer.exe" + ${KILLPROCESS} "Input Service Configuration.exe" + + ${LOG_TEXT} "INFO" "Removing IRServer from Autostart..." + !insertmacro RemoveAutoRun "IR Server" + ${LOG_TEXT} "INFO" "Uninstalling InputService..." + ExecWait '"$DIR_INSTALL\Input Service\Input Service.exe" /uninstall' + + ; 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 + +;====================================== + +!ifdef MPplugins + +SectionGroup "MediaPortal plugins" SectionGroupMP + +Section "-commonMP" SectionMPCommon + ${LOG_TEXT} "INFO" "Installing common files for MediaPortal plugins..." + ${KILLPROCESS} "MediaPortal.exe" + ${KILLPROCESS} "configuration.exe" + + ; Write plugin dll + SetOutPath "$MPdir.Plugins\Process" + File "..\MediaPortal Plugins\Common\MPUtils\bin\${Build_Type}\MPUtils.*" + File "..\IR Server Suite\Common\IrssComms\bin\${Build_Type}\IrssComms.*" + File "..\IR Server Suite\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" + + ; Write plugin dll + SetOutPath "$MPdir.Plugins\Windows" + File "..\MediaPortal Plugins\Common\MPUtils\bin\${Build_Type}\MPUtils.*" + File "..\IR Server Suite\Common\IrssComms\bin\${Build_Type}\IrssComms.*" + File "..\IR Server Suite\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" +SectionEnd +!macro Remove_${SectionMPCommon} + ${LOG_TEXT} "INFO" "Removing common files for MediaPortal plugins..." + ${KILLPROCESS} "MediaPortal.exe" + ${KILLPROCESS} "configuration.exe" + + ; remove files + Delete /REBOOTOK "$MPdir.Plugins\Process\MPUtils.*" + Delete /REBOOTOK "$MPdir.Plugins\Process\IrssComms.*" + Delete /REBOOTOK "$MPdir.Plugins\Process\IrssUtils.*" + Delete /REBOOTOK "$MPdir.Plugins\Windows\MPUtils.*" + Delete /REBOOTOK "$MPdir.Plugins\Windows\IrssComms.*" + Delete /REBOOTOK "$MPdir.Plugins\Windows\IrssUtils.*" +!macroend + +;====================================== + +${MementoSection} "MP Control Plugin" SectionMPControlPlugin + ${LOG_TEXT} "INFO" "Installing MP Control Plugin..." + + ; Write plugin dll + SetOutPath "$MPdir.Plugins\Process" + File "..\MediaPortal Plugins\MediaPortal Plugins\MP Control Plugin\bin\${Build_Type}\MPControlPlugin.*" + + ; Write input mapping + SetOutPath "$MPdir.CustomInputDefault" + File "..\MediaPortal Plugins\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\MediaPortal Plugins\MP Control Plugin\AppData\*.*" + SetOverwrite on + + ; Create Macro folder + CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Control Plugin\Macro" + +${MementoSectionEnd} +!macro Remove_${SectionMPControlPlugin} + ${LOG_TEXT} "INFO" "MP Control Plugin..." + + Delete /REBOOTOK "$MPdir.Plugins\Process\MPControlPlugin.*" +!macroend + +;====================================== + +${MementoUnselectedSection} "MP Blast Zone Plugin" SectionMPBlastZonePlugin + ${LOG_TEXT} "INFO" "Installing MP Blast Zone Plugin..." + + ; Use the all users context + SetShellVarContext all + + ; Write plugin dll + SetOutPath "$MPdir.Plugins\Windows" + File "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\bin\${Build_Type}\MPBlastZonePlugin.*" + + ; Write app data + CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin" + SetOutPath "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin" + SetOverwrite off + File "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\AppData\Menu.xml" + SetOverwrite on + + ; Write skin files + SetOutPath "$MPdir.Skin\Blue3" + File /r /x .svn "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" + + SetOutPath "$MPdir.Skin\Blue3wide" + File /r /x .svn "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" + + ; Create Macro folder + CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin\Macro" + +${MementoSectionEnd} +!macro Remove_${SectionMPBlastZonePlugin} + ${LOG_TEXT} "INFO" "Removing MP Blast Zone Plugin..." + + Delete /REBOOTOK "$MPdir.Plugins\Windows\MPBlastZonePlugin.*" +!macroend + +;====================================== +/* +${MementoUnselectedSection} "TV2 Blaster Plugin" SectionTV2BlasterPlugin + ${LOG_TEXT} "INFO" "Installing TV2 Blaster Plugin..." + + ; Write plugin dll + SetOutPath "$MPdir.Plugins\Process" + File "..\MediaPortal Plugins\MediaPortal Plugins\TV2 Blaster Plugin\bin\${Build_Type}\TV2BlasterPlugin.*" + + ; Create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV2 Blaster Plugin" + CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV2 Blaster Plugin\Macro" + +${MementoSectionEnd} +!macro Remove_${SectionTV2BlasterPlugin} + ${LOG_TEXT} "INFO" "Removing TV2 Blaster Plugin..." + + Delete /REBOOTOK "$MPdir.Plugins\Process\TV2BlasterPlugin.*" +!macroend +;====================================== +*/ + +SectionGroupEnd + +;====================================== + +Var RestartTvService +!macro StopTVService + ${If} $RestartTvService != 0 + + ; 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" + + ${EndIf} +!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 + +SectionGroup "TV Server plugins" SectionGroupTV3 + +Section "-commonTV3" SectionTV3Common + ${LOG_TEXT} "INFO" "Installing common files for TV Server plugins..." + !insertmacro StopTVService + + ; Write plugin dll + SetOutPath "$DIR_TVSERVER\Plugins" + File "..\MediaPortal Plugins\Common\MPUtils\bin\${Build_Type}\MPUtils.*" + File "..\IR Server Suite\Common\IrssComms\bin\${Build_Type}\IrssComms.*" + File "..\IR Server Suite\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" +SectionEnd +!macro Remove_${SectionTV3Common} + ${If} ${FileExists} "$DIR_TVSERVER\Plugins\MPUtils.*" + ${OrIf} ${FileExists} "$DIR_TVSERVER\Plugins\IrssComms.*" + ${OrIf} ${FileExists} "$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} "TV Server Blaster Plugin" SectionTV3BlasterPlugin + ${LOG_TEXT} "INFO" "Installing TV Server Blaster Plugin..." + + ; Write plugin dll + SetOutPath "$DIR_TVSERVER\Plugins" + File "..\MediaPortal Plugins\TVServer plugins\TV3 Blaster Plugin\bin\${Build_Type}\TV3BlasterPlugin.*" + + ; Create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV3 Blaster Plugin" + CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV3 Blaster Plugin\Macro" + +${MementoSectionEnd} +!macro Remove_${SectionTV3BlasterPlugin} + ${If} ${FileExists} "$DIR_TVSERVER\Plugins\MPUtils.*" + + ${LOG_TEXT} "INFO" "Removing TV Server Blaster Plugin..." + !insertmacro StopTVService + + Delete /REBOOTOK "$DIR_TVSERVER\Plugins\TV3BlasterPlugin.*" + + ${EndIf} +!macroend + +;====================================== + +SectionGroupEnd + +;====================================== +/* +SectionGroup /e "Media Center add-ons" SectionGroupMCE + +${MementoUnselectedSection} "Media Center Blaster (experimental)" SectionMCEBlaster + ${LOG_TEXT} "INFO" "Installing MediaCenterBlaster..." + ${KILLPROCESS} "MediaCenterBlaster.exe" + + ; Use the all users context + SetShellVarContext all + + ; Installing Translator + CreateDirectory "$DIR_INSTALL\Media Center Blaster" + SetOutPath "$DIR_INSTALL\Media Center Blaster" + File "..\IR Server Suite\Applications\Media Center Blaster\bin\${Build_Type}\*.*" + + ; Create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\Media Center Blaster" + CreateDirectory "$APPDATA\${PRODUCT_NAME}\Media Center Blaster\Macro" + + ; Create start menu shortcut + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Media Center Blaster.lnk" "$DIR_INSTALL\Media Center Blaster\MediaCenterBlaster.exe" "" "$DIR_INSTALL\Media Center Blaster\MediaCenterBlaster.exe" 0 + +${MementoSectionEnd} +!macro Remove_${SectionMCEBlaster} + ${LOG_TEXT} "INFO" "Removing MediaCenterBlaster..." + ${KILLPROCESS} "MediaCenterBlaster.exe" + + ; Remove auto-run + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Media Center Blaster" + + ; remove Start Menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Media Center Blaster.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Media Center Blaster" +!macroend + +;====================================== + +SectionGroupEnd + +;====================================== +*/ + +!endif + +SectionGroup "Tools" SectionGroupTools +/* +${MementoSection} "Abstractor" SectionAbstractor + ${LOG_TEXT} "INFO" "Installing Abstractor..." + ${KILLPROCESS} "Abstractor.exe" + + ; install files + SetOutPath "$DIR_INSTALL\Abstractor" + File "..\IR Server Suite\Applications\Abstractor\bin\${Build_Type}\*.*" + + ; create start menu shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Abstractor.lnk" "$DIR_INSTALL\Abstractor\Abstractor.exe" "" "$DIR_INSTALL\Abstractor\Abstractor.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 "..\IR Server Suite\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 "..\IR Server Suite\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 File Tool\IRFileTool.exe" 0 + +${MementoSectionEnd} +!macro Remove_${SectionIRFileTool} + ${LOG_TEXT} "INFO" "Removing IR File Tool..." + ${KILLPROCESS} "IRFileTool.exe" + + ; remove start menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\IR File Tool.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\IR File Tool" +!macroend + +;====================================== + +${MementoSection} "Keyboard Input Relay" SectionKeyboardInputRelay + ${LOG_TEXT} "INFO" "Installing Keyboard Input Relay..." + ${KILLPROCESS} "KeyboardInputRelay.exe" + + ; install files + SetOutPath "$DIR_INSTALL\Keyboard Input Relay" + File "..\IR Server Suite\Applications\Keyboard Input Relay\bin\${Build_Type}\*.*" + + ; create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\Keyboard Input Relay" + + ; create start menu shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Keyboard Input Relay.lnk" "$DIR_INSTALL\Keyboard Input Relay\KeyboardInputRelay.exe" "" "$DIR_INSTALL\Keyboard Input Relay\KeyboardInputRelay.exe" 0 + +${MementoSectionEnd} +!macro Remove_${SectionKeyboardInputRelay} + ${LOG_TEXT} "INFO" "Removing Keyboard Input Relay..." + ${KILLPROCESS} "KeyboardInputRelay.exe" + + ; remove auto-run + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Keyboard Input Relay" + + ; remove start menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Keyboard Input Relay.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Keyboard Input Relay" +!macroend + +;====================================== + +${MementoSection} "Translator" SectionTranslator + ${LOG_TEXT} "INFO" "Installing Translator..." + ${KILLPROCESS} "Translator.exe" + + ; install files + SetOutPath "$DIR_INSTALL\Translator" + File "..\IR Server Suite\Applications\Translator\bin\${Build_Type}\*.*" + + ; 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" + File "..\IR Server Suite\Applications\Translator\Default Settings\*.xml" + + ; create start menu shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" "$DIR_INSTALL\Translator\Translator.exe" "" "$DIR_INSTALL\Translator\Translator.exe" 0 + + + ; check if Translator is an autorun app + ${If} $AutoRunTranslator == 1 + !insertmacro SetAutoRun "Translator" "$DIR_INSTALL\Translator\Translator.exe" + ${EndIf} +${MementoSectionEnd} +!macro Remove_${SectionTranslator} + ${LOG_TEXT} "INFO" "Removing Translator..." + ${KILLPROCESS} "Translator.exe" + + ; remove auto-run + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Translator" + + ; remove start menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Translator" +!macroend + +;====================================== + +${MementoSection} "Tray Launcher" SectionTrayLauncher + ${LOG_TEXT} "INFO" "Installing Tray Launcher..." + ${KILLPROCESS} "TrayLauncher.exe" + + ; install files + SetOutPath "$DIR_INSTALL\Tray Launcher" + File "..\IR Server Suite\Applications\Tray Launcher\bin\${Build_Type}\*.*" + + ; create start menu shortcuts + CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Tray Launcher.lnk" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" "" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" 0 + + + ; check if TrayLauncher is an autorun app + ${If} $AutoRunTrayLauncher == 1 + !insertmacro SetAutoRun "Tray Launcher" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" + ${EndIf} +${MementoSectionEnd} +!macro Remove_${SectionTrayLauncher} + ${LOG_TEXT} "INFO" "Removing Tray Launcher..." + ${KILLPROCESS} "TrayLauncher.exe" + + ; remove auto-run + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Tray Launcher" + + ; remove start menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Tray Launcher.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Tray Launcher" +!macroend + +;====================================== + +${MementoSection} "Virtual Remote" SectionVirtualRemote + ${LOG_TEXT} "INFO" "Installing Virtual Remote, Skin Editor, Smart Device versions, and Web Remote..." + ${KILLPROCESS} "WebRemote.exe" + ${KILLPROCESS} "VirtualRemote.exe" + ${KILLPROCESS} "VirtualRemoteSkinEditor.exe" + + ; Installing Virtual Remote and Web Remote + SetOutPath "$DIR_INSTALL\Virtual Remote" + File "..\IR Server Suite\Applications\Virtual Remote\bin\${Build_Type}\*.*" + File "..\IR Server Suite\Applications\Web Remote\bin\${Build_Type}\WebRemote.*" + File "..\IR Server Suite\Applications\Virtual Remote Skin Editor\bin\${Build_Type}\VirtualRemoteSkinEditor.*" + + ; Installing skins + SetOutPath "$DIR_INSTALL\Virtual Remote\Skins" + File "..\IR Server Suite\Applications\Virtual Remote\Skins\*.*" + + ; Installing Virtual Remote for Smart Devices + SetOutPath "$DIR_INSTALL\Virtual Remote\Smart Devices" + File "..\Virtual Remote\Applications\Virtual Remote (PocketPC2003) Installer\${Build_Type}\*.cab" + File "..\Virtual Remote\Applications\Virtual Remote (Smartphone2003) Installer\${Build_Type}\*.cab" + File "..\Virtual Remote\Applications\Virtual Remote (WinCE5) Installer\${Build_Type}\*.cab" + + ; create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\Virtual Remote" + + ; create start menu shortcuts + 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 + +${MementoSectionEnd} +!macro Remove_${SectionVirtualRemote} + ${LOG_TEXT} "INFO" "Removing Virtual Remote, Skin Editor, Smart Device versions, and Web Remote..." + ${KILLPROCESS} "WebRemote.exe" + ${KILLPROCESS} "VirtualRemote.exe" + ${KILLPROCESS} "VirtualRemoteSkinEditor.exe" + + ; remove start menu shortcuts + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote.lnk" + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote Skin Editor.lnk" + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote for Smart Devices.lnk" + Delete "$SMPROGRAMS\${PRODUCT_NAME}\Web Remote.lnk" + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Virtual Remote" +!macroend + +SectionGroupEnd + +;====================================== + +SectionGroup "CommandLine Tools" SectionGroupCmdLineTools + +${MementoSection} "IR Blast" SectionIRBlast + ${LOG_TEXT} "INFO" "Installing IR Blast..." + + ; install files + SetOutPath "$DIR_INSTALL\IR Blast" + File "..\IR Server Suite\Applications\IR Blast (No Window)\bin\${Build_Type}\*.*" + File "..\IR Server Suite\Applications\IR Blast\bin\${Build_Type}\IRBlast.exe" + +${MementoSectionEnd} +!macro Remove_${SectionIRBlast} + ${LOG_TEXT} "INFO" "Removing IR Blast..." + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\IR Blast" +!macroend + +;====================================== + +${MementoSection} "Dreambox Tuner" SectionDboxTuner + ${LOG_TEXT} "INFO" "Installing Dreambox Tuner..." + + ; install files + SetOutPath "$DIR_INSTALL\Dbox Tuner" + File "..\IR Server Suite\Applications\Dbox Tuner\bin\${Build_Type}\*.*" + + ; create folders + CreateDirectory "$APPDATA\${PRODUCT_NAME}\Dbox Tuner" + +${MementoSectionEnd} +!macro Remove_${SectionDboxTuner} + ${LOG_TEXT} "INFO" "Removing Dreambox Tuner..." + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\Dbox Tuner" +!macroend + +;====================================== + +${MementoSection} "Hauppauge PVR Tuner" SectionHcwPvrTuner + ${LOG_TEXT} "INFO" "Installing Hauppauge PVR Tuner..." + + ; install files + SetOutPath "$DIR_INSTALL\HCW PVR Tuner" + File "..\IR Server Suite\Applications\HCW PVR Tuner\bin\${Build_Type}\*.*" + +${MementoSectionEnd} +!macro Remove_${SectionHcwPvrTuner} + ${LOG_TEXT} "INFO" "Removing Hauppauge PVR Tuner..." + + ; remove files + RMDir /R /REBOOTOK "$DIR_INSTALL\HCW PVR Tuner" +!macroend + +SectionGroupEnd + +;====================================== + +${MementoSectionDone} + +;====================================== + +Section "-Complete" + + DetailPrint "Completing install ..." + + ;Removes unselected components + !insertmacro SectionList "FinishSection" + ;writes component status to registry + ${MementoSectionSave} + +!ifdef MPplugins + ; start tvservice, if it was closed before + !insertmacro StartTVService +!endif + + ; removing tve2 blaster + Delete "$MPdir.Plugins\Process\TV2BlasterPlugin.dll" + + ; Use the all users context + SetShellVarContext all + + ; Create start menu shortcuts + WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\Documentation.url" "InternetShortcut" "URL" "http://www.team-mediaportal.com/manual/IRServerSuite" + WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\Website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" + 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 registry settings + WriteRegStr HKLM "${REG_UNINSTALL}" "ServerServiceMode" "$ServerServiceMode" + + ; Write the installation paths into the registry + WriteRegStr HKLM "Software\${PRODUCT_NAME}" "Install_Dir" "$DIR_INSTALL" +!ifdef MPplugins + WriteRegStr HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" "$DIR_MEDIAPORTAL" + WriteRegStr HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" "$DIR_TVSERVER" +!endif + + ; Write the product version into the registry + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionMajor" "${VER_MAJOR}" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionMinor" "${VER_MINOR}" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionRevision" "${VER_REVISION}" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionBuild" "${VER_BUILD}" + + ; Write the uninstall keys for Windows + WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayName" "${PRODUCT_NAME}" + WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayVersion" "${VERSION}" + WriteRegStr HKLM "${REG_UNINSTALL}" "Publisher" "${PRODUCT_PUBLISHER}" + WriteRegStr HKLM "${REG_UNINSTALL}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" + WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayIcon" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" + WriteRegStr HKLM "${REG_UNINSTALL}" "UninstallString" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" + WriteRegDWORD HKLM "${REG_UNINSTALL}" "NoModify" 1 + WriteRegDWORD HKLM "${REG_UNINSTALL}" "NoRepair" 1 + + ; Write the uninstaller + WriteUninstaller "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" + + ; Store the install log + StrCpy $0 "$APPDATA\${PRODUCT_NAME}\Logs\Install.log" + Push $0 + Call DumpLog + +SectionEnd + +;====================================== + +Section "Uninstall" + DetailPrint "DIR_INSTALL: $DIR_INSTALL" +!ifdef MPplugins + DetailPrint "DIR_MEDIAPORTAL: $DIR_MEDIAPORTAL" + DetailPrint "DIR_TVSERVER: $DIR_TVSERVER" +!endif + + + ; Use the all users context + SetShellVarContext all + + ; First removes all optional components + !insertmacro SectionList "RemoveSection" + +!ifdef MPplugins + ; start tvservice, if it was closed before + !insertmacro StartTVService +!endif + + ; do not remove anything in appdata + ;DetailPrint "Removing Set Top Box presets ..." + ;RMDir /R "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" + + ; Remove files and uninstaller + 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}" + + ${If} $UnInstallMode == 1 + + ${LOG_TEXT} "INFO" "Removing User Settings" + RMDir /r "$APPDATA\${PRODUCT_NAME}" + + ${EndIf} + + ${If} $frominstall == 1 + Quit + ${EndIf} +SectionEnd + + +#--------------------------------------------------------------------------- +# SOME MACROS AND FUNCTIONS +#--------------------------------------------------------------------------- +!ifdef MPplugins +!macro GetMediaPortalPaths + + ${If} ${RunningX64} + SetRegView 32 + ${EnableX64FSRedirection} + ${Endif} + + ; Get MediaPortal installation directory ... + !insertmacro MP_GET_INSTALL_DIR $DIR_MEDIAPORTAL + ${If} $DIR_MEDIAPORTAL != "" + ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL + ${Endif} + + ; Get MediaPortal TV Server installation directory ... + !insertmacro TVSERVER_GET_INSTALL_DIR $DIR_TVSERVER + + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} + +!macroend +!endif + +Function ReadPreviousSettings + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} + + ; read and analyze previous version + !insertmacro ReadPreviousVersion + + ; read previous used directories + ReadRegStr $PREVIOUS_INSTALLDIR HKLM "Software\${PRODUCT_NAME}" "Install_Dir" +!ifdef MPplugins + #ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" + #ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" + !insertmacro GetMediaPortalPaths ; if not installed, path == "" +!endif + + ; read previous settings + ReadRegStr $PREVIOUS_ServerServiceMode HKLM "${REG_UNINSTALL}" "ServerServiceMode" + + + ; check if Translator is an autorun app + ${If} ${IsAutoRun} "Translator" + StrCpy $AutoRunTranslator 1 + ${Else} + StrCpy $AutoRunTranslator 0 + ${EndIf} + + ; check if TrayLauncher is an autorun app + ${If} ${IsAutoRun} "Tray Launcher" + StrCpy $AutoRunTrayLauncher 1 + ${Else} + StrCpy $AutoRunTrayLauncher 0 + ${EndIf} +FunctionEnd + +Function LoadPreviousSettings + ; reset DIR_INSTALL + ${If} $PREVIOUS_INSTALLDIR != "" + StrCpy $DIR_INSTALL "$PREVIOUS_INSTALLDIR" + ${Else} + StrCpy $DIR_INSTALL "$PROGRAMFILES\${PRODUCT_NAME}" + ${EndIf} + + ; reset ServerServiceMode + ${If} $PREVIOUS_ServerServiceMode == "InputService" + ${OrIf} $PREVIOUS_ServerServiceMode == "IRServer" + StrCpy $ServerServiceMode $PREVIOUS_ServerServiceMode + ${Else} + StrCpy $ServerServiceMode "InputService" + ${EndIf} + + + ; reset previous component selection from registry + ${MementoSectionRestore} + +!ifdef MPplugins + ; set sections, according to possible selections + ${If} "$DIR_MEDIAPORTAL" != "" + !insertmacro EnableSection "${SectionMPControlPlugin}" "MP Control Plugin" + !insertmacro EnableSection "${SectionMPBlastZonePlugin}" "MP Blast Zone Plugin" + ;!insertmacro EnableSection "${SectionTV2BlasterPlugin}" "TV2 Blaster Plugin" + !insertmacro EnableSection "${SectionGroupMP}" "MediaPortal plugins" + ${else} + !insertmacro DisableSection "${SectionMPControlPlugin}" "MP Control Plugin" " " + !insertmacro DisableSection "${SectionMPBlastZonePlugin}" "MP Blast Zone Plugin" " " + ;!insertmacro DisableSection "${SectionTV2BlasterPlugin}" "TV2 Blaster Plugin" " " + !insertmacro DisableSection "${SectionGroupMP}" "MediaPortal plugins" " ($(TEXT_MP_NOT_INSTALLED))" + ${Endif} + + ${If} "$DIR_TVSERVER" != "" + !insertmacro EnableSection "${SectionTV3BlasterPlugin}" "TV Server Blaster Plugin" + !insertmacro EnableSection "${SectionGroupTV3}" "TV Server plugins" + ${else} + !insertmacro DisableSection "${SectionTV3BlasterPlugin}" "TV Server Blaster Plugin" " " + !insertmacro DisableSection "${SectionGroupTV3}" "TV Server plugins" " ($(TEXT_TVSERVER_NOT_INSTALLED))" + ${Endif} +!endif + + ; update component selection + Call .onSelChange +FunctionEnd + + +#--------------------------------------------------------------------------- +# INSTALLER CALLBACKS +#--------------------------------------------------------------------------- +Function .onInit + ${LOG_OPEN} + + Call ReadPreviousSettings + Call LoadPreviousSettings + +FunctionEnd + +Function .onInstFailed + ${LOG_CLOSE} +FunctionEnd + +Function .onInstSuccess + +${If} ${SectionIsSelected} ${SectionInputService} + + ; start Server/Service + ${If} $ServerServiceMode == "IRServer" + ${LOG_TEXT} "INFO" "Starting IRServer..." + Exec "$DIR_INSTALL\Input Service\IRServer.exe" + ${Else} + ${LOG_TEXT} "INFO" "Starting InputService..." + Exec '"$DIR_INSTALL\Input Service\Input Service.exe" /start' + ${EndIf} + +${EndIf} + + + ${LOG_CLOSE} +FunctionEnd + +Function .onSelChange + +!ifdef MPplugins + ; disable/remove common files for MediaPortal plugins if all MediaPortal plugins are unselected + ${IfNot} ${SectionIsSelected} ${SectionMPControlPlugin} + ${AndIfNot} ${SectionIsSelected} ${SectionMPBlastZonePlugin} +; ${AndIfNot} ${SectionIsSelected} ${SectionTV2BlasterPlugin} + !insertmacro UnselectSection ${SectionMPCommon} + ${Else} + !insertmacro SelectSection ${SectionMPCommon} + ${EndIf} + + ; disable/remove common files for TVServer plugins if all TVServer plugins are unselected + ${IfNot} ${SectionIsSelected} ${SectionTV3BlasterPlugin} + !insertmacro UnselectSection ${SectionTV3Common} + ${Else} + !insertmacro SelectSection ${SectionTV3Common} + ${EndIf} +!endif + +FunctionEnd + +;====================================== + +Function PageComponentsPre + ; skip page if previous settings are used for update + ${If} $EXPRESS_UPDATE == 1 + Abort + ${EndIf} +FunctionEnd + +/* +Function DirectoryPreMP + ; skip page if no MediaPortal plugins are selected + ${IfNot} ${SectionIsSelected} ${SectionGroupMP} + Abort + ${EndIf} + + ; skip page if previous settings are used for update and DIR_MEDIAPORTAL is valid + ${If} $EXPRESS_UPDATE == 1 + ${AndIf} $DIR_MEDIAPORTAL != "" + Abort + ${EndIf} +FunctionEnd + +Function DirectoryLeaveMP + ; verify if the dir is valid + ${IfNot} ${FileExists} "$DIR_MEDIAPORTAL\MediaPortal.exe" + MessageBox MB_OK|MB_ICONEXCLAMATION "MediaPortal is not found in this directory. Please specify the correct path to MediaPortal." + Abort + ${EndIf} + + ; refresh MP subdirs, if user has changed the path again + ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL +FunctionEnd + +Function DirectoryPreTV + ; skip page if no TvServer plugins are selected + ${IfNot} ${SectionIsSelected} ${SectionGroupTV3} + Abort + ${EndIf} + + ; skip page if previous settings are used for update and DIR_TVSERVER is valid + ${If} $EXPRESS_UPDATE == 1 + ${AndIf} $DIR_TVSERVER != "" + Abort + ${EndIf} +FunctionEnd + +Function DirectoryLeaveTV + ; verify if the dir is valid + ${IfNot} ${FileExists} "$DIR_TVSERVER\TvService.exe" + MessageBox MB_OK|MB_ICONEXCLAMATION "TvServer is not found in this directory. Please specify the correct path to TVServer." + Abort + ${EndIf} +FunctionEnd +*/ + +Function PageDirectoryPre + ; skip page if previous settings are used for update + ${If} $EXPRESS_UPDATE == 1 + Abort + ${EndIf} +FunctionEnd + +/* +Function FinishShow + ; This function is called, after the Finish Page creation is finished + + ; It checks, if the Server has been selected and only displays the run checkbox in this case + ${IfNot} ${SectionIsSelected} SectionInputService + SendMessage $mui.FinishPage.Run ${BM_CLICK} 0 0 + ShowWindow $mui.FinishPage.Run ${SW_HIDE} + ${EndIf} +FunctionEnd +*/ + + +#--------------------------------------------------------------------------- +# UNINSTALLER CALLBACKS +#--------------------------------------------------------------------------- +Function un.onInit + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} + + ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" +!ifdef MPplugins + ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" + ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" + ${un.ReadMediaPortalDirs} $DIR_MEDIAPORTAL +!endif + + ${un.InitCommandlineParameter} + ${un.ReadCommandlineParameter} "frominstall" + +FunctionEnd + +;====================================== + +Function un.WelcomePagePre + + ${If} $frominstall == 1 + Abort + ${EndIf} + +FunctionEnd + +Function un.ConfirmPagePre + + ${If} $frominstall == 1 + Abort + ${EndIf} + +FunctionEnd + +Function un.FinishPagePre + + ${If} $frominstall == 1 + SetRebootFlag false + Abort + ${EndIf} + +FunctionEnd + + +#--------------------------------------------------------------------------- +# SECTION DESCRIPTIONS +#--------------------------------------------------------------------------- +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SectionInputService} "$(DESC_SectionInputService)" + +!ifdef MPplugins + !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMP} "$(DESC_SectionGroupMP)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "$(DESC_SectionMPControlPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "$(DESC_SectionMPBlastZonePlugin)" +; !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupTV3} "$(DESC_SectionGroupTV3)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" +; !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMCE} "$(DESC_SectionGroupMCE)" +; !insertmacro MUI_DESCRIPTION_TEXT ${SectionMCEBlaster} "$(DESC_SectionMCEBlaster)" +!endif + + !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "$(DESC_SectionTranslator)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "$(DESC_SectionTrayLauncher)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "$(DESC_SectionVirtualRemote)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRBlast} "$(DESC_SectionIRBlast)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRFileTool} "$(DESC_SectionIRFileTool)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionKeyboardInputRelay} "$(DESC_SectionKeyboardInputRelay)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionDboxTuner} "$(DESC_SectionDboxTuner)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionHcwPvrTuner} "$(DESC_SectionHcwPvrTuner)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionDebugClient} "$(DESC_SectionDebugClient)" +!insertmacro MUI_FUNCTION_DESCRIPTION_END This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-07-21 06:40:40
|
Revision: 3019 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3019&view=rev Author: chef_koch Date: 2009-07-21 06:40:27 +0000 (Tue, 21 Jul 2009) Log Message: ----------- merged setup scripts for x86 builds and anycpu Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/setup.nsi Removed Paths: ------------- trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-07-18 10:31:15 UTC (rev 3018) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-07-21 06:40:27 UTC (rev 3019) @@ -17,7 +17,16 @@ !define BUILD_TYPE "Release" !endif +##### CPU_TYPE +# Uncomment the following line to create a setup in AnyCPU mode +;!define CPU_TYPE "AnyCPU" +# parameter for command line execution: /DCPU_TYPE=AnyCPU +# by default BUILD_TYPE is set to "Release" +!ifndef CPU_TYPE + !define CPU_TYPE "x86" +!endif + #--------------------------------------------------------------------------- # DEVELOPMENT ENVIRONMENT #--------------------------------------------------------------------------- @@ -90,6 +99,9 @@ #--------------------------------------------------------------------------- # INCLUDE FILES #--------------------------------------------------------------------------- +!if ${CPU_TYPE} != "x86" +!include x64.nsh +!endif !include MUI2.nsh !include Sections.nsh !include LogicLib.nsh @@ -1123,6 +1135,13 @@ !ifdef MPplugins !macro GetMediaPortalPaths +!if ${CPU_TYPE} != "x86" + ${If} ${RunningX64} + SetRegView 32 + ${EnableX64FSRedirection} + ${Endif} +!endif + ; Get MediaPortal installation directory ... !insertmacro MP_GET_INSTALL_DIR $DIR_MEDIAPORTAL ${If} $DIR_MEDIAPORTAL != "" @@ -1132,10 +1151,23 @@ ; Get MediaPortal TV Server installation directory ... !insertmacro TVSERVER_GET_INSTALL_DIR $DIR_TVSERVER +!if ${CPU_TYPE} != "x86" + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} +!endif + !macroend !endif Function ReadPreviousSettings +!if ${CPU_TYPE} != "x86" + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} +!endif ; read and analyze previous version !insertmacro ReadPreviousVersion @@ -1352,6 +1384,12 @@ # UNINSTALLER CALLBACKS #--------------------------------------------------------------------------- Function un.onInit +!if ${CPU_TYPE} != "x86" + ${If} ${RunningX64} + SetRegView 64 + ${DisableX64FSRedirection} + ${Endif} +!endif ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" !ifdef MPplugins Deleted: trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi 2009-07-18 10:31:15 UTC (rev 3018) +++ trunk/plugins/IR Server Suite/setup/setup_AllCpu.nsi 2009-07-21 06:40:27 UTC (rev 3019) @@ -1,1441 +0,0 @@ -;====================================== -; IR Server Suite.nsi -; -; (C) Copyright Aaron Dinnage, 2008 -;====================================== - - -#--------------------------------------------------------------------------- -# 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 "." - -!define svn_MPplugins "..\MediaPortal Plugins" - - -#--------------------------------------------------------------------------- -# 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" - -!define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" -!define MEMENTO_REGISTRY_ROOT HKLM -!define MEMENTO_REGISTRY_KEY "${REG_UNINSTALL}" -!define COMMON_APPDATA "$APPDATA\${PRODUCT_NAME}" - -; VER_BUILD is set to zero for Release builds -!define VER_MAJOR 1 -!define VER_MINOR 4 -!define VER_REVISION 2 - -!ifndef VER_BUILD - !define VER_BUILD 0 -!endif - -!if ${VER_BUILD} == 0 # it's a stable release - !define VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}" -!else # it's an svn release - !define VERSION "Test Build ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}" -!endif - -SetCompressor /SOLID /FINAL lzma - -; enable logging -!define INSTALL_LOG - -; to use default path to logfile, COMMON_APPDATA has to be defined -; default logfile is: "${COMMON_APPDATA}\Logs\install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}.log" -; if you want to set custom path to logfile, uncomment the following line -#!define INSTALL_LOG_FILE "$DESKTOP\install_$(^Name).log" - - -#--------------------------------------------------------------------------- -# VARIABLES -#--------------------------------------------------------------------------- -Var DIR_INSTALL -!ifdef MPplugins -Var DIR_MEDIAPORTAL -Var DIR_TVSERVER -!endif - -Var PREVIOUS_INSTALLDIR -Var PREVIOUS_VERSION -Var PREVIOUS_VERSION_STATE -Var EXPRESS_UPDATE - -Var AutoRunTranslator -Var AutoRunTrayLauncher - -Var frominstall - - -#--------------------------------------------------------------------------- -# INCLUDE FILES -#--------------------------------------------------------------------------- -!include x64.nsh -!include MUI2.nsh -!include Sections.nsh -!include LogicLib.nsh -!include Library.nsh -!include FileFunc.nsh -!include Memento.nsh -!include WinVer.nsh - - - -!include "include\DumpLog.nsh" -;!include "include\FileAssociation.nsh" -!include "include\IrssSystemRegistry.nsh" -!include "include\LanguageMacros.nsh" -!include "include\LoggingMacros.nsh" -!ifdef MPplugins -!include "include\MediaPortalDirectories.nsh" -!endif -!include "include\MediaPortalMacros.nsh" -!include "include\ProcessMacros.nsh" -!include "include\WinVerEx.nsh" - -!include "pages\AddRemovePage.nsh" -!include "pages\ServerServiceMode.nsh" -!include "pages\UninstallModePage.nsh" - - -#--------------------------------------------------------------------------- -# INSTALLER ATTRIBUTES -#--------------------------------------------------------------------------- -Name "${PRODUCT_NAME}" -OutFile "..\${PRODUCT_NAME} - ${VERSION}.exe" -InstallDir "" - -ShowInstDetails show -ShowUninstDetails show -CRCCheck On - -BrandingText "${PRODUCT_NAME} - ${VERSION} by ${PRODUCT_PUBLISHER}" - - -#--------------------------------------------------------------------------- -# INSTALLER INTERFACE settings -#--------------------------------------------------------------------------- -!define MUI_ABORTWARNING -!define MUI_ICON "Icons\iconGreen.ico" -!define MUI_UNICON "Icons\iconGreen.ico" - -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_BITMAP "images\header.bmp" -!if ${VER_BUILD} == 0 - !define MUI_WELCOMEFINISHPAGE_BITMAP "images\wizard.bmp" - !define MUI_UNWELCOMEFINISHPAGE_BITMAP "images\wizard.bmp" -!else - !define MUI_WELCOMEFINISHPAGE_BITMAP "images\wizard-svn.bmp" - !define MUI_UNWELCOMEFINISHPAGE_BITMAP "images\wizard-svn.bmp" -!endif -!define MUI_HEADERIMAGE_RIGHT - -!define MUI_COMPONENTSPAGE_SMALLDESC -!define MUI_FINISHPAGE_NOAUTOCLOSE -;!define MUI_FINISHPAGE_RUN_NOTCHECKED -;!define MUI_FINISHPAGE_RUN "$DIR_INSTALL\IR Server Configuration\IR Server Configuration.exe" -;!define MUI_FINISHPAGE_RUN_TEXT "Run IR Server Configuration" - -!define MUI_UNFINISHPAGE_NOAUTOCLOSE - - -#--------------------------------------------------------------------------- -# INSTALLER INTERFACE -#--------------------------------------------------------------------------- -!insertmacro MUI_PAGE_WELCOME -!insertmacro MUI_PAGE_LICENSE "..\IR Server Suite\Documentation\LICENSE.GPL" - -Page custom PageReinstallMode PageLeaveReinstallMode - -!define MUI_PAGE_CUSTOMFUNCTION_PRE PageComponentsPre -!insertmacro MUI_PAGE_COMPONENTS - -Page custom PageServerServiceMode PageLeaveServerServiceMode - -/* -; MediaPortal install path -!define MUI_PAGE_HEADER_TEXT "Choose MediaPortal Location" -!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install MediaPortal plugins." -!define MUI_DIRECTORYPAGE_TEXT_TOP "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 Next to continue." -!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "MediaPortal Folder" -!define MUI_DIRECTORYPAGE_VARIABLE "$DIR_MEDIAPORTAL" -!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreMP -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveMP -!insertmacro MUI_PAGE_DIRECTORY - -; TV Server install path -!define MUI_PAGE_HEADER_TEXT "Choose TV Server Location" -!define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install TV Server plugins." -!define MUI_DIRECTORYPAGE_TEXT_TOP "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 Next to continue." -!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "TV Server Folder" -!define MUI_DIRECTORYPAGE_VARIABLE "$DIR_TVSERVER" -!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPreTV -!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeaveTV -!insertmacro MUI_PAGE_DIRECTORY -*/ - -; Main app install path -!define MUI_DIRECTORYPAGE_VARIABLE "$DIR_INSTALL" -!define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre -!insertmacro MUI_PAGE_DIRECTORY - -!insertmacro MUI_PAGE_INSTFILES -!insertmacro MUI_PAGE_FINISH - - -; UnInstaller Interface -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.WelcomePagePre -!insertmacro MUI_UNPAGE_WELCOME -UninstPage custom un.UninstallModePage un.UninstallModePageLeave -;!define MUI_PAGE_CUSTOMFUNCTION_PRE un.ConfirmPagePre -;!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES -!define MUI_PAGE_CUSTOMFUNCTION_PRE un.FinishPagePre -!insertmacro MUI_UNPAGE_FINISH - - -#--------------------------------------------------------------------------- -# INSTALLER LANGUAGES -#--------------------------------------------------------------------------- -!insertmacro LANG_LOAD "English" - - -#--------------------------------------------------------------------------- -# USEFUL MACROS -#--------------------------------------------------------------------------- -!macro SectionList MacroName - ; This macro used to perform operation on multiple sections. - ; List all of your components in following manner here. - !insertmacro "${MacroName}" "SectionIRServer" - -!ifdef MPplugins - !insertmacro "${MacroName}" "SectionMPCommon" - !insertmacro "${MacroName}" "SectionMPControlPlugin" - !insertmacro "${MacroName}" "SectionMPBlastZonePlugin" -; !insertmacro "${MacroName}" "SectionTV2BlasterPlugin" - - !insertmacro "${MacroName}" "SectionTV3Common" - !insertmacro "${MacroName}" "SectionTV3BlasterPlugin" - -; !insertmacro "${MacroName}" "SectionMCEBlaster" -!endif - - #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}" "SectionDboxTuner" - !insertmacro "${MacroName}" "SectionHcwPvrTuner" -!macroend - -;====================================== - -Function RunUninstaller - - ; old (un)installers should be called silently - ${If} $PREVIOUS_VERSION == "" - !insertmacro RunUninstaller "silent" - ${Else} - !insertmacro RunUninstaller "NoSilent" - ${EndIf} - -FunctionEnd - - -#--------------------------------------------------------------------------- -# SECTIONS and REMOVEMACROS -#--------------------------------------------------------------------------- -Section "-prepare" - DetailPrint "Uninstalling old version ..." - - ; uninstall old version if necessary - ${If} ${Silent} - - !insertmacro RunUninstaller "silent" - - ${ElseIf} $EXPRESS_UPDATE != "" - - Call RunUninstaller - BringToFront - - ${EndIf} - - -/* OBSOLETE since irss is uninstalled before - DetailPrint "Preparing to install ..." - - IfFileExists "$DIR_INSTALL\IR Server\IR Server.exe" StopIRServer SkipStopIRServer - -StopIRServer: - ExecWait '"$DIR_INSTALL\IR Server\IR Server.exe" /stop' - -SkipStopIRServer: - Sleep 100 -*/ -SectionEnd - -;====================================== - -Section "-Core" - - DetailPrint "Setting up paths and installing core files ..." - - ; Use the all users context - SetShellVarContext all - SetOverwrite on - - - ; Create app data directories - SetOutPath "$DIR_INSTALL" - ;File "..\IR Server Suite\Documentation\${PRODUCT_NAME}.chm" - - - CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" - - ; Create app data directories - 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 "..\IR Server Suite\Set Top Boxes\*.*" - SetOverwrite on - - -SectionEnd - -;====================================== - -${MementoSection} "IR Server" SectionIRServer - ${LOG_TEXT} "INFO" "Installing IR Server..." - ${StopService} "IRServer" - ${KILLPROCESS} "IR Server.exe" - ${KILLPROCESS} "IR Server Configuration.exe" - - ; Use the all users context - SetShellVarContext all - - - ;not needed anymore since uninstall is launched before - ;${LOG_TEXT} "INFO" "Removing current IRServer from Autostart..." - ;!insertmacro RemoveAutoRun "IR Server" - ;${LOG_TEXT} "INFO" "Uninstalling current IRServer..." - ;ExecWait '"$DIR_INSTALL\IR Server\IR Server.exe" /uninstall' - - - ${LOG_TEXT} "INFO" "Installing IR Server..." - SetOutPath "$DIR_INSTALL\IR Server" - File "..\IR Server Suite\IR Server\IR Server\bin\${Build_Type}\*.*" - - ${LOG_TEXT} "INFO" "Installing IR Server Configuration..." - SetOutPath "$DIR_INSTALL\IR Server Configuration" - File "..\IR Server Suite\IR Server\IR Server Configuration\bin\${Build_Type}\*.*" - - ${LOG_TEXT} "INFO" "Installing IR Server Plugins..." - SetOutPath "$DIR_INSTALL\IR Server Plugins" - - File "..\IR Server Suite\IR Server Plugins\Ads Tech PTV-335 Receiver\bin\${Build_Type}\Ads Tech PTV-335 Receiver.*" - File "..\IR Server Suite\IR Server Plugins\CoolCommand Receiver\bin\${Build_Type}\CoolCommand Receiver.*" - File "..\IR Server Suite\IR Server Plugins\Custom HID Receiver\bin\${Build_Type}\Custom HID Receiver.*" - File "..\IR Server Suite\IR Server Plugins\Direct Input Receiver\bin\${Build_Type}\Direct Input Receiver.*" - File "..\IR Server Suite\IR Server Plugins\FusionRemote Receiver\bin\${Build_Type}\FusionRemote Receiver.*" - File "..\IR Server Suite\IR Server Plugins\Girder Plugin\bin\${Build_Type}\Girder Plugin.*" - File "..\IR Server Suite\IR Server Plugins\HCW Receiver\bin\${Build_Type}\HCW Receiver.*" - File "..\IR Server Suite\IR Server Plugins\IgorPlug Receiver\bin\${Build_Type}\IgorPlug Receiver.*" - File "..\IR Server Suite\IR Server Plugins\Imon USB Receivers\bin\${Build_Type}\Imon USB Receivers.*" - ;File "..\IR Server Suite\IR Server Plugins\IR501 Receiver\bin\${Build_Type}\IR501 Receiver.*" - File "..\IR Server Suite\IR Server Plugins\IR507 Receiver\bin\${Build_Type}\IR507 Receiver.*" - ;File "..\IR Server Suite\IR Server Plugins\Ira Transceiver\bin\${Build_Type}\Ira Transceiver.*" - File "..\IR Server Suite\IR Server Plugins\IRMan Receiver\bin\${Build_Type}\IRMan Receiver.*" - File "..\IR Server Suite\IR Server Plugins\IRTrans Transceiver\bin\${Build_Type}\IRTrans Transceiver.*" - ;File "..\IR Server Suite\IR Server Plugins\Keyboard Input\bin\${Build_Type}\Keyboard Input.*" - File "..\IR Server Suite\IR Server Plugins\LiveDrive Receiver\bin\${Build_Type}\LiveDrive Receiver.*" - File "..\IR Server Suite\IR Server Plugins\MacMini Receiver\bin\${Build_Type}\MacMini Receiver.*" - File "..\IR Server Suite\IR Server Plugins\Microsoft MCE Transceiver\bin\${Build_Type}\Microsoft MCE Transceiver.*" - File "..\IR Server Suite\IR Server Plugins\Pinnacle Serial Receiver\bin\${Build_Type}\Pinnacle Serial Receiver.*" - ;File "..\IR Server Suite\IR Server Plugins\RC102 Receiver\bin\${Build_Type}\RC102 Receiver.*" - File "..\IR Server Suite\IR Server Plugins\RedEye Blaster\bin\${Build_Type}\RedEye Blaster.*" - File "..\IR Server Suite\IR Server Plugins\Serial IR Blaster\bin\${Build_Type}\Serial IR Blaster.*" - ;File "..\IR Server Suite\IR Server Plugins\Speech Receiver\bin\${Build_Type}\Speech Receiver.*" - File "..\IR Server Suite\IR Server Plugins\Technotrend Receiver\bin\${Build_Type}\Technotrend Receiver.*" - File "..\IR Server Suite\IR Server Plugins\Technotrend Receiver\bin\${Build_Type}\ttBdaDrvApi_Dll.dll" - ;File "..\IR Server Suite\IR Server Plugins\Tira Transceiver\bin\${Build_Type}\Tira Transceiver.*" - File "..\IR Server Suite\IR Server Plugins\USB-UIRT Transceiver\bin\${Build_Type}\USB-UIRT Transceiver.*" - File "..\IR Server Suite\IR Server Plugins\Wii Remote Receiver\bin\${Build_Type}\Wii Remote Receiver.*" - File "..\IR Server Suite\IR Server Plugins\WiimoteLib\bin\${Build_Type}\WiimoteLib.*" - File "..\IR Server Suite\IR Server Plugins\Windows Message Receiver\bin\${Build_Type}\Windows Message Receiver.*" - File "..\IR Server Suite\IR Server Plugins\WinLirc Transceiver\bin\${Build_Type}\WinLirc Transceiver.*" - File "..\IR Server Suite\IR Server Plugins\X10 Transceiver\bin\${Build_Type}\X10 Transceiver.*" - File "..\IR Server Suite\IR Server Plugins\X10 Transceiver\bin\${Build_Type}\Interop.X10.dll" - File "..\IR Server Suite\IR Server Plugins\XBCDRC Receiver\bin\${Build_Type}\XBCDRC Receiver.*" - - ; Create App Data Folder for IR Server configuration files - CreateDirectory "$APPDATA\${PRODUCT_NAME}\IR Server" - - ; Copy Abstract Remote maps - SetOutPath "$APPDATA\${PRODUCT_NAME}\IR Server\Abstract Remote Maps" - SetOverwrite ifnewer - File /r /x .svn "..\IR Server Suite\IR Server\IR Server\Abstract Remote Maps\*.*" - File "..\IR Server Suite\IR Server\IR Server\RemoteTable.xsd" - SetOverwrite on - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\IR Server Configuration.lnk" "$DIR_INSTALL\IR Server Configuration\IR Server Configuration.exe" "" "$DIR_INSTALL\IR Server Configuration\IR Server Configuration.exe" 0 - - ; Install Server/Service - ${If} $ServerServiceMode == "IRServerAsApplication" - ${LOG_TEXT} "INFO" "Adding IR Server to Autostart..." - !insertmacro SetAutoRun "IR Server" '"$DIR_INSTALL\IR Server\IR Server.exe"' - ${Else} - ${LOG_TEXT} "INFO" "Installing IR Server as Service..." - ExecWait '"$DIR_INSTALL\IR Server\IR Server.exe" /install' - ${EndIf} - !insertmacro SetAutoRun "IR Server Configuration" '"$DIR_INSTALL\IR Server Configuration\IR Server Configuration.exe"' - -${MementoSectionEnd} -!macro Remove_${SectionIRServer} - ${LOG_TEXT} "INFO" "Removing IR Server..." - ${StopService} "IRServer" - ${KILLPROCESS} "IR Server.exe" - ${KILLPROCESS} "IR Server Configuration.exe" - - ${LOG_TEXT} "INFO" "Removing IR Server from Autostart..." - !insertmacro RemoveAutoRun "IR Server" - ${LOG_TEXT} "INFO" "Uninstalling IR Server as Service..." - ExecWait '"$DIR_INSTALL\IR Server\IR Server.exe" /uninstall' - !insertmacro RemoveAutoRun "IR Server Configuration" - - ; remove start menu shortcuts - Delete "$SMPROGRAMS\${PRODUCT_NAME}\IR Server Configuration.lnk" - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\IR Server" - RMDir /R /REBOOTOK "$DIR_INSTALL\IR Server Configuration" - RMDir /R /REBOOTOK "$DIR_INSTALL\IR Server Plugins" -!macroend - -;====================================== - -!ifdef MPplugins - -SectionGroup "MediaPortal plugins" SectionGroupMP - -Section "-commonMP" SectionMPCommon - ${LOG_TEXT} "INFO" "Installing common files for MediaPortal plugins..." - ${KILLPROCESS} "MediaPortal.exe" - ${KILLPROCESS} "configuration.exe" - - ; Write plugin dll - SetOutPath "$MPdir.Plugins\Process" - File "..\MediaPortal Plugins\Common\MPUtils\bin\${Build_Type}\MPUtils.*" - File "..\IR Server Suite\Common\IrssComms\bin\${Build_Type}\IrssComms.*" - File "..\IR Server Suite\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" - - ; Write plugin dll - SetOutPath "$MPdir.Plugins\Windows" - File "..\MediaPortal Plugins\Common\MPUtils\bin\${Build_Type}\MPUtils.*" - File "..\IR Server Suite\Common\IrssComms\bin\${Build_Type}\IrssComms.*" - File "..\IR Server Suite\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" -SectionEnd -!macro Remove_${SectionMPCommon} - ${LOG_TEXT} "INFO" "Removing common files for MediaPortal plugins..." - ${KILLPROCESS} "MediaPortal.exe" - ${KILLPROCESS} "configuration.exe" - - ; remove files - Delete /REBOOTOK "$MPdir.Plugins\Process\MPUtils.*" - Delete /REBOOTOK "$MPdir.Plugins\Process\IrssComms.*" - Delete /REBOOTOK "$MPdir.Plugins\Process\IrssUtils.*" - Delete /REBOOTOK "$MPdir.Plugins\Windows\MPUtils.*" - Delete /REBOOTOK "$MPdir.Plugins\Windows\IrssComms.*" - Delete /REBOOTOK "$MPdir.Plugins\Windows\IrssUtils.*" -!macroend - -;====================================== - -${MementoSection} "MP Control Plugin" SectionMPControlPlugin - ${LOG_TEXT} "INFO" "Installing MP Control Plugin..." - - ; Write plugin dll - SetOutPath "$MPdir.Plugins\Process" - File "..\MediaPortal Plugins\MediaPortal Plugins\MP Control Plugin\bin\${Build_Type}\MPControlPlugin.*" - - ; Write input mapping - SetOutPath "$MPdir.CustomInputDefault" - File "..\MediaPortal Plugins\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\MediaPortal Plugins\MP Control Plugin\AppData\*.*" - SetOverwrite on - - ; Create Macro folder - CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Control Plugin\Macro" - -${MementoSectionEnd} -!macro Remove_${SectionMPControlPlugin} - ${LOG_TEXT} "INFO" "MP Control Plugin..." - - Delete /REBOOTOK "$MPdir.Plugins\Process\MPControlPlugin.*" -!macroend - -;====================================== - -${MementoUnselectedSection} "MP Blast Zone Plugin" SectionMPBlastZonePlugin - ${LOG_TEXT} "INFO" "Installing MP Blast Zone Plugin..." - - ; Use the all users context - SetShellVarContext all - - ; Write plugin dll - SetOutPath "$MPdir.Plugins\Windows" - File "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\bin\${Build_Type}\MPBlastZonePlugin.*" - - ; Write app data - CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin" - SetOutPath "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin" - SetOverwrite off - File "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\AppData\Menu.xml" - SetOverwrite on - - ; Write skin files - SetOutPath "$MPdir.Skin\Blue3" - File /r /x .svn "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" - - SetOutPath "$MPdir.Skin\Blue3wide" - File /r /x .svn "..\MediaPortal Plugins\MediaPortal Plugins\MP Blast Zone Plugin\Skin\*.*" - - ; Create Macro folder - CreateDirectory "$APPDATA\${PRODUCT_NAME}\MP Blast Zone Plugin\Macro" - -${MementoSectionEnd} -!macro Remove_${SectionMPBlastZonePlugin} - ${LOG_TEXT} "INFO" "Removing MP Blast Zone Plugin..." - - Delete /REBOOTOK "$MPdir.Plugins\Windows\MPBlastZonePlugin.*" -!macroend - -;====================================== -/* -${MementoUnselectedSection} "TV2 Blaster Plugin" SectionTV2BlasterPlugin - ${LOG_TEXT} "INFO" "Installing TV2 Blaster Plugin..." - - ; Write plugin dll - SetOutPath "$MPdir.Plugins\Process" - File "..\MediaPortal Plugins\MediaPortal Plugins\TV2 Blaster Plugin\bin\${Build_Type}\TV2BlasterPlugin.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV2 Blaster Plugin" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV2 Blaster Plugin\Macro" - -${MementoSectionEnd} -!macro Remove_${SectionTV2BlasterPlugin} - ${LOG_TEXT} "INFO" "Removing TV2 Blaster Plugin..." - - Delete /REBOOTOK "$MPdir.Plugins\Process\TV2BlasterPlugin.*" -!macroend -;====================================== -*/ - -SectionGroupEnd - -;====================================== - -Var RestartTvService -!macro StopTVService - ${If} $RestartTvService != 0 - - ; 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" - - ${EndIf} -!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 - -SectionGroup "TV Server plugins" SectionGroupTV3 - -Section "-commonTV3" SectionTV3Common - ${LOG_TEXT} "INFO" "Installing common files for TV Server plugins..." - !insertmacro StopTVService - - ; Write plugin dll - SetOutPath "$DIR_TVSERVER\Plugins" - File "..\MediaPortal Plugins\Common\MPUtils\bin\${Build_Type}\MPUtils.*" - File "..\IR Server Suite\Common\IrssComms\bin\${Build_Type}\IrssComms.*" - File "..\IR Server Suite\Common\IrssUtils\bin\${Build_Type}\IrssUtils.*" -SectionEnd -!macro Remove_${SectionTV3Common} - ${If} ${FileExists} "$DIR_TVSERVER\Plugins\MPUtils.*" - ${OrIf} ${FileExists} "$DIR_TVSERVER\Plugins\IrssComms.*" - ${OrIf} ${FileExists} "$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} "TV Server Blaster Plugin" SectionTV3BlasterPlugin - ${LOG_TEXT} "INFO" "Installing TV Server Blaster Plugin..." - - ; Write plugin dll - SetOutPath "$DIR_TVSERVER\Plugins" - File "..\MediaPortal Plugins\TVServer plugins\TV3 Blaster Plugin\bin\${Build_Type}\TV3BlasterPlugin.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV3 Blaster Plugin" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\TV3 Blaster Plugin\Macro" - -${MementoSectionEnd} -!macro Remove_${SectionTV3BlasterPlugin} - ${If} ${FileExists} "$DIR_TVSERVER\Plugins\MPUtils.*" - - ${LOG_TEXT} "INFO" "Removing TV Server Blaster Plugin..." - !insertmacro StopTVService - - Delete /REBOOTOK "$DIR_TVSERVER\Plugins\TV3BlasterPlugin.*" - - ${EndIf} -!macroend - -;====================================== - -SectionGroupEnd - -;====================================== -/* -SectionGroup /e "Media Center add-ons" SectionGroupMCE - -${MementoUnselectedSection} "Media Center Blaster (experimental)" SectionMCEBlaster - ${LOG_TEXT} "INFO" "Installing MediaCenterBlaster..." - ${KILLPROCESS} "MediaCenterBlaster.exe" - - ; Use the all users context - SetShellVarContext all - - ; Installing Translator - CreateDirectory "$DIR_INSTALL\Media Center Blaster" - SetOutPath "$DIR_INSTALL\Media Center Blaster" - File "..\IR Server Suite\Applications\Media Center Blaster\bin\${Build_Type}\*.*" - - ; Create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Media Center Blaster" - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Media Center Blaster\Macro" - - ; Create start menu shortcut - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Media Center Blaster.lnk" "$DIR_INSTALL\Media Center Blaster\MediaCenterBlaster.exe" "" "$DIR_INSTALL\Media Center Blaster\MediaCenterBlaster.exe" 0 - -${MementoSectionEnd} -!macro Remove_${SectionMCEBlaster} - ${LOG_TEXT} "INFO" "Removing MediaCenterBlaster..." - ${KILLPROCESS} "MediaCenterBlaster.exe" - - ; Remove auto-run - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Media Center Blaster" - - ; remove Start Menu shortcuts - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Media Center Blaster.lnk" - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\Media Center Blaster" -!macroend - -;====================================== - -SectionGroupEnd - -;====================================== -*/ - -!endif - -SectionGroup "Tools" SectionGroupTools -/* -${MementoSection} "Abstractor" SectionAbstractor - ${LOG_TEXT} "INFO" "Installing Abstractor..." - ${KILLPROCESS} "Abstractor.exe" - - ; install files - SetOutPath "$DIR_INSTALL\Abstractor" - File "..\IR Server Suite\Applications\Abstractor\bin\${Build_Type}\*.*" - - ; create start menu shortcuts - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Abstractor.lnk" "$DIR_INSTALL\Abstractor\Abstractor.exe" "" "$DIR_INSTALL\Abstractor\Abstractor.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 "..\IR Server Suite\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 "..\IR Server Suite\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 File Tool\IRFileTool.exe" 0 - -${MementoSectionEnd} -!macro Remove_${SectionIRFileTool} - ${LOG_TEXT} "INFO" "Removing IR File Tool..." - ${KILLPROCESS} "IRFileTool.exe" - - ; remove start menu shortcuts - Delete "$SMPROGRAMS\${PRODUCT_NAME}\IR File Tool.lnk" - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\IR File Tool" -!macroend - -;====================================== - -${MementoSection} "Keyboard Input Relay" SectionKeyboardInputRelay - ${LOG_TEXT} "INFO" "Installing Keyboard Input Relay..." - ${KILLPROCESS} "KeyboardInputRelay.exe" - - ; install files - SetOutPath "$DIR_INSTALL\Keyboard Input Relay" - File "..\IR Server Suite\Applications\Keyboard Input Relay\bin\${Build_Type}\*.*" - - ; create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Keyboard Input Relay" - - ; create start menu shortcuts - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Keyboard Input Relay.lnk" "$DIR_INSTALL\Keyboard Input Relay\KeyboardInputRelay.exe" "" "$DIR_INSTALL\Keyboard Input Relay\KeyboardInputRelay.exe" 0 - -${MementoSectionEnd} -!macro Remove_${SectionKeyboardInputRelay} - ${LOG_TEXT} "INFO" "Removing Keyboard Input Relay..." - ${KILLPROCESS} "KeyboardInputRelay.exe" - - ; remove auto-run - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Keyboard Input Relay" - - ; remove start menu shortcuts - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Keyboard Input Relay.lnk" - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\Keyboard Input Relay" -!macroend - -;====================================== - -${MementoSection} "Translator" SectionTranslator - ${LOG_TEXT} "INFO" "Installing Translator..." - ${KILLPROCESS} "Translator.exe" - - ; install files - SetOutPath "$DIR_INSTALL\Translator" - File "..\IR Server Suite\Applications\Translator\bin\${Build_Type}\*.*" - - ; 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" - File "..\IR Server Suite\Applications\Translator\Default Settings\*.xml" - - ; create start menu shortcuts - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" "$DIR_INSTALL\Translator\Translator.exe" "" "$DIR_INSTALL\Translator\Translator.exe" 0 - - - ; check if Translator is an autorun app - ${If} $AutoRunTranslator == 1 - !insertmacro SetAutoRun "Translator" "$DIR_INSTALL\Translator\Translator.exe" - ${EndIf} -${MementoSectionEnd} -!macro Remove_${SectionTranslator} - ${LOG_TEXT} "INFO" "Removing Translator..." - ${KILLPROCESS} "Translator.exe" - - ; remove auto-run - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Translator" - - ; remove start menu shortcuts - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Translator.lnk" - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\Translator" -!macroend - -;====================================== - -${MementoSection} "Tray Launcher" SectionTrayLauncher - ${LOG_TEXT} "INFO" "Installing Tray Launcher..." - ${KILLPROCESS} "TrayLauncher.exe" - - ; install files - SetOutPath "$DIR_INSTALL\Tray Launcher" - File "..\IR Server Suite\Applications\Tray Launcher\bin\${Build_Type}\*.*" - - ; create start menu shortcuts - CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Tray Launcher.lnk" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" "" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" 0 - - - ; check if TrayLauncher is an autorun app - ${If} $AutoRunTrayLauncher == 1 - !insertmacro SetAutoRun "Tray Launcher" "$DIR_INSTALL\Tray Launcher\TrayLauncher.exe" - ${EndIf} -${MementoSectionEnd} -!macro Remove_${SectionTrayLauncher} - ${LOG_TEXT} "INFO" "Removing Tray Launcher..." - ${KILLPROCESS} "TrayLauncher.exe" - - ; remove auto-run - DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Tray Launcher" - - ; remove start menu shortcuts - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Tray Launcher.lnk" - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\Tray Launcher" -!macroend - -;====================================== - -${MementoSection} "Virtual Remote" SectionVirtualRemote - ${LOG_TEXT} "INFO" "Installing Virtual Remote, Skin Editor, Smart Device versions, and Web Remote..." - ${KILLPROCESS} "WebRemote.exe" - ${KILLPROCESS} "VirtualRemote.exe" - ${KILLPROCESS} "VirtualRemoteSkinEditor.exe" - - ; Installing Virtual Remote and Web Remote - SetOutPath "$DIR_INSTALL\Virtual Remote" - File "..\IR Server Suite\Applications\Virtual Remote\bin\${Build_Type}\*.*" - File "..\IR Server Suite\Applications\Web Remote\bin\${Build_Type}\WebRemote.*" - File "..\IR Server Suite\Applications\Virtual Remote Skin Editor\bin\${Build_Type}\VirtualRemoteSkinEditor.*" - - ; Installing skins - SetOutPath "$DIR_INSTALL\Virtual Remote\Skins" - File "..\IR Server Suite\Applications\Virtual Remote\Skins\*.*" - - ; Installing Virtual Remote for Smart Devices - SetOutPath "$DIR_INSTALL\Virtual Remote\Smart Devices" - File "..\Virtual Remote\Applications\Virtual Remote (PocketPC2003) Installer\${Build_Type}\*.cab" - File "..\Virtual Remote\Applications\Virtual Remote (Smartphone2003) Installer\${Build_Type}\*.cab" - File "..\Virtual Remote\Applications\Virtual Remote (WinCE5) Installer\${Build_Type}\*.cab" - - ; create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Virtual Remote" - - ; create start menu shortcuts - 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 - -${MementoSectionEnd} -!macro Remove_${SectionVirtualRemote} - ${LOG_TEXT} "INFO" "Removing Virtual Remote, Skin Editor, Smart Device versions, and Web Remote..." - ${KILLPROCESS} "WebRemote.exe" - ${KILLPROCESS} "VirtualRemote.exe" - ${KILLPROCESS} "VirtualRemoteSkinEditor.exe" - - ; remove start menu shortcuts - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote.lnk" - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote Skin Editor.lnk" - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Virtual Remote for Smart Devices.lnk" - Delete "$SMPROGRAMS\${PRODUCT_NAME}\Web Remote.lnk" - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\Virtual Remote" -!macroend - -SectionGroupEnd - -;====================================== - -SectionGroup "CommandLine Tools" SectionGroupCmdLineTools - -${MementoSection} "IR Blast" SectionIRBlast - ${LOG_TEXT} "INFO" "Installing IR Blast..." - - ; install files - SetOutPath "$DIR_INSTALL\IR Blast" - File "..\IR Server Suite\Applications\IR Blast (No Window)\bin\${Build_Type}\*.*" - File "..\IR Server Suite\Applications\IR Blast\bin\${Build_Type}\IRBlast.exe" - -${MementoSectionEnd} -!macro Remove_${SectionIRBlast} - ${LOG_TEXT} "INFO" "Removing IR Blast..." - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\IR Blast" -!macroend - -;====================================== - -${MementoSection} "Dreambox Tuner" SectionDboxTuner - ${LOG_TEXT} "INFO" "Installing Dreambox Tuner..." - - ; install files - SetOutPath "$DIR_INSTALL\Dbox Tuner" - File "..\IR Server Suite\Applications\Dbox Tuner\bin\${Build_Type}\*.*" - - ; create folders - CreateDirectory "$APPDATA\${PRODUCT_NAME}\Dbox Tuner" - -${MementoSectionEnd} -!macro Remove_${SectionDboxTuner} - ${LOG_TEXT} "INFO" "Removing Dreambox Tuner..." - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\Dbox Tuner" -!macroend - -;====================================== - -${MementoSection} "Hauppauge PVR Tuner" SectionHcwPvrTuner - ${LOG_TEXT} "INFO" "Installing Hauppauge PVR Tuner..." - - ; install files - SetOutPath "$DIR_INSTALL\HCW PVR Tuner" - File "..\IR Server Suite\Applications\HCW PVR Tuner\bin\${Build_Type}\*.*" - -${MementoSectionEnd} -!macro Remove_${SectionHcwPvrTuner} - ${LOG_TEXT} "INFO" "Removing Hauppauge PVR Tuner..." - - ; remove files - RMDir /R /REBOOTOK "$DIR_INSTALL\HCW PVR Tuner" -!macroend - -SectionGroupEnd - -;====================================== - -${MementoSectionDone} - -;====================================== - -Section "-Complete" - - DetailPrint "Completing install ..." - - ;Removes unselected components - !insertmacro SectionList "FinishSection" - ;writes component status to registry - ${MementoSectionSave} - -!ifdef MPplugins - ; start tvservice, if it was closed before - !insertmacro StartTVService -!endif - - ; removing tve2 blaster - Delete "$MPdir.Plugins\Process\TV2BlasterPlugin.dll" - - ; Use the all users context - SetShellVarContext all - - ; Create start menu shortcuts - WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\Documentation.url" "InternetShortcut" "URL" "http://www.team-mediaportal.com/manual/IRServerSuite" - WriteINIStr "$SMPROGRAMS\${PRODUCT_NAME}\Website.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" - 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 registry settings - WriteRegStr HKLM "${REG_UNINSTALL}" "ServerServiceMode" "$ServerServiceMode" - - ; Write the installation paths into the registry - WriteRegStr HKLM "Software\${PRODUCT_NAME}" "Install_Dir" "$DIR_INSTALL" -!ifdef MPplugins - WriteRegStr HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" "$DIR_MEDIAPORTAL" - WriteRegStr HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" "$DIR_TVSERVER" -!endif - - ; Write the product version into the registry - WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionMajor" "${VER_MAJOR}" - WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionMinor" "${VER_MINOR}" - WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionRevision" "${VER_REVISION}" - WriteRegDWORD HKLM "${REG_UNINSTALL}" "VersionBuild" "${VER_BUILD}" - - ; Write the uninstall keys for Windows - WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayName" "${PRODUCT_NAME}" - WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayVersion" "${VERSION}" - WriteRegStr HKLM "${REG_UNINSTALL}" "Publisher" "${PRODUCT_PUBLISHER}" - WriteRegStr HKLM "${REG_UNINSTALL}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" - WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayIcon" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" - WriteRegStr HKLM "${REG_UNINSTALL}" "UninstallString" "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" - WriteRegDWORD HKLM "${REG_UNINSTALL}" "NoModify" 1 - WriteRegDWORD HKLM "${REG_UNINSTALL}" "NoRepair" 1 - - ; Write the uninstaller - WriteUninstaller "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" - - ; Store the install log - StrCpy $0 "$APPDATA\${PRODUCT_NAME}\Logs\Install.log" - Push $0 - Call DumpLog - -SectionEnd - -;====================================== - -Section "Uninstall" - DetailPrint "DIR_INSTALL: $DIR_INSTALL" -!ifdef MPplugins - DetailPrint "DIR_MEDIAPORTAL: $DIR_MEDIAPORTAL" - DetailPrint "DIR_TVSERVER: $DIR_TVSERVER" -!endif - - - ; Use the all users context - SetShellVarContext all - - ; First removes all optional components - !insertmacro SectionList "RemoveSection" - -!ifdef MPplugins - ; start tvservice, if it was closed before - !insertmacro StartTVService -!endif - - ; do not remove anything in appdata - ;DetailPrint "Removing Set Top Box presets ..." - ;RMDir /R "$APPDATA\${PRODUCT_NAME}\Set Top Boxes" - - ; Remove files and uninstaller - 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}" - - ${If} $UnInstallMode == 1 - - ${LOG_TEXT} "INFO" "Removing User Settings" - RMDir /r "$APPDATA\${PRODUCT_NAME}" - - ${EndIf} - - ${If} $frominstall == 1 - Quit - ${EndIf} -SectionEnd - - -#--------------------------------------------------------------------------- -# SOME MACROS AND FUNCTIONS -#--------------------------------------------------------------------------- -!ifdef MPplugins -!macro GetMediaPortalPaths - - ${If} ${RunningX64} - SetRegView 32 - ${EnableX64FSRedirection} - ${Endif} - - ; Get MediaPortal installation directory ... - !insertmacro MP_GET_INSTALL_DIR $DIR_MEDIAPORTAL - ${If} $DIR_MEDIAPORTAL != "" - ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL - ${Endif} - - ; Get MediaPortal TV Server installation directory ... - !insertmacro TVSERVER_GET_INSTALL_DIR $DIR_TVSERVER - - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} - -!macroend -!endif - -Function ReadPreviousSettings - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} - - ; read and analyze previous version - !insertmacro ReadPreviousVersion - - ; read previous used directories - ReadRegStr $PREVIOUS_INSTALLDIR HKLM "Software\${PRODUCT_NAME}" "Install_Dir" -!ifdef MPplugins - #ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" - #ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" - !insertmacro GetMediaPortalPaths ; if not installed, path == "" -!endif - - ; read previous settings - ReadRegStr $PREVIOUS_ServerServiceMode HKLM "${REG_UNINSTALL}" "ServerServiceMode" - - - ; check if Translator is an autorun app - ${If} ${IsAutoRun} "Translator" - StrCpy $AutoRunTranslator 1 - ${Else} - StrCpy $AutoRunTranslator 0 - ${EndIf} - - ; check if TrayLauncher is an autorun app - ${If} ${IsAutoRun} "Tray Launcher" - StrCpy $AutoRunTrayLauncher 1 - ${Else} - StrCpy $AutoRunTrayLauncher 0 - ${EndIf} -FunctionEnd - -Function LoadPreviousSettings - ; reset DIR_INSTALL - ${If} $PREVIOUS_INSTALLDIR != "" - StrCpy $DIR_INSTALL "$PREVIOUS_INSTALLDIR" - ${Else} - StrCpy $DIR_INSTALL "$PROGRAMFILES\${PRODUCT_NAME}" - ${EndIf} - - ; reset ServerServiceMode - ${If} $PREVIOUS_ServerServiceMode == "IRServerAsApplication" - ${OrIf} $PREVIOUS_ServerServiceMode == "IRServerAsService" - StrCpy $ServerServiceMode $PREVIOUS_ServerServiceMode - ${Else} - StrCpy $ServerServiceMode "IRServerAsService" - ${EndIf} - - - ; reset previous component selection from registry - ${MementoSectionRestore} - -!ifdef MPplugins - ; set sections, according to possible selections - ${If} "$DIR_MEDIAPORTAL" != "" - !insertmacro EnableSection "${SectionMPControlPlugin}" "MP Control Plugin" - !insertmacro EnableSection "${SectionMPBlastZonePlugin}" "MP Blast Zone Plugin" - ;!insertmacro EnableSection "${SectionTV2BlasterPlugin}" "TV2 Blaster Plugin" - !insertmacro EnableSection "${SectionGroupMP}" "MediaPortal plugins" - ${else} - !insertmacro DisableSection "${SectionMPControlPlugin}" "MP Control Plugin" " " - !insertmacro DisableSection "${SectionMPBlastZonePlugin}" "MP Blast Zone Plugin" " " - ;!insertmacro DisableSection "${SectionTV2BlasterPlugin}" "TV2 Blaster Plugin" " " - !insertmacro DisableSection "${SectionGroupMP}" "MediaPortal plugins" " ($(TEXT_MP_NOT_INSTALLED))" - ${Endif} - - ${If} "$DIR_TVSERVER" != "" - !insertmacro EnableSection "${SectionTV3BlasterPlugin}" "TV Server Blaster Plugin" - !insertmacro EnableSection "${SectionGroupTV3}" "TV Server plugins" - ${else} - !insertmacro DisableSection "${SectionTV3BlasterPlugin}" "TV Server Blaster Plugin" " " - !insertmacro DisableSection "${SectionGroupTV3}" "TV Server plugins" " ($(TEXT_TVSERVER_NOT_INSTALLED))" - ${Endif} -!endif - - ; update component selection - Call .onSelChange -FunctionEnd - - -#--------------------------------------------------------------------------- -# INSTALLER CALLBACKS -#--------------------------------------------------------------------------- -Function .onInit - ${LOG_OPEN} - - Call ReadPreviousSettings - Call LoadPreviousSettings - -FunctionEnd - -Function .onInstFailed - ${LOG_CLOSE} -FunctionEnd - -Function .onInstSuccess - -${If} ${SectionIsSelected} ${SectionIRServer} - - ; start Server/Service - ${If} $ServerServiceMode == "IRServerAsApplication" - ${LOG_TEXT} "INFO" "Starting IR Server..." - Exec "$DIR_INSTALL\IR Server\IR Server.exe" - ${Else} - ${LOG_TEXT} "INFO" "Starting IR Server..." - Exec '"$DIR_INSTALL\IR Server\IR Server.exe" /start' - ${EndIf} - Exec "$DIR_INSTALL\IR Server Configuration\IR Server Configuration.exe" - -${EndIf} - - - ${LOG_CLOSE} -FunctionEnd - -Function .onSelChange - -!ifdef MPplugins - ; disable/remove common files for MediaPortal plugins if all MediaPortal plugins are unselected - ${IfNot} ${SectionIsSelected} ${SectionMPControlPlugin} - ${AndIfNot} ${SectionIsSelected} ${SectionMPBlastZonePlugin} -; ${AndIfNot} ${SectionIsSelected} ${SectionTV2BlasterPlugin} - !insertmacro UnselectSection ${SectionMPCommon} - ${Else} - !insertmacro SelectSection ${SectionMPCommon} - ${EndIf} - - ; disable/remove common files for TVServer plugins if all TVServer plugins are unselected - ${IfNot} ${SectionIsSelected} ${SectionTV3BlasterPlugin} - !insertmacro UnselectSection ${SectionTV3Common} - ${Else} - !insertmacro SelectSection ${SectionTV3Common} - ${EndIf} -!endif - -FunctionEnd - -;====================================== - -Function PageComponentsPre - ; skip page if previous settings are used for update - ${If} $EXPRESS_UPDATE == 1 - Abort - ${EndIf} -FunctionEnd - -/* -Function DirectoryPreMP - ; skip page if no MediaPortal plugins are selected - ${IfNot} ${SectionIsSelected} ${SectionGroupMP} - Abort - ${EndIf} - - ; skip page if previous settings are used for update and DIR_MEDIAPORTAL is valid - ${If} $EXPRESS_UPDATE == 1 - ${AndIf} $DIR_MEDIAPORTAL != "" - Abort - ${EndIf} -FunctionEnd - -Function DirectoryLeaveMP - ; verify if the dir is valid - ${IfNot} ${FileExists} "$DIR_MEDIAPORTAL\MediaPortal.exe" - MessageBox MB_OK|MB_ICONEXCLAMATION "MediaPortal is not found in this directory. Please specify the correct path to MediaPortal." - Abort - ${EndIf} - - ; refresh MP subdirs, if user has changed the path again - ${ReadMediaPortalDirs} $DIR_MEDIAPORTAL -FunctionEnd - -Function DirectoryPreTV - ; skip page if no TvServer plugins are selected - ${IfNot} ${SectionIsSelected} ${SectionGroupTV3} - Abort - ${EndIf} - - ; skip page if previous settings are used for update and DIR_TVSERVER is valid - ${If} $EXPRESS_UPDATE == 1 - ${AndIf} $DIR_TVSERVER != "" - Abort - ${EndIf} -FunctionEnd - -Function DirectoryLeaveTV - ; verify if the dir is valid - ${IfNot} ${FileExists} "$DIR_TVSERVER\TvService.exe" - MessageBox MB_OK|MB_ICONEXCLAMATION "TvServer is not found in this directory. Please specify the correct path to TVServer." - Abort - ${EndIf} -FunctionEnd -*/ - -Function PageDirectoryPre - ; skip page if previous settings are used for update - ${If} $EXPRESS_UPDATE == 1 - Abort - ${EndIf} -FunctionEnd - -/* -Function FinishShow - ; This function is called, after the Finish Page creation is finished - - ; It checks, if the Server has been selected and only displays the run checkbox in this case - ${IfNot} ${SectionIsSelected} SectionIRServer - SendMessage $mui.FinishPage.Run ${BM_CLICK} 0 0 - ShowWindow $mui.FinishPage.Run ${SW_HIDE} - ${EndIf} -FunctionEnd -*/ - - -#--------------------------------------------------------------------------- -# UNINSTALLER CALLBACKS -#--------------------------------------------------------------------------- -Function un.onInit - ${If} ${RunningX64} - SetRegView 64 - ${DisableX64FSRedirection} - ${Endif} - - ReadRegStr $DIR_INSTALL HKLM "Software\${PRODUCT_NAME}" "Install_Dir" -!ifdef MPplugins - ReadRegStr $DIR_MEDIAPORTAL HKLM "Software\${PRODUCT_NAME}" "MediaPortal_Dir" - ReadRegStr $DIR_TVSERVER HKLM "Software\${PRODUCT_NAME}" "TVServer_Dir" - ${un.ReadMediaPortalDirs} $DIR_MEDIAPORTAL -!endif - - ${un.InitCommandlineParameter} - ${un.ReadCommandlineParameter} "frominstall" - -FunctionEnd - -;====================================== - -Function un.WelcomePagePre - - ${If} $frominstall == 1 - Abort - ${EndIf} - -FunctionEnd - -Function un.ConfirmPagePre - - ${If} $frominstall == 1 - Abort - ${EndIf} - -FunctionEnd - -Function un.FinishPagePre - - ${If} $frominstall == 1 - SetRebootFlag false - Abort - ${EndIf} - -FunctionEnd - - -#--------------------------------------------------------------------------- -# SECTION DESCRIPTIONS -#--------------------------------------------------------------------------- -!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRServer} "$(DESC_SectionIRServer)" - -!ifdef MPplugins - !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMP} "$(DESC_SectionGroupMP)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "$(DESC_SectionMPControlPlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "$(DESC_SectionMPBlastZonePlugin)" -; !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupTV3} "$(DESC_SectionGroupTV3)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" -; !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMCE} "$(DESC_SectionGroupMCE)" -; !insertmacro MUI_DESCRIPTION_TEXT ${SectionMCEBlaster} "$(DESC_SectionMCEBlaster)" -!endif - - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "$(DESC_SectionTranslator)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "$(DESC_SectionTrayLauncher)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "$(DESC_SectionVirtualRemote)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRBlast} "$(DESC_SectionIRBlast)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionIRFileTool} "$(DESC_SectionIRFileTool)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionKeyboardInputRelay} "$(DESC_SectionKeyboardInputRelay)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionDboxTuner} "$(DESC_SectionDboxTuner)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionHcwPvrTuner} "$(DESC_SectionHcwPvrTuner)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionDebugClient} "$(DESC_SectionDebugClient)" -!insertmacro MUI_FUNCTION_DESCRIPTION_END This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-08-30 21:33:03
|
Revision: 3072 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3072&view=rev Author: chef_koch Date: 2009-08-30 21:32:56 +0000 (Sun, 30 Aug 2009) Log Message: ----------- fixed paths and the way SetRights.exe is executed Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/Resources/ trunk/plugins/IR Server Suite/setup/Resources/SetRights.exe Added: trunk/plugins/IR Server Suite/setup/Resources/SetRights.exe =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/setup/Resources/SetRights.exe ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-08-28 16:17:26 UTC (rev 3071) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-08-30 21:32:56 UTC (rev 3072) @@ -1095,7 +1095,7 @@ WriteUninstaller "$DIR_INSTALL\Uninstall ${PRODUCT_NAME}.exe" ; set rights to programmdata directory and reg keys - !insertmacro SetRightsIRSS + Call SetRightsIRSS ; Store the install log StrCpy $0 "$APPDATA\${PRODUCT_NAME}\Logs\Install.log" @@ -1458,18 +1458,18 @@ FunctionEnd -!macro SetRightsIRSS +Function SetRightsIRSS ${LOG_TEXT} "INFO" "Setting AccessRights to ProgramData dir and reg keys" SetOverwrite on SetOutPath "$PLUGINSDIR" - File "${svn_ROOT}\Tools\Script & Batch tools\SetRights\bin\Release\SetRights.exe" + File "Resources\SetRights.exe" SetShellVarContext all nsExec::ExecToLog '"$PLUGINSDIR\SetRights.exe" FOLDER "$APPDATA\${PRODUCT_NAME}"' nsExec::ExecToLog '"$PLUGINSDIR\SetRights.exe" HKLM "Software\${PRODUCT_NAME}"' ;nsExec::ExecToLog '"$PLUGINSDIR\SetRights.exe" HKCU "Software\Team MediaPortal"' -!macroend +FunctionEnd #--------------------------------------------------------------------------- # SECTION DESCRIPTIONS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-11-29 16:33:28
|
Revision: 3190 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3190&view=rev Author: chef_koch Date: 2009-11-29 16:33:20 +0000 (Sun, 29 Nov 2009) Log Message: ----------- fixed the path to log files in installer once more Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh 2009-11-28 16:58:10 UTC (rev 3189) +++ trunk/plugins/IR Server Suite/setup/include/LoggingMacros.nsh 2009-11-29 16:33:20 UTC (rev 3190) @@ -98,18 +98,26 @@ !ifdef INSTALL_LOG_FILE CopyFiles "$TempInstallLog" "${INSTALL_LOG_FILE}" !else - !ifndef COMMON_APPDATA - !error "$\r$\n$\r$\nCOMMON_APPDATA is not defined!$\r$\n$\r$\n" - !endif - ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 - CopyFiles "$TempInstallLog" "${COMMON_APPDATA}\log\${UNINSTALL_PREFIX}install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}_$2-$1-$0_$4-$5-$6.log" + !ifdef INSTALL_LOG_DIR - Delete "$TempInstallLog" + ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + CopyFiles "$TempInstallLog" "${INSTALL_LOG_DIR}\${UNINSTALL_PREFIX}install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}_$2-$1-$0_$4-$5-$6.log" + !else + + !ifndef COMMON_APPDATA + !error "$\r$\n$\r$\nCOMMON_APPDATA is not defined!$\r$\n$\r$\n" + !endif + + ${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 + CopyFiles "$TempInstallLog" "${COMMON_APPDATA}\log\${UNINSTALL_PREFIX}install_${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}_$2-$1-$0_$4-$5-$6.log" + + !endif + !endif + Delete "$TempInstallLog" - !undef UNINSTALL_PREFIX !macroend Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-11-28 16:58:10 UTC (rev 3189) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-11-29 16:33:20 UTC (rev 3190) @@ -115,6 +115,7 @@ ;!include "include\FileAssociation.nsh" !include "include\IrssSystemRegistry.nsh" !include "include\LanguageMacros.nsh" +!define INSTALL_LOG_DIR "${COMMON_APPDATA}\logs" !include "include\LoggingMacros.nsh" !ifdef MPplugins !include "include\MediaPortalDirectories.nsh" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-12-20 03:43:05
|
Revision: 3286 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3286&view=rev Author: chef_koch Date: 2009-12-20 03:21:23 +0000 (Sun, 20 Dec 2009) Log Message: ----------- reworked the ReInstall Page to work the same way like official mui pages added new check for minimum version of MP and/or TVServer if one of the related plugins are enabled set minimum version to 2.0.0.0 for both for testing Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/languages/English.nsh trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/languages/English.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-12-20 00:17:54 UTC (rev 3285) +++ trunk/plugins/IR Server Suite/setup/languages/English.nsh 2009-12-20 03:21:23 UTC (rev 3286) @@ -30,7 +30,10 @@ !insertmacro LANG_STRING DESC_SectionHcwPvrTuner "Command line tuner for Hauppauge PVR devices." !insertmacro LANG_STRING DESC_SectionMCEBlaster "For tuning external channels (on Set Top Boxes) with Windows Media Center." +!insertmacro LANG_STRING ERROR_MIN_VERSION_MP "You are trying to install MediaPortal plugins.$\r$\nThe minimum required MediaPortal version is ${MIN_VERSION_MP}.$\r$\n$\r$\nSo please update your MediaPortal installation or unselect those plugins." +!insertmacro LANG_STRING ERROR_MIN_VERSION_TVSERVER "You are trying to install MediaPortal TV Server plugins.$\r$\nThe minimum required MediaPortal TV Server version is ${MIN_VERSION_TVSERVER}.$\r$\n$\r$\nSo please update your MediaPortal TV Server installation or unselect those plugins." + # Texts for message boxes !if "${PRODUCT_NAME}" == "MediaPortal" !insertmacro LANG_STRING TEXT_MSGBOX_REMOVE_ALL "!!! ATTENTION !!!$\r$\nDo you want to make a complete cleanup?$\r$\nThis removes completly the registry keys, the installation and the common app data directory, inclusive thumbs, databases, skins and plugins!" Modified: trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh 2009-12-20 00:17:54 UTC (rev 3285) +++ trunk/plugins/IR Server Suite/setup/pages/AddRemovePage.nsh 2009-12-20 03:21:23 UTC (rev 3286) @@ -1,9 +1,9 @@ #region Copyright (C) 2005-2009 Team MediaPortal /* - * Copyright (C) 2005-2009 Team MediaPortal - * http://www.team-mediaportal.com - * + * Copyright (C) 2005-2009 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) @@ -26,178 +26,237 @@ /* _____________________________________________________________________________ - AddRemovePage + ReinstallPage + + If same version is already installed, this page offers to uninstall or reinstall. + If different version, this page offers simple and advanced mode for installation. + + Needs: $PREVIOUS_VERSION_STATE { "newer" , "older", "same" } + $EXPRESS_UPDATE { 0 , 1 } + Function: RunUninstaller to start uninstaller of previous version + Function: LoadPreviousSettings to re-load settings of previous installation _____________________________________________________________________________ - - The original header file is taken from: - http://nsis.sourceforge.net/Add/Remove_Functionality - and modified for our needs. */ -!ifndef ___ADD_REMOVE_PAGE__NSH___ -!define ___ADD_REMOVE_PAGE__NSH___ +!ifndef ___REINSTALLPAGE__NSH___ +!define ___REINSTALLPAGE__NSH___ -!include WordFunc.nsh -!include FileFunc.nsh +;-------------------------------- +;Page interface settings and variables -##### Add/Remove/Reinstall page -Var ReinstallMode -Var ReinstallModePage.optBtn1 -Var ReinstallModePage.optBtn1.state -Var ReinstallModePage.optBtn2 -Var ReinstallModePage.optBtn2.state +!macro MUI_REINSTALLPAGE_INTERFACE -Function PageReinstallMode - ; check if software is already installed - ${If} $PREVIOUS_VERSION == "" - Abort - ${EndIf} + !ifndef MUI_REINSTALLPAGE_INTERFACE + !define MUI_REINSTALLPAGE_INTERFACE + Var mui.ReinstallPage + Var ReinstallMode + Var mui.ReinstallPage.Text - ; save current values to stack - Push $R0 - Push $R1 - Push $R2 - Push $R3 + Var mui.ReinstallPage.Option1 + Var mui.ReinstallPage.Option1.State + Var mui.ReinstallPage.Option2 + Var mui.ReinstallPage.Option2.State - ; set string for control texts - ${If} $PREVIOUS_VERSION_STATE == "newer" - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + Function ReinstallPage.UpdateSelection - ${ElseIf} $PREVIOUS_VERSION_STATE == "older" - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" - StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + ${NSD_GetState} $mui.ReinstallPage.Option1 $mui.ReinstallPage.Option1.State + ${NSD_GetState} $mui.ReinstallPage.Option2 $mui.ReinstallPage.Option2.State - ${ElseIf} $PREVIOUS_VERSION_STATE == "same" - StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" - StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" - StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" - !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" + ${If} $mui.ReinstallPage.Option2.State == ${BST_CHECKED} + StrCpy $ReinstallMode 2 + ${Else} + StrCpy $ReinstallMode 1 + ${EndIf} - ${Else} - MessageBox MB_ICONSTOP "Unknown value of PREVIOUS_VERSION_STATE, aborting" /SD IDOK - Abort - ${EndIf} + FunctionEnd + !endif + +; !insertmacro MUI_DEFAULT MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp" - ; create controls - nsDialogs::Create /NOUNLOAD 1018 - Pop $R0 +!macroend - ${NSD_CreateLabel} 0 0 300u 24u $R1 - Pop $R1 - ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2 - Pop $ReinstallModePage.optBtn1 - ${NSD_OnClick} $ReinstallModePage.optBtn1 PageReinstallModeUpdateSelection +;-------------------------------- +;Interface initialization - ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3 - Pop $ReinstallModePage.optBtn2 - ${NSD_OnClick} $ReinstallModePage.optBtn2 PageReinstallModeUpdateSelection +!macro MUI_REINSTALLPAGE_GUIINIT + !ifndef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}REINSTALLPAGE_GUINIT + !define MUI_${MUI_PAGE_UNINSTALLER_PREFIX}REINSTALLPAGE_GUINIT - ; set current ReinstallMode to option buttons - ${If} $ReinstallMode == 2 - ${NSD_Check} $ReinstallModePage.optBtn2 - ${Else} - ; if not 2, set to 1 - ${NSD_Check} $ReinstallModePage.optBtn1 - ; set reinstallmode to 1, if reinstallmode = "" - StrCpy $ReinstallMode 1 - ${EndIf} + Function ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ReinstallPage.GUIInit +; InitPluginsDir +; File "/oname=$PLUGINSDIR\modern-wizard.bmp" "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}WELCOMEFINISHPAGE_BITMAP}" - nsDialogs::Show + !ifdef MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT + Call "${MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT}" + !endif - ; restore values from stack - Pop $R3 - Pop $R2 - Pop $R1 - Pop $R0 -FunctionEnd + FunctionEnd + + !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}PAGE_FUNCTION_GUIINIT ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ReinstallPage.GUIInit -Function PageReinstallModeUpdateSelection + !endif - ${NSD_GetState} $ReinstallModePage.optBtn1 $ReinstallModePage.optBtn1.state - ${NSD_GetState} $ReinstallModePage.optBtn2 $ReinstallModePage.optBtn2.state +!macroend - ${If} $ReinstallModePage.optBtn2.state == ${BST_CHECKED} - StrCpy $ReinstallMode 2 - ${Else} - StrCpy $ReinstallMode 1 - ${EndIf} -FunctionEnd +;-------------------------------- +;Page declaration -Function PageLeaveReinstallMode +!macro MUI_PAGEDECLARATION_REINSTALL - StrCpy $EXPRESS_UPDATE 0 + !insertmacro MUI_SET MUI_${MUI_PAGE_UNINSTALLER_PREFIX}REINSTALLPAGE "" + !insertmacro MUI_REINSTALLPAGE_INTERFACE + + !insertmacro MUI_REINSTALLPAGE_GUIINIT - ; Uninstall is selected - ${If} $PREVIOUS_VERSION_STATE == "same" - ${AndIf} $ReinstallMode == 2 +; !insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TITLE "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TITLE)" +; !insertmacro MUI_DEFAULT MUI_WELCOMEPAGE_TEXT "$(MUI_${MUI_PAGE_UNINSTALLER_PREFIX}TEXT_WELCOME_INFO_TEXT)" + +; !insertmacro MUI_PAGE_FUNCTION_FULLWINDOW - StrCpy $EXPRESS_UPDATE 1 - Call RunUninstaller - Quit + PageEx ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}custom - ${EndIf} + PageCallbacks ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ReinstallPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ReinstallLeave_${MUI_UNIQUEID} + PageExEnd - ; ExpressUpdate is selected - ${If} $PREVIOUS_VERSION_STATE != "same" - ${AndIf} $ReinstallMode == 1 + !insertmacro MUI_FUNCTION_REINSTALLPAGE ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ReinstallPre_${MUI_UNIQUEID} ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}mui.ReinstallLeave_${MUI_UNIQUEID} - StrCpy $EXPRESS_UPDATE 1 - Call LoadPreviousSettings +; !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE +; !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_3LINES +; !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT - ${EndIf} +!macroend -FunctionEnd +!macro MUI_PAGE_REINSTALL -/* - ${NSD_GetState} $R2 $R1 + !verbose push +; !verbose ${MUI_VERBOSE} + !verbose 4 - StrCmp $R0 "1" 0 +2 - StrCmp $R1 "1" doUninstall finish - StrCmp $R0 "2" 0 +3 - StrCmp $R1 "1" finish doUninstall + !insertmacro MUI_PAGE_INIT + !insertmacro MUI_PAGEDECLARATION_REINSTALL - doUninstall: - ; check if MP is already installed - ReadRegStr $R0 HKLM "${RegKey}" UninstallString - ${If} ${FileExists} "$R0" - ; get parent folder of uninstallation EXE (RO) and save it to R1 - ${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' - BringToFront + !verbose pop - ; if an error occured, ask to cancel installation - ${If} ${Errors} - MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_ON_UNINSTALL)" IDYES +2 +!macroend + + +;-------------------------------- +;Page functions + +!macro MUI_FUNCTION_REINSTALLPAGE PRE LEAVE + + Function "${PRE}" + + !insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE + + ; check if software is already installed + ${If} $PREVIOUS_VERSION == "" + Abort + ${EndIf} + + + ; set string for control texts + ${If} $PREVIOUS_VERSION_STATE == "newer" + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_UPGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + + ${ElseIf} $PREVIOUS_VERSION_STATE == "older" + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_DOWNGRADE)" + StrCpy $R2 "$(TEXT_ADDREMOVE_UPDOWN_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_UPDOWN_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_UPDOWN)" + + ${ElseIf} $PREVIOUS_VERSION_STATE == "same" + StrCpy $R1 "$(TEXT_ADDREMOVE_INFO_REPAIR)" + StrCpy $R2 "$(TEXT_ADDREMOVE_REPAIR_OPT1)" + StrCpy $R3 "$(TEXT_ADDREMOVE_REPAIR_OPT2)" + !insertmacro MUI_HEADER_TEXT "$(TEXT_ADDREMOVE_HEADER)" "$(TEXT_ADDREMOVE_HEADER2_REPAIR)" + + ${Else} + MessageBox MB_ICONSTOP "Unknown value of PREVIOUS_VERSION_STATE, aborting" /SD IDOK + Abort + ${EndIf} + + + ;create dialog + nsDialogs::Create 1018 + Pop $mui.ReinstallPage +; nsDialogs::SetRTL $(^RTL) +; SetCtlColors $mui.ReinstallPage "" "${MUI_BGCOLOR}" + + ;create text + ${NSD_CreateLabel} 0 0 300u 24u "$R1" + Pop $mui.ReinstallPage.Text + + ;create options + ${NSD_CreateRadioButton} 30u 50u -30u 8u "$R2" + Pop $mui.ReinstallPage.Option1 + ${NSD_OnClick} $mui.ReinstallPage.Option1 ReinstallPage.UpdateSelection + ${NSD_CreateRadioButton} 30u 70u -30u 8u "$R3" + Pop $mui.ReinstallPage.Option2 + ${NSD_OnClick} $mui.ReinstallPage.Option2 ReinstallPage.UpdateSelection + + + ; set current ReinstallMode to option buttons + ${If} $ReinstallMode == 2 + ${NSD_Check} $mui.ReinstallPage.Option2 + ${Else} + ; if not 2, set to 1 + ${NSD_Check} $mui.ReinstallPage.Option1 + ; set reinstallmode to 1, if reinstallmode = "" + StrCpy $ReinstallMode 1 + ${EndIf} + + + ;Show page +; Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow + !insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW + nsDialogs::Show +; Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow + +; !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TITLE_HEIGHT +; !insertmacro MUI_UNSET MUI_WELCOMEPAGE_TEXT_TOP + + FunctionEnd + + Function "${LEAVE}" + + !insertmacro MUI_PAGE_FUNCTION_CUSTOM LEAVE + + + StrCpy $EXPRESS_UPDATE 0 + + ; Uninstall is selected + ${If} $PREVIOUS_VERSION_STATE == "same" + ${AndIf} $ReinstallMode == 2 + + StrCpy $EXPRESS_UPDATE 1 + Call RunUninstaller Quit + ${EndIf} - ${EndIf} - ; if reboot flag is set, abort the installation, and continue the installer on next startup - ${If} ${FileExists} "$INSTDIR\rebootflag" - MessageBox MB_OK|MB_ICONEXCLAMATION "$(TEXT_MSGBOX_ERROR_REBOOT_REQUIRED)" - WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" "$(^Name)" $EXEPATH - Quit - ${EndIf} + ; ExpressUpdate is selected + ${If} $PREVIOUS_VERSION_STATE != "same" + ${AndIf} $ReinstallMode == 1 - finish: -FunctionEnd -*/ + StrCpy $EXPRESS_UPDATE 1 + Call LoadPreviousSettings -!endif # !___ADD_REMOVE_PAGE__NSH___ + ${EndIf} + + FunctionEnd + +!macroend + +!endif # !___REINSTALL_PAGE__NSH___ Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-12-20 00:17:54 UTC (rev 3285) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-12-20 03:21:23 UTC (rev 3286) @@ -94,7 +94,12 @@ ; if you want to set custom path to logfile, uncomment the following line #!define INSTALL_LOG_FILE "$DESKTOP\install_$(^Name).log" +!ifdef MPplugins + !define MIN_VERSION_MP "2.0.0.0" + !define MIN_VERSION_TVSERVER "2.0.0.0" +!endif + #--------------------------------------------------------------------------- # VARIABLES #--------------------------------------------------------------------------- @@ -196,9 +201,11 @@ !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "..\IR Server Suite\Documentation\LICENSE.GPL" -Page custom PageReinstallMode PageLeaveReinstallMode +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE PageReinstallLeave +!insertmacro MUI_PAGE_REINSTALL !define MUI_PAGE_CUSTOMFUNCTION_PRE PageComponentsPre +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE PageComponentsLeave !insertmacro MUI_PAGE_COMPONENTS Page custom PageServerServiceMode PageLeaveServerServiceMode @@ -916,10 +923,10 @@ !ifdef MPplugins ; start tvservice, if it was closed before !insertmacro StartTVService -!endif ; removing tve2 blaster Delete "$MPdir.Plugins\Process\TV2BlasterPlugin.dll" +!endif ; use the all users context SetShellVarContext all @@ -1054,6 +1061,31 @@ !endif !macroend +!macro MediaPortalVersionCheck + ${If} ${SectionIsSelected} ${SectionMPControlPlugin} + ${OrIf} ${SectionIsSelected} ${SectionMPBlastZonePlugin} + + !insertmacro MP_GET_VERSION $0 + ${VersionCompare} $0 ${MIN_VERSION_MP} $R0 + ${If} $R0 == 2 ;MIN_VERSION_MP is higher than current installed + MessageBox MB_OK|MB_ICONEXCLAMATION "$(ERROR_MIN_VERSION_MP)" + Abort + ${EndIf} + + ${EndIf} + + + ${If} ${SectionIsSelected} ${SectionTV3BlasterPlugin} + + !insertmacro TVSERVER_GET_VERSION $0 + ${VersionCompare} $0 ${MIN_VERSION_TVSERVER} $R0 + ${If} $R0 == 2 ;MIN_VERSION_TVSERVER is higher than current installed + MessageBox MB_OK|MB_ICONEXCLAMATION "$(ERROR_MIN_VERSION_TVSERVER)" + Abort + ${EndIf} + + ${EndIf} +!macroend !endif Function ReadPreviousSettings @@ -1199,6 +1231,19 @@ ;====================================== +Function PageReinstallLeave + !ifdef MPplugins + ; ExpressUpdate is selected + ${If} $PREVIOUS_VERSION_STATE != "same" + ${AndIf} $ReinstallMode == 1 + + ; check if mp components are selected and if correct versions are installed + !insertmacro MediaPortalVersionCheck + + ${EndIf} + !endif +FunctionEnd + Function PageComponentsPre ; skip page if previous settings are used for update ${If} $EXPRESS_UPDATE == 1 @@ -1206,6 +1251,13 @@ ${EndIf} FunctionEnd +Function PageComponentsLeave + !ifdef MPplugins + ; check if mp components are selected and if correct versions are installed + !insertmacro MediaPortalVersionCheck + !endif +FunctionEnd + Function PageDirectoryPre ; skip page if previous settings are used for update ${If} $EXPRESS_UPDATE == 1 @@ -1246,12 +1298,12 @@ ${EndIf} FunctionEnd -Function un.ConfirmPagePre - ; skip page if uninstaller is called from installer - ${If} $frominstall == 1 - Abort - ${EndIf} -FunctionEnd +;Function un.ConfirmPagePre +; ; skip page if uninstaller is called from installer +; ${If} $frominstall == 1 +; Abort +; ${EndIf} +;FunctionEnd Function un.FinishPagePre ; skip page if uninstaller is called from installer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2009-12-24 07:36:35
|
Revision: 3298 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3298&view=rev Author: chef_koch Date: 2009-12-24 07:36:26 +0000 (Thu, 24 Dec 2009) Log Message: ----------- updated mp header files renamed SystemRegistry header Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/setup/include/SystemRegistry.nsh Removed Paths: ------------- trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh Deleted: trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh 2009-12-23 12:28:56 UTC (rev 3297) +++ trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh 2009-12-24 07:36:26 UTC (rev 3298) @@ -1,52 +0,0 @@ -#region Copyright (C) 2005-2009 Team MediaPortal - -/* - * Copyright (C) 2005-2009 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 - - -!ifndef IrssSystemRegistry_INCLUDED -!define IrssSystemRegistry_INCLUDED - -!define AutoRunPath 'HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"' - -!macro SetAutoRun name executablePath - WriteRegStr ${AutoRunPath} '${name}' '${executablePath}' -!macroend - -!macro RemoveAutoRun name - WriteRegStr ${AutoRunPath} '${name}' '' -!macroend - -!macro GetAutoRun name variable - ReadRegStr ${variable} ${AutoRunPath} '${name}' -!macroend - -!macro _IsAutoRun _a _b _t _f - !insertmacro _LOGICLIB_TEMP - - !insertmacro GetAutoRun `${_b}` $_LOGICLIB_TEMP - IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` -!macroend -!define IsAutoRun `"" IsAutoRun` - -!endif # !IrssSystemRegistry_INCLUDED Modified: trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh 2009-12-23 12:28:56 UTC (rev 3297) +++ trunk/plugins/IR Server Suite/setup/include/MediaPortalMacros.nsh 2009-12-24 07:36:26 UTC (rev 3298) @@ -23,7 +23,7 @@ #endregion -!if "${NSIS_VERSION}" != "v2.45" +!if "${NSIS_VERSION}" != "v2.46" !error "$\r$\n$\r$\nPlease update your NSIS installation to latest version. http://nsis.sourceforge.net$\r$\n$\r$\n" !endif @@ -76,6 +76,13 @@ !define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" !endif +; modify your registry and uncomment the following line to test if the svn version check is working +;!define SVN_BUILD +!define MIN_INSTALLED_MP_VERSION "1.0.4.0" +!define MIN_INSTALLED_MP_VERSION_TEXT "v1.1.0 beta1" +!define WEB_DOWNLOAD_MIN_MP_VERSION "http://www.team-mediaportal.com/news/global/mediaportal_1.1.0_beta_1_-_released!.html" + + #--------------------------------------------------------------------------- # SECTION MACROS #--------------------------------------------------------------------------- @@ -254,59 +261,19 @@ ;====================================== 3rd PARTY APPLICATION TESTs -!macro _VCRedist2005IsInstalled _a _b _t _f +!macro _VCRedist2008IsInstalled _a _b _t _f - ClearErrors - ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - IfErrors `${_f}` - - StrCpy $R1 $R0 3 - - StrCmp $R1 '5.1' lbl_winnt_XP - StrCmp $R1 '5.2' lbl_winnt_2003 - StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` - - - lbl_winnt_vista: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_none_10b2f55f9bffb8f8.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.762_none_0c178a139ee2a7ed.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.762_none_11ecb0ab9b2caf3c.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.30729.4148_none_51ca66a2bbe76806.manifest" 0 +2 + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_5090ab56bcba71c2.manifest" 0 +4 + IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.4148_none_4bf5400abf9d60b7.manifest" 0 +3 Goto `${_t}` - lbl_winnt_2003: - lbl_winnt_XP: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.MFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_3bf8fa05.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_cbb27474.manifest" 0 `${_f}` + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.ATL_1fc8b3b9a1e18e3b_9.0.30729.4148_x-ww_353599c2.manifest" 0 +4 + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4148_x-ww_d495ac4e.manifest" 0 +3 + IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.4148_x-ww_a57c1f53.manifest" 0 +2 Goto `${_t}` -!macroend -!define VCRedist2005IsInstalled `"" VCRedist2005IsInstalled ""` -!macro _VCRedist2008IsInstalled _a _b _t _f - - ClearErrors - ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - IfErrors `${_f}` - - StrCpy $R1 $R0 3 - - StrCmp $R1 '5.1' lbl_winnt_XP - StrCmp $R1 '5.2' lbl_winnt_2003 - StrCmp $R1 '6.0' lbl_winnt_vista `${_f}` - - - lbl_winnt_vista: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.1_none_e163563597edeada.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.1_none_dcc7eae99ad0d9cf.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.30729.1_none_e29d1181971ae11e.manifest" 0 `${_f}` - Goto `${_t}` - - lbl_winnt_2003: - lbl_winnt_XP: - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_405b0943.manifest" 0 `${_f}` - IfFileExists "$WINDIR\WinSxS\Manifests\x86_Microsoft.VC90.ATL_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_d01483b2.manifest" 0 `${_f}` - Goto `${_t}` + Goto `${_f}` !macroend !define VCRedist2008IsInstalled `"" VCRedist2008IsInstalled ""` @@ -675,6 +642,20 @@ #--------------------------------------------------------------------------- !ifndef NO_OS_DETECTION +!macro ShowMissingComponent MISSING_COMPONENTS + + ExecShell open "${WEB_REQUIREMENTS}" + StrCpy $0 "" + StrCpy $0 "$0$(MISSING_COMPONENT_INTRO)$\r$\n" + StrCpy $0 "$0$(MISSING_COMPONENT_INSTALL)$\r$\n$\r$\n" + StrCpy $0 "$0${MISSING_COMPONENTS}$\r$\n$\r$\n" + StrCpy $0 "$0$(TEXT_MSGBOX_INSTALLATION_CANCELD)$\r$\n$\r$\n" + StrCpy $0 "$0$(MISSING_COMPONENT_MORE_INFO)" + MessageBox MB_OK|MB_ICONSTOP "$0" + Abort + +!macroend + !macro MediaPortalOperatingSystemCheck ${LOG_TEXT} "INFO" ".: Operating System Check :." @@ -780,9 +761,7 @@ ; check if VC Redist 2008 SP1 is installed ${IfNot} ${VCRedist2008IsInstalled} - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_VCREDIST_2008)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" - Abort + !insertmacro ShowMissingComponent " - Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package ATL Security Update" ${EndIf} ${LOG_TEXT} "INFO" "============================" @@ -800,22 +779,68 @@ ${LOG_TEXT} "INFO" ".Net 3.5 ServicePack: $1" ${If} $0 != 1 ; if no 3.5 - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" + ${OrIf} $1 < 1 ; if 3.5, but no sp1 + !insertmacro ShowMissingComponent " - Microsoft .NET Framework 3.5 Service Pack 1" + ${EndIf} + + ${LOG_TEXT} "INFO" "============================" +!macroend + +!ifdef SVN_BUILD +!macro MinimumVersionForSVNCheck + ${LOG_TEXT} "INFO" ".: MinimumVersionForSVNCheck: Compare installed and minimum version for this SVN snapshot :." + +!if "${PRODUCT_NAME}" == "MediaPortal" + ${IfNot} ${MPIsInstalled} + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_SVN_NOMP)" IDNO +2 + ExecShell open "${WEB_DOWNLOAD_MIN_MP_VERSION}" Abort - ${ElseIf} $1 < 1 ; if 3.5, but no sp1 - MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_DOTNET35_SP)" IDNO +2 - ExecShell open "${WEB_REQUIREMENTS}" + ${Else} + + !insertmacro MP_GET_VERSION $R0 +!endif + +!if "${PRODUCT_NAME}" == "MediaPortal TV Server / Client" + ${IfNot} ${TVServerIsInstalled} + ${AndIfNot} ${TVClientIsInstalled} + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_SVN_NOMP)" IDNO +2 + ExecShell open "${WEB_DOWNLOAD_MIN_MP_VERSION}" Abort + ${Else} + + !insertmacro TVSERVER_GET_VERSION $R0 +!endif + + ${VersionCompare} $R0 ${MIN_INSTALLED_MP_VERSION} $R0 + ${If} $R0 == 0 + ; installed version is EQUAL to min + ${ElseIf} $R0 == 1 + ; installed version is NEWER than min + ${ElseIf} $R0 == 2 + ; installed version is OLDER than min + MessageBox MB_YESNO|MB_ICONSTOP "$(TEXT_MSGBOX_ERROR_SVN_WRONG_VERSION)" IDNO +2 + ExecShell open "${WEB_DOWNLOAD_MIN_MP_VERSION}" + Abort + ${Else} + ; installed version is: not found + ${EndIf} + ${EndIf} ${LOG_TEXT} "INFO" "============================" !macroend +!endif + !if "${PRODUCT_NAME}" == "MediaPortal" !macro DoPreInstallChecks +!ifdef SVN_BUILD + ; check if correct MP version ist installed, which is required for this svn snapshot + !insertmacro MinimumVersionForSVNCheck +!endif + ; OS and other common initialization checks are done in the following NSIS header file !insertmacro MediaPortalOperatingSystemCheck !insertmacro MediaPortalAdminCheck @@ -854,6 +879,11 @@ !macro DoPreInstallChecks +!ifdef SVN_BUILD + ; check if correct MP version ist installed, which is required for this svn snapshot + !insertmacro MinimumVersionForSVNCheck +!endif + ; OS and other common initialization checks are done in the following NSIS header file !insertmacro MediaPortalOperatingSystemCheck !insertmacro MediaPortalAdminCheck Copied: trunk/plugins/IR Server Suite/setup/include/SystemRegistry.nsh (from rev 3297, trunk/plugins/IR Server Suite/setup/include/IrssSystemRegistry.nsh) =================================================================== --- trunk/plugins/IR Server Suite/setup/include/SystemRegistry.nsh (rev 0) +++ trunk/plugins/IR Server Suite/setup/include/SystemRegistry.nsh 2009-12-24 07:36:26 UTC (rev 3298) @@ -0,0 +1,52 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +/* + * Copyright (C) 2005-2009 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 + + +!ifndef IrssSystemRegistry_INCLUDED +!define IrssSystemRegistry_INCLUDED + +!define AutoRunPath 'HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"' + +!macro SetAutoRun name executablePath + WriteRegStr ${AutoRunPath} '${name}' '${executablePath}' +!macroend + +!macro RemoveAutoRun name + WriteRegStr ${AutoRunPath} '${name}' '' +!macroend + +!macro GetAutoRun name variable + ReadRegStr ${variable} ${AutoRunPath} '${name}' +!macroend + +!macro _IsAutoRun _a _b _t _f + !insertmacro _LOGICLIB_TEMP + + !insertmacro GetAutoRun `${_b}` $_LOGICLIB_TEMP + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` +!macroend +!define IsAutoRun `"" IsAutoRun` + +!endif # !IrssSystemRegistry_INCLUDED Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2009-12-23 12:28:56 UTC (rev 3297) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2009-12-24 07:36:26 UTC (rev 3298) @@ -137,7 +137,7 @@ !include "include\DumpLog.nsh" ;!include "include\FileAssociation.nsh" -!include "include\IrssSystemRegistry.nsh" +!include "include\SystemRegistry.nsh" !include "include\LanguageMacros.nsh" !define INSTALL_LOG_DIR "${COMMON_APPDATA}\logs" !include "include\LoggingMacros.nsh" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2010-11-18 18:46:39
|
Revision: 3958 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3958&view=rev Author: chef_koch Date: 2010-11-18 18:46:30 +0000 (Thu, 18 Nov 2010) Log Message: ----------- updated shared nsis headers Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh Added Paths: ----------- trunk/plugins/IR Server Suite/setup/KillProc-plugin/ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Plugin/ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Plugin/KillProcDLL.dll trunk/plugins/IR Server Suite/setup/KillProc-plugin/ReadMe.txt trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/Exam28.cpp trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.cpp trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsp trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsw trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.cpp trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.h trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.c trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.h trunk/plugins/IR Server Suite/setup/nsSCM-plugin/ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Plugin/ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Plugin/nsSCM.dll trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile.VS2008 trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/debug.h trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/exdll.h trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/nsSCM.cpp trunk/plugins/IR Server Suite/setup/nsSCM-plugin/readme.txt Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Plugin/KillProcDLL.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Plugin/KillProcDLL.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/ReadMe.txt =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/ReadMe.txt (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/ReadMe.txt 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,82 @@ +KillProcDLL \xA92003 by DITMan, based upon the KILL_PROC_BY_NAME function programmed by Ravi, reach him at: http://www.physiology.wisc.edu/ravi/ + + +-> Introduction + + This NSIS DLL Plug-In provides one function that has the ability to close any process running, without the need to have the 'class name' or 'window handle' you used to need when using the Windows API TerminateProcess or ExitProcess, just with the name of its .exe file. + + KillProc "process_name.exe" + + the parameter "process_name.exe" is passed through the stack, and the return code is stored in the $R0 variable. + +The meaning of the return codes is this: + + 0 = Process was successfully terminated + 603 = Process was not currently running + 604 = No permission to terminate process + 605 = Unable to load PSAPI.DLL + 602 = Unable to terminate process for some other reason + 606 = Unable to identify system type + 607 = Unsupported OS + 632 = Invalid process name + 700 = Unable to get procedure address from PSAPI.DLL + 701 = Unable to get process list, EnumProcesses failed + 702 = Unable to load KERNEL32.DLL + 703 = Unable to get procedure address from KERNEL32.DLL + 704 = CreateToolhelp32Snapshot failed + + +-> Usage with NSIS + + Just copy the 'KillProcDLL.dll' in your NSIS plugins directory, and call the function with one of the two suggested syntax in the NSIS documentation: + + KillProcDLL::KillProc "process_name.exe" + +OR + + ; Pre 2.0a4 syntax + SetOutPath $TEMP + GetTempFileName $8 + File /oname=$8 KillProcDLL.dll + Push "process_name.exe" + CallInstDLL KillProc + + then check out $R0 to get the return value if you need it. + + +-> Warning: + According to MSDN (MicroSoft Developers Network): + + The TerminateProcess function is used to unconditionally cause a process to exit. Use it only in extreme circumstances. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess. + + So use this DLL as your LAST and EXTREME option :) + + +-> Copyrights and all that stuff: + + The original source file for the KILL_PROC_BY_NAME function is provided, the file is: exam28.cpp, and it MUST BE in this zip file. + + You can redistribute this archive if you do it without changing anything on it, otherwise you're NOT allowed to do so. + + You may use this source code in any of your projects, while you keep all the files intact, otherwise you CAN NOT use this code. + + +-> Contact information: + +My homepage: + http://petra.uniovi.es/~i6948857/index.php + + +-> Greetings: + + First of all, thanks to Ravi for his great function... + Then all the winamp.com forums people who helped me doing this (kichik, Joost Verburg, Afrow UK...) + Last but not least, I want to devote this source code to my Girl, Natalia... :) + + + +Compiled in La Felguera, Spain, June-7th-2003 +while listening to 'The Cure - Greatest Hits' +(in Winamp 2.91, of course :D) + +\xB7-EOF-\xB7 \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/Exam28.cpp =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/Exam28.cpp (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/Exam28.cpp 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,335 @@ +// Exam28.cpp +// 9/21/2000 (rk) +// Last modified: 3/10/2002 (RK) +// test the routine KILL_PROC_BY_NAME to terminate a process + +#include <windows.h> +#include <tlhelp32.h> +#include <iostream.h> + +#ifdef BORLANDC + #include <string.h> + #include <ctype.h> +#endif + +int KILL_PROC_BY_NAME(const char *); + +int main(int argc,char *argv[]) +{ +// Terminate a running process + char szName[100]="notepad.exe"; // Name of process to terminate + int iRes; + + iRes=KILL_PROC_BY_NAME(szName); + + cout << "Result code=" << iRes << endl; + return 0; +} + +int KILL_PROC_BY_NAME(const char *szToTerminate) +// Created: 6/23/2000 (RK) +// Last modified: 3/10/2002 (RK) +// Please report any problems or bugs to ko...@ph... +// The latest version of this routine can be found at: +// http://www.neurophys.wisc.edu/ravi/software/killproc/ +// Terminate the process "szToTerminate" if it is currently running +// This works for Win/95/98/ME and also Win/NT/2000/XP +// The process name is case-insensitive, i.e. "notepad.exe" and "NOTEPAD.EXE" +// will both work (for szToTerminate) +// Return codes are as follows: +// 0 = Process was successfully terminated +// 603 = Process was not currently running +// 604 = No permission to terminate process +// 605 = Unable to load PSAPI.DLL +// 602 = Unable to terminate process for some other reason +// 606 = Unable to identify system type +// 607 = Unsupported OS +// 632 = Invalid process name +// 700 = Unable to get procedure address from PSAPI.DLL +// 701 = Unable to get process list, EnumProcesses failed +// 702 = Unable to load KERNEL32.DLL +// 703 = Unable to get procedure address from KERNEL32.DLL +// 704 = CreateToolhelp32Snapshot failed +// Change history: +// modified 3/8/2002 - Borland-C compatible if BORLANDC is defined as +// suggested by Bob Christensen +// modified 3/10/2002 - Removed memory leaks as suggested by +// Jonathan Richard-Brochu (handles to Proc and Snapshot +// were not getting closed properly in some cases) +{ + BOOL bResult,bResultm; + DWORD aiPID[1000],iCb=1000,iNumProc,iV2000=0; + DWORD iCbneeded,i,iFound=0; + char szName[MAX_PATH],szToTermUpper[MAX_PATH]; + HANDLE hProc,hSnapShot,hSnapShotm; + OSVERSIONINFO osvi; + HINSTANCE hInstLib; + int iLen,iLenP,indx; + HMODULE hMod; + PROCESSENTRY32 procentry; + MODULEENTRY32 modentry; + + // Transfer Process name into "szToTermUpper" and + // convert it to upper case + iLenP=strlen(szToTerminate); + if(iLenP<1 || iLenP>MAX_PATH) return 632; + for(indx=0;indx<iLenP;indx++) + szToTermUpper[indx]=toupper(szToTerminate[indx]); + szToTermUpper[iLenP]=0; + + // PSAPI Function Pointers. + BOOL (WINAPI *lpfEnumProcesses)( DWORD *, DWORD cb, DWORD * ); + BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *, + DWORD, LPDWORD ); + DWORD (WINAPI *lpfGetModuleBaseName)( HANDLE, HMODULE, + LPTSTR, DWORD ); + + // ToolHelp Function Pointers. + HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD,DWORD) ; + BOOL (WINAPI *lpfProcess32First)(HANDLE,LPPROCESSENTRY32) ; + BOOL (WINAPI *lpfProcess32Next)(HANDLE,LPPROCESSENTRY32) ; + BOOL (WINAPI *lpfModule32First)(HANDLE,LPMODULEENTRY32) ; + BOOL (WINAPI *lpfModule32Next)(HANDLE,LPMODULEENTRY32) ; + + // First check what version of Windows we're in + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + bResult=GetVersionEx(&osvi); + if(!bResult) // Unable to identify system version + return 606; + + // At Present we only support Win/NT/2000/XP or Win/9x/ME + if((osvi.dwPlatformId != VER_PLATFORM_WIN32_NT) && + (osvi.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)) + return 607; + + if(osvi.dwPlatformId==VER_PLATFORM_WIN32_NT) + { + // Win/NT or 2000 or XP + + // Load library and get the procedures explicitly. We do + // this so that we don't have to worry about modules using + // this code failing to load under Windows 9x, because + // it can't resolve references to the PSAPI.DLL. + hInstLib = LoadLibraryA("PSAPI.DLL"); + if(hInstLib == NULL) + return 605; + + // Get procedure addresses. + lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*)) + GetProcAddress( hInstLib, "EnumProcesses" ) ; + lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *, + DWORD, LPDWORD)) GetProcAddress( hInstLib, + "EnumProcessModules" ) ; + lpfGetModuleBaseName =(DWORD (WINAPI *)(HANDLE, HMODULE, + LPTSTR, DWORD )) GetProcAddress( hInstLib, + "GetModuleBaseNameA" ) ; + + if(lpfEnumProcesses == NULL || + lpfEnumProcessModules == NULL || + lpfGetModuleBaseName == NULL) + { + FreeLibrary(hInstLib); + return 700; + } + + bResult=lpfEnumProcesses(aiPID,iCb,&iCbneeded); + if(!bResult) + { + // Unable to get process list, EnumProcesses failed + FreeLibrary(hInstLib); + return 701; + } + + // How many processes are there? + iNumProc=iCbneeded/sizeof(DWORD); + + // Get and match the name of each process + for(i=0;i<iNumProc;i++) + { + // Get the (module) name for this process + + strcpy(szName,"Unknown"); + // First, get a handle to the process + hProc=OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE, + aiPID[i]); + // Now, get the process name + if(hProc) + { + if(lpfEnumProcessModules(hProc,&hMod,sizeof(hMod),&iCbneeded) ) + { + iLen=lpfGetModuleBaseName(hProc,hMod,szName,MAX_PATH); + } + } + CloseHandle(hProc); + // We will match regardless of lower or upper case +#ifdef BORLANDC + if(strcmp(strupr(szName),szToTermUpper)==0) +#else + if(strcmp(_strupr(szName),szToTermUpper)==0) +#endif + { + // Process found, now terminate it + iFound=1; + // First open for termination + hProc=OpenProcess(PROCESS_TERMINATE,FALSE,aiPID[i]); + if(hProc) + { + if(TerminateProcess(hProc,0)) + { + // process terminated + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 0; + } + else + { + // Unable to terminate process + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 602; + } + } + else + { + // Unable to open process for termination + FreeLibrary(hInstLib); + return 604; + } + } + } + } + + if(osvi.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) + { + // Win/95 or 98 or ME + + hInstLib = LoadLibraryA("Kernel32.DLL"); + if( hInstLib == NULL ) + return 702; + + // Get procedure addresses. + // We are linking to these functions of Kernel32 + // explicitly, because otherwise a module using + // this code would fail to load under Windows NT, + // which does not have the Toolhelp32 + // functions in the Kernel 32. + lpfCreateToolhelp32Snapshot= + (HANDLE(WINAPI *)(DWORD,DWORD)) + GetProcAddress( hInstLib, + "CreateToolhelp32Snapshot" ) ; + lpfProcess32First= + (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) + GetProcAddress( hInstLib, "Process32First" ) ; + lpfProcess32Next= + (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) + GetProcAddress( hInstLib, "Process32Next" ) ; + lpfModule32First= + (BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32)) + GetProcAddress( hInstLib, "Module32First" ) ; + lpfModule32Next= + (BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32)) + GetProcAddress( hInstLib, "Module32Next" ) ; + if( lpfProcess32Next == NULL || + lpfProcess32First == NULL || + lpfModule32Next == NULL || + lpfModule32First == NULL || + lpfCreateToolhelp32Snapshot == NULL ) + { + FreeLibrary(hInstLib); + return 703; + } + + // The Process32.. and Module32.. routines return names in all uppercase + + // Get a handle to a Toolhelp snapshot of all the systems processes. + + hSnapShot = lpfCreateToolhelp32Snapshot( + TH32CS_SNAPPROCESS, 0 ) ; + if( hSnapShot == INVALID_HANDLE_VALUE ) + { + FreeLibrary(hInstLib); + return 704; + } + + // Get the first process' information. + procentry.dwSize = sizeof(PROCESSENTRY32); + bResult=lpfProcess32First(hSnapShot,&procentry); + + // While there are processes, keep looping and checking. + while(bResult) + { + // Get a handle to a Toolhelp snapshot of this process. + hSnapShotm = lpfCreateToolhelp32Snapshot( + TH32CS_SNAPMODULE, procentry.th32ProcessID) ; + if( hSnapShotm == INVALID_HANDLE_VALUE ) + { + CloseHandle(hSnapShot); + FreeLibrary(hInstLib); + return 704; + } + // Get the module list for this process + modentry.dwSize=sizeof(MODULEENTRY32); + bResultm=lpfModule32First(hSnapShotm,&modentry); + + // While there are modules, keep looping and checking + while(bResultm) + { + if(strcmp(modentry.szModule,szToTermUpper)==0) + { + // Process found, now terminate it + iFound=1; + // First open for termination + hProc=OpenProcess(PROCESS_TERMINATE,FALSE,procentry.th32ProcessID); + if(hProc) + { + if(TerminateProcess(hProc,0)) + { + // process terminated + CloseHandle(hSnapShotm); + CloseHandle(hSnapShot); + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 0; + } + else + { + // Unable to terminate process + CloseHandle(hSnapShotm); + CloseHandle(hSnapShot); + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 602; + } + } + else + { + // Unable to open process for termination + CloseHandle(hSnapShotm); + CloseHandle(hSnapShot); + FreeLibrary(hInstLib); + return 604; + } + } + else + { // Look for next modules for this process + modentry.dwSize=sizeof(MODULEENTRY32); + bResultm=lpfModule32Next(hSnapShotm,&modentry); + } + } + + //Keep looking + CloseHandle(hSnapShotm); + procentry.dwSize = sizeof(PROCESSENTRY32); + bResult = lpfProcess32Next(hSnapShot,&procentry); + } + CloseHandle(hSnapShot); + } + if(iFound==0) + { + FreeLibrary(hInstLib); + return 603; + } + FreeLibrary(hInstLib); + return 0; +} + Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.cpp =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.cpp (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.cpp 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,364 @@ +// +// KillProcDLL. \xA92003 by DITMan, based upon the KILL_PROC_BY_NAME function +// programmed by Ravi, reach him at: http://www.physiology.wisc.edu/ravi/ +// +// You may use this source code in any of your projects, while you keep this +// header intact, otherwise you CAN NOT use this code. +// +// My homepage: +// http://petra.uniovi.es/~i6948857/index.php +// + +#include "stdafx.h" + +using namespace std; + +HINSTANCE g_hInstance; +HWND g_hwndParent; + +BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) +{ + g_hInstance=(struct HINSTANCE__ *)hInst; + return TRUE; +} + +int KILL_PROC_BY_NAME(const char *szToTerminate) +// Created: 6/23/2000 (RK) +// Last modified: 3/10/2002 (RK) +// Please report any problems or bugs to ko...@ph... +// The latest version of this routine can be found at: +// http://www.neurophys.wisc.edu/ravi/software/killproc/ +// Terminate the process "szToTerminate" if it is currently running +// This works for Win/95/98/ME and also Win/NT/2000/XP +// The process name is case-insensitive, i.e. "notepad.exe" and "NOTEPAD.EXE" +// will both work (for szToTerminate) +// Return codes are as follows: +// 0 = Process was successfully terminated +// 603 = Process was not currently running +// 604 = No permission to terminate process +// 605 = Unable to load PSAPI.DLL +// 602 = Unable to terminate process for some other reason +// 606 = Unable to identify system type +// 607 = Unsupported OS +// 632 = Invalid process name +// 700 = Unable to get procedure address from PSAPI.DLL +// 701 = Unable to get process list, EnumProcesses failed +// 702 = Unable to load KERNEL32.DLL +// 703 = Unable to get procedure address from KERNEL32.DLL +// 704 = CreateToolhelp32Snapshot failed +// Change history: +// modified 3/8/2002 - Borland-C compatible if BORLANDC is defined as +// suggested by Bob Christensen +// modified 3/10/2002 - Removed memory leaks as suggested by +// Jonathan Richard-Brochu (handles to Proc and Snapshot +// were not getting closed properly in some cases) +{ + BOOL bResult,bResultm; + DWORD aiPID[1000],iCb=1000,iNumProc,iV2000=0; + DWORD iCbneeded,i,iFound=0; + char szName[MAX_PATH],szToTermUpper[MAX_PATH]; + HANDLE hProc,hSnapShot,hSnapShotm; + OSVERSIONINFO osvi; + HINSTANCE hInstLib; + int iLen,iLenP,indx; + HMODULE hMod; + PROCESSENTRY32 procentry; + MODULEENTRY32 modentry; + + // Transfer Process name into "szToTermUpper" and + // convert it to upper case + iLenP=strlen(szToTerminate); + if(iLenP<1 || iLenP>MAX_PATH) return 632; + for(indx=0;indx<iLenP;indx++) + szToTermUpper[indx]=toupper(szToTerminate[indx]); + szToTermUpper[iLenP]=0; + + // PSAPI Function Pointers. + BOOL (WINAPI *lpfEnumProcesses)( DWORD *, DWORD cb, DWORD * ); + BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *, + DWORD, LPDWORD ); + DWORD (WINAPI *lpfGetModuleBaseName)( HANDLE, HMODULE, + LPTSTR, DWORD ); + + // ToolHelp Function Pointers. + HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD,DWORD) ; + BOOL (WINAPI *lpfProcess32First)(HANDLE,LPPROCESSENTRY32) ; + BOOL (WINAPI *lpfProcess32Next)(HANDLE,LPPROCESSENTRY32) ; + BOOL (WINAPI *lpfModule32First)(HANDLE,LPMODULEENTRY32) ; + BOOL (WINAPI *lpfModule32Next)(HANDLE,LPMODULEENTRY32) ; + + // First check what version of Windows we're in + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + bResult=GetVersionEx(&osvi); + if(!bResult) // Unable to identify system version + return 606; + + // At Present we only support Win/NT/2000/XP or Win/9x/ME + if((osvi.dwPlatformId != VER_PLATFORM_WIN32_NT) && + (osvi.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)) + return 607; + + if(osvi.dwPlatformId==VER_PLATFORM_WIN32_NT) + { + // Win/NT or 2000 or XP + + // Load library and get the procedures explicitly. We do + // this so that we don't have to worry about modules using + // this code failing to load under Windows 9x, because + // it can't resolve references to the PSAPI.DLL. + hInstLib = LoadLibraryA("PSAPI.DLL"); + if(hInstLib == NULL) + return 605; + + // Get procedure addresses. + lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*)) + GetProcAddress( hInstLib, "EnumProcesses" ) ; + lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *, + DWORD, LPDWORD)) GetProcAddress( hInstLib, + "EnumProcessModules" ) ; + lpfGetModuleBaseName =(DWORD (WINAPI *)(HANDLE, HMODULE, + LPTSTR, DWORD )) GetProcAddress( hInstLib, + "GetModuleBaseNameA" ) ; + + if(lpfEnumProcesses == NULL || + lpfEnumProcessModules == NULL || + lpfGetModuleBaseName == NULL) + { + FreeLibrary(hInstLib); + return 700; + } + + bResult=lpfEnumProcesses(aiPID,iCb,&iCbneeded); + if(!bResult) + { + // Unable to get process list, EnumProcesses failed + FreeLibrary(hInstLib); + return 701; + } + + // How many processes are there? + iNumProc=iCbneeded/sizeof(DWORD); + + // Get and match the name of each process + for(i=0;i<iNumProc;i++) + { + // Get the (module) name for this process + + strcpy(szName,"Unknown"); + // First, get a handle to the process + hProc=OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE, + aiPID[i]); + // Now, get the process name + if(hProc) + { + if(lpfEnumProcessModules(hProc,&hMod,sizeof(hMod),&iCbneeded) ) + { + iLen=lpfGetModuleBaseName(hProc,hMod,szName,MAX_PATH); + } + } + CloseHandle(hProc); + // We will match regardless of lower or upper case +#ifdef BORLANDC + if(strcmp(strupr(szName),szToTermUpper)==0) +#else + if(strcmp(_strupr(szName),szToTermUpper)==0) +#endif + { + // Process found, now terminate it + iFound=1; + // First open for termination + hProc=OpenProcess(PROCESS_TERMINATE,FALSE,aiPID[i]); + if(hProc) + { + if(TerminateProcess(hProc,0)) + { + // process terminated + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 0; + } + else + { + // Unable to terminate process + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 602; + } + } + else + { + // Unable to open process for termination + FreeLibrary(hInstLib); + return 604; + } + } + } + } + + if(osvi.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) + { + // Win/95 or 98 or ME + + hInstLib = LoadLibraryA("Kernel32.DLL"); + if( hInstLib == NULL ) + return 702; + + // Get procedure addresses. + // We are linking to these functions of Kernel32 + // explicitly, because otherwise a module using + // this code would fail to load under Windows NT, + // which does not have the Toolhelp32 + // functions in the Kernel 32. + lpfCreateToolhelp32Snapshot= + (HANDLE(WINAPI *)(DWORD,DWORD)) + GetProcAddress( hInstLib, + "CreateToolhelp32Snapshot" ) ; + lpfProcess32First= + (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) + GetProcAddress( hInstLib, "Process32First" ) ; + lpfProcess32Next= + (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) + GetProcAddress( hInstLib, "Process32Next" ) ; + lpfModule32First= + (BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32)) + GetProcAddress( hInstLib, "Module32First" ) ; + lpfModule32Next= + (BOOL(WINAPI *)(HANDLE,LPMODULEENTRY32)) + GetProcAddress( hInstLib, "Module32Next" ) ; + if( lpfProcess32Next == NULL || + lpfProcess32First == NULL || + lpfModule32Next == NULL || + lpfModule32First == NULL || + lpfCreateToolhelp32Snapshot == NULL ) + { + FreeLibrary(hInstLib); + return 703; + } + + // The Process32.. and Module32.. routines return names in all uppercase + + // Get a handle to a Toolhelp snapshot of all the systems processes. + + hSnapShot = lpfCreateToolhelp32Snapshot( + TH32CS_SNAPPROCESS, 0 ) ; + if( hSnapShot == INVALID_HANDLE_VALUE ) + { + FreeLibrary(hInstLib); + return 704; + } + + // Get the first process' information. + procentry.dwSize = sizeof(PROCESSENTRY32); + bResult=lpfProcess32First(hSnapShot,&procentry); + + // While there are processes, keep looping and checking. + while(bResult) + { + // Get a handle to a Toolhelp snapshot of this process. + hSnapShotm = lpfCreateToolhelp32Snapshot( + TH32CS_SNAPMODULE, procentry.th32ProcessID) ; + if( hSnapShotm == INVALID_HANDLE_VALUE ) + { + CloseHandle(hSnapShot); + FreeLibrary(hInstLib); + return 704; + } + // Get the module list for this process + modentry.dwSize=sizeof(MODULEENTRY32); + bResultm=lpfModule32First(hSnapShotm,&modentry); + + // While there are modules, keep looping and checking + while(bResultm) + { + if(strcmp(modentry.szModule,szToTermUpper)==0) + { + // Process found, now terminate it + iFound=1; + // First open for termination + hProc=OpenProcess(PROCESS_TERMINATE,FALSE,procentry.th32ProcessID); + if(hProc) + { + if(TerminateProcess(hProc,0)) + { + // process terminated + CloseHandle(hSnapShotm); + CloseHandle(hSnapShot); + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 0; + } + else + { + // Unable to terminate process + CloseHandle(hSnapShotm); + CloseHandle(hSnapShot); + CloseHandle(hProc); + FreeLibrary(hInstLib); + return 602; + } + } + else + { + // Unable to open process for termination + CloseHandle(hSnapShotm); + CloseHandle(hSnapShot); + FreeLibrary(hInstLib); + return 604; + } + } + else + { // Look for next modules for this process + modentry.dwSize=sizeof(MODULEENTRY32); + bResultm=lpfModule32Next(hSnapShotm,&modentry); + } + } + + //Keep looking + CloseHandle(hSnapShotm); + procentry.dwSize = sizeof(PROCESSENTRY32); + bResult = lpfProcess32Next(hSnapShot,&procentry); + } + CloseHandle(hSnapShot); + } + if(iFound==0) + { + FreeLibrary(hInstLib); + return 603; + } + FreeLibrary(hInstLib); + return 0; +} + + +// +// This is the only exported function, KillProc. It receives the name +// of a process through the NSIS stack. The return-value from the +// KILL_PROC_BY_NAME function is stored in the $R0 variable, so push +// it before calling KillProc function if you don't want to lose the +// data that R0 could contain. +// +// You can call this function in NSIS like this: +// +// KillProcDLL::KillProc "process_name.exe" +// +// example: +// KillProcDLL::KillProc "msnmsgr.exe" +// would close MSN Messenger if running, and return 0 in R0 +// if it's not running, it would return 603. +// +// --------------------------- ---- --- -- - + +extern "C" __declspec(dllexport) void KillProc(HWND hwndParent, int string_size, + char *variables, stack_t **stacktop) +{ + char parameter[200]; + char temp[10]; + int value; + g_hwndParent=hwndParent; + EXDLL_INIT(); + { + popstring(parameter); + value=KILL_PROC_BY_NAME(parameter); + setuservariable(INST_R0, itoa(value, temp, 10)); + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsp =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsp (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsp 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,122 @@ +# Microsoft Developer Studio Project File - Name="KillProcDLL" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=KillProcDLL - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "KillProcDLL.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "KillProcDLL.mak" CFG="KillProcDLL - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "KillProcDLL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "KillProcDLL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "KillProcDLL - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KILLPROCDLL_EXPORTS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KILLPROCDLL_EXPORTS" /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x40a /d "NDEBUG" +# ADD RSC /l 0x40a /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 + +!ELSEIF "$(CFG)" == "KillProcDLL - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KILLPROCDLL_EXPORTS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "KILLPROCDLL_EXPORTS" /Yu"stdafx.h" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x40a /d "_DEBUG" +# ADD RSC /l 0x40a /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "KillProcDLL - Win32 Release" +# Name "KillProcDLL - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\KillProcDLL.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\exdll.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsw =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsw (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/KillProcDLL.dsw 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "KillProcDLL"=.\KillProcDLL.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.cpp =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.cpp (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.cpp 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// KillProcDLL.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.h =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.h (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/StdAfx.h 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,34 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__780690DC_E128_403D_BC07_780D1B2CC101__INCLUDED_) +#define AFX_STDAFX_H__780690DC_E128_403D_BC07_780D1B2CC101__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +#include <windows.h> + +#include <string> // String management... + +//From exam28.cpp +#include <tlhelp32.h> +#include <iostream.h> + +#ifdef BORLANDC + #include <string.h> + #include <ctype.h> +#endif + +//To make it a NSIS Plug-In +#include "exdll.h" + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__780690DC_E128_403D_BC07_780D1B2CC101__INCLUDED_) Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.c =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.c (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.c 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,37 @@ +#include <windows.h> +#include "exdll.h" + +HINSTANCE g_hInstance; + +HWND g_hwndParent; + +void __declspec(dllexport) myFunction(HWND hwndParent, int string_size, + char *variables, stack_t **stacktop) +{ + g_hwndParent=hwndParent; + + EXDLL_INIT(); + + + // note if you want parameters from the stack, pop them off in order. + // i.e. if you are called via exdll::myFunction file.dat poop.dat + // calling popstring() the first time would give you file.dat, + // and the second time would give you poop.dat. + // you should empty the stack of your parameters, and ONLY your + // parameters. + + // do your stuff here + { + char buf[1024]; + wsprintf(buf,"$0=%s\n",getuservariable(INST_0)); + MessageBox(g_hwndParent,buf,0,MB_OK); + } +} + + + +BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) +{ + g_hInstance=hInst; + return TRUE; +} Added: trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.h =================================================================== --- trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.h (rev 0) +++ trunk/plugins/IR Server Suite/setup/KillProc-plugin/Source/exdll.h 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,97 @@ +#ifndef _EXDLL_H_ +#define _EXDLL_H_ + +// only include this file from one place in your DLL. +// (it is all static, if you use it in two places it will fail) + +#define EXDLL_INIT() { \ + g_stringsize=string_size; \ + g_stacktop=stacktop; \ + g_variables=variables; } + +// For page showing plug-ins +#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8) +#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd) +#define NOTIFY_BYE_BYE 'x' + +typedef struct _stack_t { + struct _stack_t *next; + char text[1]; // this should be the length of string_size +} stack_t; + + +static unsigned int g_stringsize; +static stack_t **g_stacktop; +static char *g_variables; + +static int popstring(char *str); // 0 on success, 1 on empty stack +static void pushstring(char *str); + +enum +{ +INST_0, // $0 +INST_1, // $1 +INST_2, // $2 +INST_3, // $3 +INST_4, // $4 +INST_5, // $5 +INST_6, // $6 +INST_7, // $7 +INST_8, // $8 +INST_9, // $9 +INST_R0, // $R0 +INST_R1, // $R1 +INST_R2, // $R2 +INST_R3, // $R3 +INST_R4, // $R4 +INST_R5, // $R5 +INST_R6, // $R6 +INST_R7, // $R7 +INST_R8, // $R8 +INST_R9, // $R9 +INST_CMDLINE, // $CMDLINE +INST_INSTDIR, // $INSTDIR +INST_OUTDIR, // $OUTDIR +INST_EXEDIR, // $EXEDIR +INST_LANG, // $LANGUAGE +__INST_LAST +}; + + +// utility functions (not required but often useful) +static int popstring(char *str) +{ + stack_t *th; + if (!g_stacktop || !*g_stacktop) return 1; + th=(*g_stacktop); + lstrcpy(str,th->text); + *g_stacktop = th->next; + GlobalFree((HGLOBAL)th); + return 0; +} + +static void pushstring(char *str) +{ + stack_t *th; + if (!g_stacktop) return; + th=(stack_t*)GlobalAlloc(GPTR,sizeof(stack_t)+g_stringsize); + lstrcpyn(th->text,str,g_stringsize); + th->next=*g_stacktop; + *g_stacktop=th; +} + +static char *getuservariable(int varnum) +{ + if (varnum < 0 || varnum >= __INST_LAST) return NULL; + return g_variables+varnum*g_stringsize; +} + +static void setuservariable(int varnum, char *var) +{ + if (var != NULL && varnum >= 0 && varnum < __INST_LAST) + lstrcpy(g_variables + varnum*g_stringsize, var); +} + + + +#endif//_EXDLL_H_ \ No newline at end of file Modified: trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh 2010-11-18 18:44:08 UTC (rev 3957) +++ trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh 2010-11-18 18:46:30 UTC (rev 3958) @@ -67,9 +67,7 @@ Var MPdir.Language Var MPdir.Database Var MPdir.Thumbs -Var MPdir.Weather Var MPdir.Cache -Var MPdir.BurnerSupport #*************************** #*************************** @@ -130,9 +128,7 @@ StrCpy $MPdir.Language "$MPdir.Config\language" StrCpy $MPdir.Database "$MPdir.Config\database" StrCpy $MPdir.Thumbs "$MPdir.Config\thumbs" - StrCpy $MPdir.Weather "$MPdir.Base\weather" StrCpy $MPdir.Cache "$MPdir.Config\cache" - StrCpy $MPdir.BurnerSupport "$MPdir.Base\Burner" !macroend @@ -175,9 +171,7 @@ ${ReadMPdir} Language ${ReadMPdir} Database ${ReadMPdir} Thumbs - ${ReadMPdir} Weather ${ReadMPdir} Cache - ${ReadMPdir} BurnerSupport StrCpy $0 "0" @@ -248,9 +242,7 @@ ${LOG_TEXT} "INFO" " Language: $MPdir.Language" ${LOG_TEXT} "INFO" " Database: $MPdir.Database" ${LOG_TEXT} "INFO" " Thumbs: $MPdir.Thumbs" - ${LOG_TEXT} "INFO" " Weather: $MPdir.Weather" ${LOG_TEXT} "INFO" " Cache: $MPdir.Cache" - ${LOG_TEXT} "INFO" " BurnerSupport: $MPdir.BurnerSupport" Pop $0 Modified: trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh 2010-11-18 18:44:08 UTC (rev 3957) +++ trunk/plugins/IR Server Suite/setup/include/ProcessMacros.nsh 2010-11-18 18:46:30 UTC (rev 3958) @@ -24,6 +24,9 @@ !include LogicLib.nsh !include "${svn_InstallScripts}\include\LoggingMacros.nsh" +!AddPluginDir "${svn_InstallScripts}\nsSCM-plugin\Plugin" +!AddPluginDir "${svn_InstallScripts}\KillProc-plugin\Plugin" + #*************************** #*************************** @@ -36,34 +39,17 @@ ${LOG_TEXT} "INFO" "KillProcess: ${Process}" - StrCpy $R1 1 ; set counter to 1 - ${Do} + KillProcDLL::KillProc "${Process}" - nsExec::Exec '"taskkill" /F /IM "${Process}"' + ${If} $R0 == "0" + ${LOG_TEXT} "INFO" "KillProcess: ${Process} was killed successfully." + ${ElseIf} $R0 == "603" + ${LOG_TEXT} "INFO" "KillProcess: ${Process} is not running." + ${Else} + ${LOG_TEXT} "INFO" "KillProcess: Unable to kill ${Process} (error $R0)." + Abort "Unable to kill ${Process} (error $R0). Installation aborted." + ${EndIF} - Pop $0 - - ${Select} $0 - ${Case} "0" - ${LOG_TEXT} "INFO" "KillProcess: ${Process} was killed successfully." - ${ExitDo} - ${Case} "128" - ${LOG_TEXT} "INFO" "KillProcess: ${Process} is not running." - ${ExitDo} - ${CaseElse} - - ${LOG_TEXT} "ERROR" "KillProcess: Unknown result: $0" - IntOp $R1 $R1 + 1 ; increase retry-counter +1 - ${If} $R1 > 5 ; try max. 5 times - ${ExitDo} - ${Else} - ${LOG_TEXT} "INFO" "KillProcess: Trying again. $R1/5" - ${EndIf} - - ${EndSelect} - ${Loop} - - !verbose pop !macroend @@ -75,34 +61,42 @@ ${LOG_TEXT} "INFO" "StopService: ${Service}" - StrCpy $R1 1 ; set counter to 1 - ${Do} + nsSCM::QueryStatus /NOUNLOAD "${Service}" + Pop $0 + Pop $1 - nsExec::Exec 'net stop "${Service}"' + ${IfNot} $1 = 1 + ${LOG_TEXT} "INFO" "StopService: Trying to stop ${Service}..." + + nsSCM::Stop /NOUNLOAD "${Service}" Pop $0 - ${Select} $0 - ${Case} "0" - ${LOG_TEXT} "INFO" "StopService: ${Service} was stopped successfully." - ${ExitDo} - ${Case} "2" - ${LOG_TEXT} "INFO" "StopService: ${Service} is not started." - ${ExitDo} - ${CaseElse} + ${If} $0 == "error" + ${LOG_TEXT} "INFO" "StopService: Unable to stop ${Service} (error $1)." + Abort "Unable to stop ${Service} (error $1). Installation aborted." + ${Else} - ${LOG_TEXT} "ERROR" "StopService: Unknown result: $0" - IntOp $R1 $R1 + 1 ; increase retry-counter +1 - ${If} $R1 > 5 ; try max. 5 times - ${ExitDo} - ${Else} - ${LOG_TEXT} "INFO" "StopService: Trying again. $R1/5" - ${EndIf} + StrCpy $R0 0 + ${Do} + ${If} $R0 > 0 + ${LOG_TEXT} "INFO" "StopService: sleeping 20ms and recheking service status..." + Sleep 20 + ${EndIF} - ${EndSelect} - ${Loop} + IntOp $R0 $R0 + 1 + nsSCM::QueryStatus /NOUNLOAD "${Service}" + Pop $0 + Pop $1 + ${LoopUntil} $1 = 1 + ${LOG_TEXT} "INFO" "StopService: ${Service} was stopped successfully." + ${EndIF} + ${Else} + ${LOG_TEXT} "INFO" "StopService: ${Service} is already stopped." + ${EndIf} + !verbose pop !macroend @@ -149,7 +143,7 @@ ${Else} - ${LOG_TEXT} "INFO" "RenameDirectory: Directory does not exist. No need to rename: ${DirPath}" + ${LOG_TEXT} "INFO" "RenameDirectory: Directory does not exist. No need to rename: ${DirPath}" ${EndIf} Added: trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Plugin/nsSCM.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Plugin/nsSCM.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile =================================================================== --- trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile (rev 0) +++ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,67 @@ +# Makefile for use with MSVC 6.0 for build win32 executable. + +DEBUG = 0 + +CC = cl.exe +CXX = $(CC) +AR = lib.exe +RM = del +LINK = link.exe +NMS = "C:\Program Files\Compuware\DriverStudio\SoftICE\nmsym.exe" + +CFLAGS = -nologo -c -ML -W3 -WX -GX +LFLAGS = -nologo -machine:i386 -incremental:no -nodefaultlib -pdb:none +NMSOPT = /TRANSLATE:SOURCE,PACKAGE,ALWAYS /SOURCE:.; + +LFLAGS = $(LFLAGS) -subsystem:windows -dll -entry:"_DllMainCRTStartup" -opt:nowin98 + +!if "$(DEBUG)" == "1" +CFLAGS = $(CFLAGS) -D"_DEBUG" -D"DEBUG" -Z7 -Oid +LFLAGS = $(LFLAGS) -debug -debug:notmapped,FULL -debugtype:cv +!else +CFLAGS = $(CFLAGS) -D"NDEBUG" -D"RELEASE" -O1 -GD -GF -LD -Zl +LFLAGS = $(LFLAGS) -release -debug:none +!endif + +PROJECT = nsSCM + +LIBRARY_OBJS = +LIBLIST = libc.lib oldnames.lib advapi32.lib kernel32.lib user32.lib + +.SUFFIXES: .c .h .cpp .obj $(SUFFIXES) + +all: $(PROJECT).dll + +clean: + if exist *.obj $(RM) *.obj + if exist *.lib $(RM) *.lib + if exist *.dll $(RM) *.dll + if exist *.exe $(RM) *.exe + if exist *.exp $(RM) *.exp + if exist *.pdb $(RM) *.pdb + if exist *.nms $(RM) *.nms + @echo $(PROJECT) cleaned... + +$(PROJECT).dll: Makefile $(PROJECT).obj $(LIBRARY_OBJS) + $(LINK) $(LFLAGS) -out:$@ $(PROJECT).obj $(LIBRARY_OBJS) $(LIBLIST) +!if "$(DEBUG)" == "1" + $(NMS) $(NMSOPT) $@ + $(NMS) /SYM:$(PROJECT).NMS; +!endif + +lib: $(LIBRARY_OBJS) + $(AR) -out:$(PROJECT).lib $(LIBRARY_OBJS) + +src zip: + @echo ------------------------------------------------------------------ + @echo Backing up to archive $(PROJECT).zip + @echo ------------------------------------------------------------------ + @cd .. + -@zip.exe -ru9D $(PROJECT).zip $(PROJECT) -x *.bak *.err *.exe *.exp *.lib *.dll *.map *.nms *.o *.obj *.rar *.scc + @cd $(PROJECT) + +.c.obj: + $(CXX) $(CFLAGS) -Fo$* -c $< + +.cpp.obj: + $(CXX) $(CFLAGS) -Fo$* -c $< Added: trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile.VS2008 =================================================================== --- trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile.VS2008 (rev 0) +++ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/Makefile.VS2008 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,67 @@ +# Makefile for use with MSVC 6.0 for build win32 executable. + +DEBUG = 0 + +CC = cl.exe +CXX = $(CC) +AR = lib.exe +RM = del +LINK = link.exe +NMS = "C:\Program Files\Compuware\DriverStudio\SoftICE\nmsym.exe" + +CFLAGS = -nologo -c -W3 -WX -EHsc +LFLAGS = -nologo -machine:i386 -incremental:no -nodefaultlib -pdb:none +NMSOPT = /TRANSLATE:SOURCE,PACKAGE,ALWAYS /SOURCE:.; + +LFLAGS = $(LFLAGS) -subsystem:windows -dll -entry:"_DllMainCRTStartup" + +!if "$(DEBUG)" == "1" +CFLAGS = $(CFLAGS) -D"_DEBUG" -D"DEBUG" -Z7 -Oid +LFLAGS = $(LFLAGS) -debug -debug:notmapped,FULL -debugtype:cv +!else +CFLAGS = $(CFLAGS) -D"NDEBUG" -D"RELEASE" -O1 -GF -LD -Zl +LFLAGS = $(LFLAGS) -release -debug:none +!endif + +PROJECT = nsSCM + +LIBRARY_OBJS = +LIBLIST = libcmt.lib oldnames.lib advapi32.lib kernel32.lib user32.lib + +.SUFFIXES: .c .h .cpp .obj $(SUFFIXES) + +all: $(PROJECT).dll + +clean: + if exist *.obj $(RM) *.obj + if exist *.lib $(RM) *.lib + if exist *.dll $(RM) *.dll + if exist *.exe $(RM) *.exe + if exist *.exp $(RM) *.exp + if exist *.pdb $(RM) *.pdb + if exist *.nms $(RM) *.nms + @echo $(PROJECT) cleaned... + +$(PROJECT).dll: Makefile $(PROJECT).obj $(LIBRARY_OBJS) + $(LINK) $(LFLAGS) -out:$@ $(PROJECT).obj $(LIBRARY_OBJS) $(LIBLIST) +!if "$(DEBUG)" == "1" + $(NMS) $(NMSOPT) $@ + $(NMS) /SYM:$(PROJECT).NMS; +!endif + +lib: $(LIBRARY_OBJS) + $(AR) -out:$(PROJECT).lib $(LIBRARY_OBJS) + +src zip: + @echo ------------------------------------------------------------------ + @echo Backing up to archive $(PROJECT).zip + @echo ------------------------------------------------------------------ + @cd .. + -@zip.exe -ru9D $(PROJECT).zip $(PROJECT) -x *.bak *.err *.exe *.exp *.lib *.dll *.map *.nms *.o *.obj *.rar *.scc + @cd $(PROJECT) + +.c.obj: + $(CXX) $(CFLAGS) -Fo$* -c $< + +.cpp.obj: + $(CXX) $(CFLAGS) -Fo$* -c $< Added: trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/debug.h =================================================================== --- trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/debug.h (rev 0) +++ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/debug.h 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,40 @@ +/********************************************************************************************************* + * + * Module Name: debug.h + * + * Abstract: Debuging macroses + * + * Author: Vyacheslav I. Levtchenko (mail-to: sl...@r-..., sl...@el...) + * + * Revision History: 20.10.2003 started + * + * Classes, methods and structures: + * + * TODO: + * + *********************************************************************************************************/ + +#ifndef __DEBUG_H__ +#define __DEBUG_H__ + +#if (DEBUG) +# ifndef __GNUC__ +# define brk() {_asm int 3} +# else +# define brk() { asm ("int $3"); } +# endif +#else +# ifndef __GNUC__ +# define brk() {/* nothing */;} +# else +# define brk() {/* nothing */;} +# endif +#endif + +#if (TOTALDEBUG) +# define tbrk() brk() +#else +# define tbrk() +#endif + +#endif Added: trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/exdll.h =================================================================== --- trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/exdll.h (rev 0) +++ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/exdll.h 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,287 @@ +/********************************************************************************************************* + * + * Module Name: exdll.h + * + * Abstract: NSIS plugin common header + * + * Author: + * + * Modified: Vyacheslav I. Levtchenko (mail-to: sl...@r-..., sl...@el...) + * + * Revision History: 20.10.2003 started + * + * Classes, methods and structures: + * + * TODO: + * + *********************************************************************************************************/ + +#ifndef _EXDLL_H_ +#define _EXDLL_H_ + +// only include this file from one place in your DLL. +// (it is all static, if you use it in two places it will fail) + +#define EXDLL_INIT() \ +{ \ + g_stringsize=string_size; \ + g_stacktop=stacktop; \ + g_variables=variables; \ + brk (); } + +// For page showing plug-ins +#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8) +#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd) +#define NOTIFY_BYE_BYE 'x' + +#define NSISFunction(funcname) extern "C" void __declspec(dllexport) funcname(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) + +#define MALLOC(len) GlobalAlloc(GPTR, len); +#define FREE(mem) { if (mem) GlobalFree (mem), mem = NULL; } + +#define STRNEW() (char*)MALLOC((sizeof(char) * g_stringsize) + 1); +#define STRDEL(mem) FREE (mem); + +#define RET_ERROR() { clear_stack (); pushstring("error"); return; } +#define RET_SUCCESS() { clear_stack (); pushstring("success"); return; } +#define RET(rc) if (!rc) { RET_ERROR(); } else { RET_SUCCESS(); } + +#define RET_DWORD(rc, dd) \ +{ clear_stack (); \ + pushdword (dd); \ + if (!rc) pushstring("error"); \ + else pushstring("success");\ + return; } + +#define strcpy(x,y) lstrcpy(x,y) +#define strncpy(x,y,z) lstrcpyn(x,y,z) +#define strdup(x) STRDUP(x); +#define stricmp(x,y) lstrcmpi(x,y) + +enum +{ + INST_0, // $0 + INST_1, // $1 + INST_2, // $2 + INST_3, // $3 + INST_4, // $4 + INST_5, // $5 + INST_6, // $6 + INST_7, // $7 + INST_8, // $8 + INST_9, // $9 + INST_R0, // $R0 + INST_R1, // $R1 + INST_R2, // $R2 + INST_R3, // $R3 + INST_R4, // $R4 + INST_R5, // $R5 + INST_R6, // $R6 + INST_R7, // $R7 + INST_R8, // $R8 + INST_R9, // $R9 + INST_CMDLINE, // $CMDLINE + INST_INSTDIR, // $INSTDIR + INST_OUTDIR, // $OUTDIR + INST_EXEDIR, // $EXEDIR + INST_LANG, // $LANGUAGE + __INST_LAST +}; + +typedef struct _stack_t +{ + struct _stack_t *next; + char text[1]; // this should be the length of string_size +} stack_t; + +static unsigned int g_stringsize = 0; + +/* Call stack (LIFO) variables _cdecl sequence (right-left) */ +static stack_t **g_stacktop = NULL; + +/* Global variables array */ +static char *g_variables = NULL; + +void *operator new (unsigned int num_bytes) { return GlobalAlloc (GPTR, num_bytes); } +void operator delete (void *p) { if (p) GlobalFree(p), p = NULL; } + +// utility functions (not required but often useful) +// 0 on success, 1 on empty stack +static int popstring (char *str) +{ + stack_t *th; + + if (!g_stacktop + || !*g_stacktop) + return 1; + + th = *g_stacktop; + + lstrcpy (str, th->text); + *g_stacktop = th->next; + GlobalFree ((HGLOBAL)th); + + return 0; +} + +static void clear_stack (void) +{ + stack_t *th; + + while (g_stacktop + && *g_stacktop) + { + th = *g_stacktop; + *g_stacktop = th->next; + GlobalFree ((HGLOBAL)th); + } +} + +static void pushstring (const char *str) +{ + stack_t *th; + + if (!g_stacktop) + return; + + th = (stack_t*) GlobalAlloc (GPTR, sizeof(stack_t) + g_stringsize); + + lstrcpyn (th->text, str, g_stringsize); + th->next = *g_stacktop; + *g_stacktop = th; +} + +static void pushdword (DWORD dd) +{ + stack_t *th; + + if (!g_stacktop) + return; + + th = (stack_t*) GlobalAlloc (GPTR, sizeof(stack_t) + g_stringsize); + + wsprintf (th->text, "%d", dd); + th->next = *g_stacktop; + *g_stacktop = th; +} + +static char *getuservariable (int varnum) +{ + if (varnum < 0 + || varnum >= __INST_LAST) + return NULL; + + return g_variables + varnum * g_stringsize; +} + +static void setuservariable(int varnum, char *var) +{ + if (var != NULL + && varnum >= 0 + && varnum < __INST_LAST) + lstrcpy (g_variables + varnum * g_stringsize, var); +} + +static char *ns_strstr (const char *string, const char *strCharSet) +{ + size_t chklen, i; + char *s1, *s2; + + if (lstrlen (string) < lstrlen (strCharSet)) + return 0; + + if (!*strCharSet) + return (char*)string; + + chklen = lstrlen(string) - lstrlen(strCharSet); + + for (i = 0; i <= chklen; i++) + { + s1 = &((char*)string)[i]; + s2 = (char*)strCharSet; + + while (*s1++ == *s2++) + if (!*s2) + return &((char*)string)[i]; + } + + return 0; +} + +static unsigned int ns_atoi (char *s) +{ + unsigned int v = 0; + + if (*s == '0' && (s[1] == 'x' || s[1] == 'X')) + { + s+=2; + + for (;;) + { + int c=*s++; + + if (c >= '0' + && c <= '9') + c-='0'; + else + if (c >= 'a' + && c <= 'f') + c-='a'-10; + else + if (c >= 'A' + && c <= 'F') + c-='A'-10; + else + break; + + v <<= 4; + v+=c; + } + } + else + if (*s == '0' + && s[1] <= '7' + && s[1] >= '0') + { + s++; + + for (;;) + { + int c=*s++; + + if (c >= '0' + && c <= '7') + c-='0'; + else + break; + + v<<=3; + v+=c; + } + } + else + { + for (;;) + { + int c=*s++ - '0'; + + if (c < 0 + || c > 9) + break; + + v*=10; + v+=c; + } + } + + return (int)v; +} + +static char *STRDUP (const char *c) +{ + char *t = (char*) MALLOC (strlen(c) + 1); + strcpy (t,c); + return t; +} + +#endif //_EXDLL_H_ Added: trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/nsSCM.cpp =================================================================== --- trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/nsSCM.cpp (rev 0) +++ trunk/plugins/IR Server Suite/setup/nsSCM-plugin/Source/nsSCM.cpp 2010-11-18 18:46:30 UTC (rev 3958) @@ -0,0 +1,383 @@ +/********************************************************************************************************* + * + * Module Name: nsSCM.cpp + * + * Abstract: NSIS Service Control Manager + * + * Author: Vyacheslav I. Levtchenko (mail-to: sl...@r-..., sl...@el...) + * + * Revision History: 20.10.2003 started + * + * Classes, methods and structures: + * + * TODO: + * + *********************************************************************************************************/ + +#include <windows.h> + +#include "debug.h" +#include "exdll.h" + +static SC_HANDLE schSCManager = (SC_HANDLE)INVALID_HANDLE_VALUE; +#define CHECK_HANDLE(schSCManager) if (INVALID_HANDLE_VALUE == schSCManager) { RET_ERROR(); } + +#if 0 +// Service Types (Bit Mask) +#define SERVICE_KERNEL_DRIVER 0x00000001 +#define SERVICE_FILE_SYSTEM_DRIVER 0x00000002 +#define SERVICE_ADAPTER 0x00000004 +#define SERVICE_RECOGNIZER_DRIVER 0x00000008 + +#define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER | \ + SERVICE_FILE_SYSTEM_DRIVER | \ + SERVICE_RECOGNIZER_DRIVER) + +#define SERVICE_WIN32_OWN_PROCESS 0x00000010 +#define SERVICE_WIN32_SHARE_PROCESS 0x00000020 +#define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | \ + SERVICE_WIN32_SHARE_PROCESS) + +#define SERVICE_INTERACTIVE_PROCESS 0x00000100 + +#define SERVICE_TYPE_ALL (SERVICE_WIN32 | \ + SERVICE_ADAPTER | \ + SERVICE_DRIVER | \ + SERVICE_INTERACTIVE_PROCESS) + +// Start Type +#define SERVICE_BOOT_START 0x00000000 +#define SERVICE_SYSTEM_START 0x00000001 +#define SERVICE_AUTO_START 0x00000002 +#define SERVICE_DEMAND_START 0x00000003 +#define SERVICE_DISABLED 0x00000004 + +// Error control type +#define SERVICE_ERROR_IGNORE 0x00000000 +#define SERVICE_ERROR_NORMAL 0x00000001 +#define SERVICE_ERROR_SEVERE 0x00000002 +#define SERVICE_ERROR_CRITICAL 0x00000003 + +#endif + +// 1 str 2 str 3 num 4 num 5 str 6 str 7 str 8 str 9 str +// <name of service: startstop name> <name to display: display in SCM> <service type> <start type> <service's binary:filepath> <load order group: name> <dependencies: name> <account: name> <pass... [truncated message content] |
From: <che...@us...> - 2010-12-18 04:22:57
|
Revision: 4044 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4044&view=rev Author: chef_koch Date: 2010-12-18 03:20:43 +0000 (Sat, 18 Dec 2010) Log Message: ----------- updated install path for default input mapping updated mpdirs header to latest from mp svn Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh 2010-12-18 02:28:02 UTC (rev 4043) +++ trunk/plugins/IR Server Suite/setup/include/MediaPortalDirectories.nsh 2010-12-18 03:20:43 UTC (rev 4044) @@ -61,8 +61,6 @@ Var MPdir.Config Var MPdir.Plugins Var MPdir.Log -Var MPdir.CustomInputDevice -Var MPdir.CustomInputDefault Var MPdir.Skin Var MPdir.Language Var MPdir.Database @@ -122,8 +120,6 @@ StrCpy $MPdir.Plugins "$MPdir.Base\plugins" StrCpy $MPdir.Log "$MPdir.Config\log" - StrCpy $MPdir.CustomInputDevice "$MPdir.Config\InputDeviceMappings" - StrCpy $MPdir.CustomInputDefault "$MPdir.Base\InputDeviceMappings\defaults" StrCpy $MPdir.Skin "$MPdir.Config\skin" StrCpy $MPdir.Language "$MPdir.Config\language" StrCpy $MPdir.Database "$MPdir.Config\database" @@ -165,8 +161,6 @@ ${ReadMPdir} Config ${ReadMPdir} Plugins ${ReadMPdir} Log - ${ReadMPdir} CustomInputDevice - ${ReadMPdir} CustomInputDefault ${ReadMPdir} Skin ${ReadMPdir} Language ${ReadMPdir} Database @@ -236,8 +230,6 @@ ${LOG_TEXT} "INFO" " Config: $MPdir.Config" ${LOG_TEXT} "INFO" " Plugins: $MPdir.Plugins" ${LOG_TEXT} "INFO" " Log: $MPdir.Log" - ${LOG_TEXT} "INFO" " CustomInputDevice: $MPdir.CustomInputDevice" - ${LOG_TEXT} "INFO" " CustomInputDefault: $MPdir.CustomInputDefault" ${LOG_TEXT} "INFO" " Skin: $MPdir.Skin" ${LOG_TEXT} "INFO" " Language: $MPdir.Language" ${LOG_TEXT} "INFO" " Database: $MPdir.Database" Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2010-12-18 02:28:02 UTC (rev 4043) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2010-12-18 03:20:43 UTC (rev 4044) @@ -480,8 +480,8 @@ SetOutPath "$MPdir.Plugins\Process" File "..\MediaPortal Plugins\MediaPortal Plugins\MP Control Plugin\bin\${Build_Type}\MPControlPlugin.*" - ; Write input mapping - SetOutPath "$MPdir.CustomInputDefault" + ; Write default input mapping + SetOutPath "$MPdir.Base\defaults\InputDeviceMappings" File "..\MediaPortal Plugins\MediaPortal Plugins\MP Control Plugin\InputMapping\MPControlPlugin.xml" ; Write app data @@ -498,7 +498,11 @@ !macro Remove_${SectionMPControlPlugin} ${LOG_TEXT} "INFO" "MP Control Plugin..." + ; Delete plugin dll Delete "$MPdir.Plugins\Process\MPControlPlugin.*" + + ; Delete default input mapping + Delete "$MPdir.Base\defaults\InputDeviceMappings\MPControlPlugin.xml" !macroend ;====================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |