[Mediaportal-svn] r22140 - in trunk: Tools/InstallationScripts TvEngine3/TVLibrary/Setup mediaporta
Turn your PC into a very advanced MediaCenter/HTPC
Brought to you by:
gereonheitmann,
morpheus_xx
From: <che...@de...> - 2009-03-31 16:17:35
|
Author: chef_koch Date: 2009-03-31 16:17:27 +0000 (Tue, 31 Mar 2009) New Revision: 22140 Modified: trunk/Tools/InstallationScripts/include-CommonMPMacros.nsh trunk/TvEngine3/TVLibrary/Setup/setup.nsi trunk/mediaportal/Setup/setup.nsi Log: added uninstall of tvserver/client on update (moved it from DeployTool to NSIS) fixed update for singleseat installations commented out some debug log messages Modified: trunk/Tools/InstallationScripts/include-CommonMPMacros.nsh =================================================================== --- trunk/Tools/InstallationScripts/include-CommonMPMacros.nsh 2009-03-31 16:13:24 UTC (rev 22139) +++ trunk/Tools/InstallationScripts/include-CommonMPMacros.nsh 2009-03-31 16:17:27 UTC (rev 22140) @@ -499,7 +499,7 @@ # Get MP infos !macro MP_GET_INSTALL_DIR _var SetRegView 32 - ${LOG_TEXT} "DEBUG" "MACRO:MP_GET_INSTALL_DIR" + ;${LOG_TEXT} "DEBUG" "MACRO:MP_GET_INSTALL_DIR" ${If} ${MP023IsInstalled} ReadRegStr ${_var} HKLM "SOFTWARE\Team MediaPortal\MediaPortal" "ApplicationDir" @@ -743,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 @@ -778,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 @@ -847,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 @@ -976,8 +976,33 @@ */ ${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 #--------------------------------------------------------------------------- Modified: trunk/TvEngine3/TVLibrary/Setup/setup.nsi =================================================================== --- trunk/TvEngine3/TVLibrary/Setup/setup.nsi 2009-03-31 16:13:24 UTC (rev 22139) +++ trunk/TvEngine3/TVLibrary/Setup/setup.nsi 2009-03-31 16:17:27 UTC (rev 22140) @@ -252,11 +252,6 @@ # SECTIONS and REMOVEMACROS #--------------------------------------------------------------------------- !macro RenameInstallDirectory -Section "-prepare" SecPrepare - ${LOG_TEXT} "DEBUG" "SECTION SecPrepare" - ${LOG_TEXT} "INFO" "Prepare installation..." - SetShellVarContext all - !insertmacro GET_BACKUP_POSTFIX $R0 ${If} $DeployMode == 1 @@ -270,12 +265,56 @@ !insertmacro RenameDirectory "${COMMON_APPDATA}" "${COMMON_APPDATA}_$R0" ${EndIf} +!macroend +Section "-prepare" SecPrepare + ${LOG_TEXT} "DEBUG" "SECTION SecPrepare" + ${LOG_TEXT} "INFO" "Prepare installation..." + SetShellVarContext all + ${If} $UpdateMode = 1 + ${LOG_TEXT} "INFO" "Installer started in UpdateMode." + + ; check current install mode: TVServer / TVClient / SingleSeat (both) + ; if only TVServer, uninstall current one and go on with installation of new one + ; if only TVClient, uninstall current one and go on with installation of new one + ; if SingleSeat, if NoClient (Server installation), uninstall current one (removes both components) and install new server component + ; if SingleSeat, if NoServer (Client installation), Do NOT uninstall current one (was removed on during server install already), but install new client component + ${If} $noClient == 1 + + ${LOG_TEXT} "INFO" "TVServer component will be installed soon. (/noClient was used)" + + ${LOG_TEXT} "INFO" "InstallMode is: Dedicated TVServer or SingleSeat." + ${LOG_TEXT} "INFO" " ==> Old TVServer/Client will be uninstalled now." + !insertmacro NsisSilentUinstall "${TV3_REG_UNINSTALL}" + + ${ElseIf} $noServer == 1 + + ${LOG_TEXT} "INFO" "TVClient component will be installed soon. (/noServer was used)" + + ${If} ${TVServerIsInstalled} + ${LOG_TEXT} "INFO" "TVServer component is already installed." + ${LOG_TEXT} "INFO" " --> Means it is a SingleSeat installation." + ${LOG_TEXT} "INFO" " --> Means TVServer was already updated." + ${LOG_TEXT} "INFO" " ==> TVServer/Client won't be uninstalled." + ${Else} + ${LOG_TEXT} "INFO" "TVServer component isn't already installed." + ${LOG_TEXT} "INFO" " --> Means it is a TVClient-only installation." + ${LOG_TEXT} "INFO" " ==> Old TVClient will be uninstalled now." + !insertmacro NsisSilentUinstall "${TV3_REG_UNINSTALL}" + ${EndIf} + + ${EndIf} + + ${Else} + + ${LOG_TEXT} "DEBUG" "SecPrepare: not in updateMode" + !if ${VER_BUILD} == 0 # it's an official release + !insertmacro RenameInstallDirectory + !endif + + ${EndIf} + SectionEnd -!macroend -!if ${VER_BUILD} == 0 # it's an official release - !insertmacro RenameInstallDirectory -!endif ${MementoSection} "MediaPortal TV Server" SecServer ${LOG_TEXT} "DEBUG" "MementoSection SecServer" Modified: trunk/mediaportal/Setup/setup.nsi =================================================================== --- trunk/mediaportal/Setup/setup.nsi 2009-03-31 16:13:24 UTC (rev 22139) +++ trunk/mediaportal/Setup/setup.nsi 2009-03-31 16:17:27 UTC (rev 22140) @@ -285,17 +285,17 @@ ${LOG_TEXT} "DEBUG" "SECTION SecPrepare" ${LOG_TEXT} "INFO" "Prepare installation..." ${ReadMediaPortalDirs} "$INSTDIR" - + !insertmacro ShutdownRunningMediaPortalApplications ${LOG_TEXT} "INFO" "Deleting SkinCache..." RMDir /r "$MPdir.Cache" - # if it is an update include a file with last update/cleanup instructions + # if it is an update include a file with last update/cleanup instructions ${If} $UpdateMode = 1 ${LOG_TEXT} "INFO" "Removing 1.0 files..." !include "update-1.0.1.nsh" - ${EndIf} + ${EndIf} SectionEnd !macro BackupInstallDirectory |