From 05199805dfca09b93b534d1ee684c56b4125816e Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Mon, 20 Nov 2023 13:35:25 +0200 Subject: [PATCH 01/31] MP1-Master: Update Size and Labels workflow --- .github/workflows/workflow_size_labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow_size_labels.yml b/.github/workflows/workflow_size_labels.yml index 5973799f631..bc6dc82e851 100644 --- a/.github/workflows/workflow_size_labels.yml +++ b/.github/workflows/workflow_size_labels.yml @@ -1,7 +1,7 @@ name: Workflow / Size and Stability labels on: - pull_request: + pull_request_target: types: [opened, synchronize] # push: # branches: [master] From 2a06efc00ce9f1107ae55f8ae8c43176b0884e73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:05:54 +0000 Subject: [PATCH 02/31] MP1: Bump actions/setup-java from 3 to 4 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/mediaportal.yml | 2 +- .github/workflows/mediaportal_jira.yml | 2 +- .github/workflows/mediaportal_test_build.yml | 2 +- .github/workflows/workflow_codeql.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mediaportal.yml b/.github/workflows/mediaportal.yml index 6c95844867b..73d6feecc04 100644 --- a/.github/workflows/mediaportal.yml +++ b/.github/workflows/mediaportal.yml @@ -32,7 +32,7 @@ jobs: shell: cmd - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 architecture: x86 diff --git a/.github/workflows/mediaportal_jira.yml b/.github/workflows/mediaportal_jira.yml index e6a9ad78a3a..563c9484a3f 100644 --- a/.github/workflows/mediaportal_jira.yml +++ b/.github/workflows/mediaportal_jira.yml @@ -32,7 +32,7 @@ jobs: shell: cmd - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 architecture: x86 diff --git a/.github/workflows/mediaportal_test_build.yml b/.github/workflows/mediaportal_test_build.yml index a017a94fb57..7659255c203 100644 --- a/.github/workflows/mediaportal_test_build.yml +++ b/.github/workflows/mediaportal_test_build.yml @@ -32,7 +32,7 @@ jobs: shell: cmd - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 architecture: x86 diff --git a/.github/workflows/workflow_codeql.yml b/.github/workflows/workflow_codeql.yml index 76a6943d835..c3051273da1 100644 --- a/.github/workflows/workflow_codeql.yml +++ b/.github/workflows/workflow_codeql.yml @@ -25,7 +25,7 @@ jobs: shell: cmd - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 architecture: x86 From 1dbbe863421c5d6964af5826ff6e488c2e06c82c Mon Sep 17 00:00:00 2001 From: epbk Date: Tue, 5 Dec 2023 14:04:23 +0100 Subject: [PATCH 03/31] MP1-5185: NSIS installation script fix --- .../include-MP-PreBuild.nsh | 7 +-- .../include/MediaPortalMacros.nsh | 45 +++++++++---------- TvEngine3/TVLibrary/Setup/setup.nsi | 24 ++++++---- mediaportal/Setup/setup.nsi | 21 ++++++--- 4 files changed, 53 insertions(+), 44 deletions(-) diff --git a/Tools/InstallationScripts/include-MP-PreBuild.nsh b/Tools/InstallationScripts/include-MP-PreBuild.nsh index c47613cc7f3..cb0484e6c60 100644 --- a/Tools/InstallationScripts/include-MP-PreBuild.nsh +++ b/Tools/InstallationScripts/include-MP-PreBuild.nsh @@ -134,14 +134,9 @@ !endif !ifdef BUILD_DeployTool -!if "${Architecture}" == "x64" - !define DeployArchitecture x64 -!else - !define DeployArchitecture x86 -!endif !insertmacro PrepareBuildReport DeployTool ;!system '"${MSBuild_Path}" ${logger} /p:ALToolPath="${ALToolPath}" /target:Rebuild /property:Configuration=Release;Platform=${Architecture} "${git_DeployTool}\MediaPortal.DeployTool.sln"' = 0 -!system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform=${DeployArchitecture} "${git_DeployTool}\MediaPortal.DeployTool.sln"' = 0 +!system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform=${Architecture} "${git_DeployTool}\MediaPortal.DeployTool.sln"' = 0 !insertmacro FinalizeBuildReport !endif diff --git a/Tools/InstallationScripts/include/MediaPortalMacros.nsh b/Tools/InstallationScripts/include/MediaPortalMacros.nsh index 670f0562684..5e07cb4be12 100644 --- a/Tools/InstallationScripts/include/MediaPortalMacros.nsh +++ b/Tools/InstallationScripts/include/MediaPortalMacros.nsh @@ -65,18 +65,10 @@ !endif !ifndef MP_REG_UNINSTALL - !if "${Architecture}" == "x64" - !define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal (x64)" - !else - !define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" - !endif + !define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" !endif !ifndef TV3_REG_UNINSTALL - !if "${Architecture}" == "x64" - !define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server (x64)" - !else - !define TV3_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" - !endif + !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 git version check is working @@ -179,7 +171,7 @@ # old installations < 0.2.3.0 RC 3 !macro _MP022IsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{87819CFA-1786-484D-B0DE-10B5FBF2625D}" "UninstallString" @@ -188,7 +180,7 @@ !define MP022IsInstalled `"" MP022IsInstalled ""` !macro _MP023RC3IsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0 RC3" "UninstallString" @@ -197,7 +189,7 @@ !define MP023RC3IsInstalled `"" MP023RC3IsInstalled ""` !macro _MP023IsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal 0.2.3.0" "UninstallString" @@ -208,7 +200,7 @@ ;====================================== OLD TVServer/TVClient INSTALLATION TESTs !macro _MSI_TVServerIsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B738773-EE07-413D-AFB7-BB0AB04A5488}" "UninstallString" @@ -217,7 +209,7 @@ !define MSI_TVServerIsInstalled `"" MSI_TVServerIsInstalled ""` !macro _MSI_TVClientIsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F7444E89-5BC0-497E-9650-E50539860DE0}" "UninstallString" @@ -235,15 +227,20 @@ !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" "UninstallString" + + !if "${Architecture}" == "x64" + SetRegView 64 + !endif + IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MPIsInstalledx86 `"" MPIsInstalledx86 ""` !macro _MPIsInstalledx64 _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP - ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal (x64)" "UninstallString" + ReadRegStr $_LOGICLIB_TEMP HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" "UninstallString" IfFileExists $_LOGICLIB_TEMP `${_t}` `${_f}` !macroend !define MPIsInstalledx64 `"" MPIsInstalledx64 ""` @@ -251,7 +248,7 @@ ;====================================== Mediaportal / TV Server / TV Client !macro _MPIsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "${MP_REG_UNINSTALL}" "UninstallString" @@ -260,7 +257,7 @@ !define MPIsInstalled `"" MPIsInstalled ""` !macro _TVServerIsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" @@ -272,7 +269,7 @@ !define TVServerIsInstalled `"" TVServerIsInstalled ""` !macro _TVClientIsInstalled _a _b _t _f - SetRegView 32 + ;SetRegView 32 !insertmacro _LOGICLIB_TEMP ReadRegStr $_LOGICLIB_TEMP HKLM "${TV3_REG_UNINSTALL}" "UninstallString" @@ -316,7 +313,7 @@ #**********************************************************************************************************# # Get MP infos !macro MP_GET_INSTALL_DIR _var - SetRegView 32 + ;SetRegView 32 ;${LOG_TEXT} "DEBUG" "MACRO:MP_GET_INSTALL_DIR" ${If} ${MP023IsInstalled} @@ -337,7 +334,7 @@ !macroend !macro TVSERVER_GET_INSTALL_DIR _var - SetRegView 32 + ;SetRegView 32 ;${LOG_TEXT} "DEBUG" "MACRO:TVSERVER_GET_INSTALL_DIR" ${If} ${TVServerIsInstalled} @@ -352,7 +349,7 @@ !macroend !macro MP_GET_VERSION _var - SetRegView 32 + ;SetRegView 32 ${LOG_TEXT} "DEBUG" "MACRO:MP_GET_VERSION" ${If} ${MPIsInstalled} @@ -368,7 +365,7 @@ !macroend !macro TVSERVER_GET_VERSION _var - SetRegView 32 + ;SetRegView 32 ${LOG_TEXT} "DEBUG" "MACRO:TVSERVER_GET_VERSION" ${If} ${TVServerIsInstalled} diff --git a/TvEngine3/TVLibrary/Setup/setup.nsi b/TvEngine3/TVLibrary/Setup/setup.nsi index 78461decbe3..4b7520e5259 100644 --- a/TvEngine3/TVLibrary/Setup/setup.nsi +++ b/TvEngine3/TVLibrary/Setup/setup.nsi @@ -74,14 +74,9 @@ !define PRODUCT_PUBLISHER "Team MediaPortal" !define PRODUCT_WEB_SITE "www.team-mediaportal.com" +!define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" +!define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" -!if "${Architecture}" == "x64" - !define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal (x64)" - !define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server (x64)" -!else - !define MP_REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" - !define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server" -!endif !define MEMENTO_REGISTRY_ROOT HKLM !define MEMENTO_REGISTRY_KEY "${REG_UNINSTALL}" !define COMMON_APPDATA "$APPDATA\Team MediaPortal\MediaPortal TV Server" @@ -619,7 +614,7 @@ ${MementoSection} "MediaPortal TV Server" SecServer ${LOG_TEXT} "INFO" "filter registration..." ; filters for digital tv ${IfNot} ${MP023IsInstalled} - ${AndIfNot} ${MPIsInstalledx86} + ${AndIfNot} ${MPIsInstalled} !insertmacro InstallLib REGDLL NOTSHARED NOREBOOT_NOTPROTECTED "${git_DirectShowFilters}\TsReader\bin\${BUILD_TYPE}\TsReader.ax" "$INSTDIR\TsReader.ax" "$INSTDIR" !insertmacro InstallLib REGDLL NOTSHARED NOREBOOT_NOTPROTECTED "${git_DirectShowFilters}\Core-CC-Parser\CCCP\${BUILD_TYPE}\cccp.ax" "$INSTDIR\cccp.ax" "$INSTDIR" ${EndIf} @@ -710,7 +705,7 @@ ${MementoSectionEnd} ${LOG_TEXT} "INFO" "Unreg and remove filters..." ; filters for digital tv ${IfNot} ${MP023IsInstalled} - ${AndIfNot} ${MPIsInstalledx86} + ${AndIfNot} ${MPIsInstalled} !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\TsReader.ax" !insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_NOTPROTECTED "$INSTDIR\cccp.ax" ; Delete TV filter to be able to be registered with an updated version @@ -1122,6 +1117,12 @@ FunctionEnd Function .onInit ${LOG_OPEN} ${LOG_TEXT} "DEBUG" "FUNCTION .onInit" + + !if "${Architecture}" == "x64" + SetRegView 64 + !else + SetRegView 32 + !endif !insertmacro MediaPortalNetFrameworkCheck !insertmacro MediaPortalNet4FrameworkCheck @@ -1245,6 +1246,11 @@ Function un.onInit ${un.LOG_OPEN} ${LOG_TEXT} "DEBUG" "FUNCTION un.onInit" + !if "${Architecture}" == "x64" + SetRegView 64 + !else + SetRegView 32 + !endif #### check and parse cmdline parameter ; set default values for parameters ........ diff --git a/mediaportal/Setup/setup.nsi b/mediaportal/Setup/setup.nsi index 8396f6013d7..32c297d7ef9 100644 --- a/mediaportal/Setup/setup.nsi +++ b/mediaportal/Setup/setup.nsi @@ -83,11 +83,8 @@ !define PRODUCT_PUBLISHER "Team MediaPortal" !define PRODUCT_WEB_SITE "www.team-mediaportal.com" -!if "${Architecture}" == "x64" - !define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal (x64)" -!else - !define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" -!endif +!define REG_UNINSTALL "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal" + !define MEMENTO_REGISTRY_ROOT HKLM !define MEMENTO_REGISTRY_KEY "${REG_UNINSTALL}" !define COMMON_APPDATA "$APPDATA\Team MediaPortal\MediaPortal" @@ -293,6 +290,9 @@ ShowUninstDetails show ; MovieThumbnailer ${KillProcess} "mtn.exe" + + ; MPx86Proxy + ${KillProcess} "MPx86Proxy.exe" !macroend !macro RenameInstallDirectory @@ -1401,6 +1401,12 @@ Function .onInit ${LOG_OPEN} ${LOG_TEXT} "DEBUG" "FUNCTION .onInit" + !if "${Architecture}" == "x64" + SetRegView 64 + !else + SetRegView 32 + !endif + !insertmacro MediaPortalNetFrameworkCheck !insertmacro MediaPortalNet4FrameworkCheck @@ -1473,6 +1479,11 @@ Function un.onInit ${un.LOG_OPEN} ${LOG_TEXT} "DEBUG" "FUNCTION un.onInit" + !if "${Architecture}" == "x64" + SetRegView 64 + !else + SetRegView 32 + !endif #### check and parse cmdline parameter ; set default values for parameters ........ From cf100e0f311a35b50246b26588b8603f2ca4e4e3 Mon Sep 17 00:00:00 2001 From: epbk Date: Tue, 5 Dec 2023 14:09:25 +0100 Subject: [PATCH 04/31] MP1-5185: DeployTool: Disabled TV Server Instalation in x64 version --- .../MediaPortal.DeployTool.csproj | 4 ++-- .../Sections/BaseInstallationTypeDlg.cs | 4 ++++ .../Sections/CustomInstallationTypeDlg.cs | 19 +++++++++++++++---- .../Sections/InstallDlg.cs | 17 ++++++++++++++++- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj index bfc24e7b85d..91009583850 100644 --- a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj +++ b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj @@ -80,7 +80,7 @@ true bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;NO_TV_SERVER 1 full x64 @@ -89,7 +89,7 @@ bin\Release\ - TRACE + TRACE;NO_TV_SERVER true pdbonly x64 diff --git a/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs b/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs index 80560aed239..32346f769d6 100644 --- a/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs @@ -68,7 +68,11 @@ public override void SetProperties() { InstallationProperties.Instance.Set("InstallTypeHeader", Localizer.GetBestTranslation("BaseInstallation_rbOneClick")); +#if NO_TV_SERVER + InstallationProperties.Instance.Set("InstallType", "client"); +#else InstallationProperties.Instance.Set("InstallType", "singleseat"); +#endif InstallationProperties.Instance.Set("ConfigureTVServerFirewall", "1"); InstallationProperties.Instance.Set("ConfigureMediaPortalFirewall", "1"); InstallationProperties.Instance.Set("ConfigureDBMSFirewall", "1"); diff --git a/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs b/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs index 21b5204f81e..f29c8394a84 100644 --- a/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs @@ -28,11 +28,22 @@ public partial class CustomInstallationTypeDlg : DeployDialog public CustomInstallationTypeDlg() { - InitializeComponent(); + this.InitializeComponent(); type = DialogType.CUSTOM_INSTALLATION_TYPE; - bSingle.Image = Images.Choose_button_on; - installType = 1; - UpdateUI(); +#if NO_TV_SERVER + this.bSingle.Enabled = false; + this.rbSingleSeat.Enabled = false; + this.labelSingleSeat.Enabled = false; + this.bMaster.Enabled = false; + this.rbTvServerMaster.Enabled = false; + this.labelMaster.Enabled = false; + this.bClient.Image = Images.Choose_button_on; + this.installType = 3; +#else + this.bSingle.Image = Images.Choose_button_on; + this.installType = 1; +#endif + this.UpdateUI(); } #region IDeployDialog interface diff --git a/Tools/MediaPortal.DeployTool/Sections/InstallDlg.cs b/Tools/MediaPortal.DeployTool/Sections/InstallDlg.cs index 718048d58bd..89e542a50f1 100644 --- a/Tools/MediaPortal.DeployTool/Sections/InstallDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/InstallDlg.cs @@ -204,7 +204,7 @@ private void PopulateListView() } AddPackageToListView(new VcRedistChecker2015()); AddPackageToListView(new WindowsMediaPlayerChecker()); - switch (InstallationProperties.Instance["InstallType"]) +switch (InstallationProperties.Instance["InstallType"]) { case "singleseat": AddPackageToListView(new MediaPortalChecker()); @@ -216,7 +216,12 @@ private void PopulateListView() { AddPackageToListView(new MySQLChecker()); } + +#if NO_TV_SERVER +#else AddPackageToListView(new TvServerChecker()); +#endif + AddPackageToListView(new TvPluginChecker()); break; @@ -229,7 +234,12 @@ private void PopulateListView() { AddPackageToListView(new MySQLChecker()); } + +#if NO_TV_SERVER +#else AddPackageToListView(new TvServerChecker()); +#endif + break; case "client": @@ -246,7 +256,12 @@ private void PopulateListView() // framug: MS SQL is no longer supported // AddPackageToListView(new MSSQLExpressChecker()); AddPackageToListView(new MySQLChecker()); + +#if NO_TV_SERVER +#else AddPackageToListView(new TvServerChecker()); +#endif + AddPackageToListView(new TvPluginChecker()); break; } From 1af8550ad16de11e80cafae0120b1c3ef7208d76 Mon Sep 17 00:00:00 2001 From: epbk Date: Tue, 5 Dec 2023 14:10:47 +0100 Subject: [PATCH 05/31] MP1-5185: DeployTool: Set bottom panel background color to transparent --- Tools/MediaPortal.DeployTool/DeployTool.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/MediaPortal.DeployTool/DeployTool.Designer.cs b/Tools/MediaPortal.DeployTool/DeployTool.Designer.cs index fdb9ba1880c..15317cc8e6d 100644 --- a/Tools/MediaPortal.DeployTool/DeployTool.Designer.cs +++ b/Tools/MediaPortal.DeployTool/DeployTool.Designer.cs @@ -142,7 +142,7 @@ private void InitializeComponent() // // splitContainer2.Panel2 // - this.splitContainer2.Panel2.BackColor = System.Drawing.Color.WhiteSmoke; + this.splitContainer2.Panel2.BackColor = System.Drawing.Color.Transparent; this.splitContainer2.Panel2.BackgroundImage = global::MediaPortal.DeployTool.Images.Background_bottom; this.splitContainer2.Panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.splitContainer2.Panel2.Controls.Add(this.labelHeading); From 0cbe8785999e40ab8159d8c2fdd58471821e4bb8 Mon Sep 17 00:00:00 2001 From: epbk Date: Tue, 5 Dec 2023 14:21:26 +0100 Subject: [PATCH 06/31] MP1-5185: DeployTool: Platform compatibility check improvement --- .../Classes/ActionType/ExtensionInstaller.cs | 4 ++++ mediaportal/MPE/MpeCore/PackageClass.cs | 20 +++++++++++++++++++ mediaportal/MPE/MpeInstaller/MainForm.cs | 17 +++------------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/mediaportal/MPE/MpeCore/Classes/ActionType/ExtensionInstaller.cs b/mediaportal/MPE/MpeCore/Classes/ActionType/ExtensionInstaller.cs index 8d479232675..b82b1ae783b 100644 --- a/mediaportal/MPE/MpeCore/Classes/ActionType/ExtensionInstaller.cs +++ b/mediaportal/MPE/MpeCore/Classes/ActionType/ExtensionInstaller.cs @@ -136,6 +136,10 @@ public SectionResponseEnum Execute(PackageClass packageClass, ActionItem actionI } } + //Check for platform compatibility + if (!embeddedPackage.CheckPlatformCompatibility()) + return SectionResponseEnum.Cancel; + embeddedPackage.Silent = actionItem.Params[Const_Silent].GetValueAsBool(); if (embeddedPackage.StartInstallWizard()) { diff --git a/mediaportal/MPE/MpeCore/PackageClass.cs b/mediaportal/MPE/MpeCore/PackageClass.cs index 814ff04c134..adf78c2cd54 100644 --- a/mediaportal/MPE/MpeCore/PackageClass.cs +++ b/mediaportal/MPE/MpeCore/PackageClass.cs @@ -900,6 +900,26 @@ public static int CompareVersionAscending(PackageClass pak1, PackageClass pak2) return pak1.GeneralInfo.Name.ToUpperInvariant().CompareTo(pak2.GeneralInfo.Name.ToUpperInvariant()); } + public bool CheckPlatformCompatibility() + { + if (!this.IsPlatformCompatible) + { + if (ApplicationSettings.Instance.PlatformCompatibilityCheck) + { + MessageBox.Show("Package '" + this.GeneralInfo.Name + "' is not platform compatible!"); + return false; + } + else + { + if (MessageBox.Show("Package '" + this.GeneralInfo.Name + "' is not platform compatible!\r\nInstall anyway?", "Warning", + MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) + return false; + } + } + + return true; + } + public override string ToString() { return (GeneralInfo == null) ? base.ToString() : GeneralInfo.Name + " " + GeneralInfo.Version; diff --git a/mediaportal/MPE/MpeInstaller/MainForm.cs b/mediaportal/MPE/MpeInstaller/MainForm.cs index 413954f2b9a..1f85e159ff7 100644 --- a/mediaportal/MPE/MpeInstaller/MainForm.cs +++ b/mediaportal/MPE/MpeInstaller/MainForm.cs @@ -569,20 +569,9 @@ public void InstallFile(string file, bool silent, bool gui) return; } - if (!pak.IsPlatformCompatible) - { - if (ApplicationSettings.Instance.PlatformCompatibilityCheck) - { - MessageBox.Show("Package is not platform compatible!"); - return; - } - else - { - if (MessageBox.Show("Package is not platform compatible!\r\nInstall anyway?", "Warning", - MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) - return; - } - } + //Check for platform compatibility + if (!pak.CheckPlatformCompatibility()) + return; if (pak.CheckDependency(false)) { From 7cb1c1465677614ecf86ce3c0f007d3c8bec69ec Mon Sep 17 00:00:00 2001 From: epbk Date: Tue, 5 Dec 2023 14:38:48 +0100 Subject: [PATCH 07/31] MP1-5185: DeployTool: Fix x64 TV Server installation path --- Tools/MediaPortal.DeployTool/DeployTool.cs | 19 ++++++------------- .../Sections/TvServerSettingsDlg.cs | 17 +++++------------ 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Tools/MediaPortal.DeployTool/DeployTool.cs b/Tools/MediaPortal.DeployTool/DeployTool.cs index ee64ed87dc7..4126c4646aa 100644 --- a/Tools/MediaPortal.DeployTool/DeployTool.cs +++ b/Tools/MediaPortal.DeployTool/DeployTool.cs @@ -83,19 +83,12 @@ public DeployTool() // Set default folders InstallationProperties.Instance.Set("MPDir", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + - "\\Team MediaPortal\\MediaPortal"); - if (Utils.Is64bit()) - { - InstallationProperties.Instance.Set("TVServerDir", - Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + - "\\Team MediaPortal\\MediaPortal TV Server (x64)"); - } - else - { - InstallationProperties.Instance.Set("TVServerDir", - Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + - "\\Team MediaPortal\\MediaPortal TV Server"); - } + @"\Team MediaPortal\MediaPortal"); + + + InstallationProperties.Instance.Set("TVServerDir", + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + + @"\Team MediaPortal\MediaPortal TV Server"); if (Utils.Is64bit()) { diff --git a/Tools/MediaPortal.DeployTool/Sections/TvServerSettingsDlg.cs b/Tools/MediaPortal.DeployTool/Sections/TvServerSettingsDlg.cs index 05039d329ab..73fdb77f849 100644 --- a/Tools/MediaPortal.DeployTool/Sections/TvServerSettingsDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/TvServerSettingsDlg.cs @@ -30,18 +30,11 @@ public TvServerSettingsDlg() { InitializeComponent(); type = DialogType.TvServerSettings; - if (Utils.Is64bit()) - { - textBoxDir.Text = - installationPath = - Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + "\\Team MediaPortal\\MediaPortal TV Server (x64)"; - } - else - { - textBoxDir.Text = - installationPath = - Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\Team MediaPortal\\MediaPortal TV Server"; - } + + textBoxDir.Text = + installationPath = + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + "\\Team MediaPortal\\MediaPortal TV Server"; + UpdateUI(); } From bd60b2cae1beee69f06b55ce351f46eae03cf559 Mon Sep 17 00:00:00 2001 From: epbk Date: Tue, 5 Dec 2023 14:39:50 +0100 Subject: [PATCH 08/31] MP1-5185: DeployTool: Fix x64 uninstall registry path --- Tools/MediaPortal.DeployTool/DeployTool.cs | 4 ++ .../InstallationChecks/MediaPortalChecker.cs | 17 +++-- .../InstallationChecks/TvPluginChecker.cs | 4 +- .../InstallationChecks/TvServerChecker.cs | 6 +- .../Sections/DownloadOnlyDlg.cs | 6 +- .../Sections/UpgradeDlg.cs | 12 ++-- Tools/MediaPortal.DeployTool/Utils.cs | 72 ++++++++++++++++--- 7 files changed, 89 insertions(+), 32 deletions(-) diff --git a/Tools/MediaPortal.DeployTool/DeployTool.cs b/Tools/MediaPortal.DeployTool/DeployTool.cs index 4126c4646aa..90402156682 100644 --- a/Tools/MediaPortal.DeployTool/DeployTool.cs +++ b/Tools/MediaPortal.DeployTool/DeployTool.cs @@ -90,6 +90,10 @@ public DeployTool() Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Team MediaPortal\MediaPortal TV Server"); + + //Fix old MediaPortal x64 registry path + Utils.FixMediaPortal64RegistryPath(); + if (Utils.Is64bit()) { InstallationProperties.Instance.Set("ProgramFiles", Environment.GetEnvironmentVariable("ProgramFiles")); diff --git a/Tools/MediaPortal.DeployTool/InstallationChecks/MediaPortalChecker.cs b/Tools/MediaPortal.DeployTool/InstallationChecks/MediaPortalChecker.cs index 7e5f633185e..b37a7bd3b22 100644 --- a/Tools/MediaPortal.DeployTool/InstallationChecks/MediaPortalChecker.cs +++ b/Tools/MediaPortal.DeployTool/InstallationChecks/MediaPortalChecker.cs @@ -19,6 +19,8 @@ #endregion using System; +using System.Collections.Generic; +using System.Linq; using System.Xml; using System.IO; using System.Diagnostics; @@ -180,14 +182,15 @@ public bool UnInstall() return true; } - string[] UninstKeys = { - "MediaPortal" + (Utils.Is64bit() ? " (x64)" : string.Empty), // 1.x - x86/x64 - "MediaPortal 0.2.3.0" // 0.2.3.0 - }; + object[][] keys = + { + new object[] { "MediaPortal", false}, // 1.x - x86/x64 + new object[] { "MediaPortal 0.2.3.0", true } // 0.2.3.0 + }; - foreach (string UnistKey in UninstKeys) + foreach (object[] key in keys) { - string keyUninstall = Utils.CheckUninstallString(UnistKey, true); + string keyUninstall = Utils.CheckUninstallString((string)key[0], true, (bool)key[1]); if (keyUninstall != null && File.Exists(keyUninstall)) { Utils.UninstallNSIS(keyUninstall); @@ -214,7 +217,7 @@ public CheckResult CheckStatus() result.state = CheckState.NOT_INSTALLED; string[] UninstKeys = { - "MediaPortal" + (Utils.Is64bit() ? " (x64)" : string.Empty), // 1.x - x86/x64 + "MediaPortal", // 1.x - x86/x64 "MediaPortal 0.2.3.0" // 0.2.3.0 }; diff --git a/Tools/MediaPortal.DeployTool/InstallationChecks/TvPluginChecker.cs b/Tools/MediaPortal.DeployTool/InstallationChecks/TvPluginChecker.cs index 64fe03babac..8f3981a3488 100644 --- a/Tools/MediaPortal.DeployTool/InstallationChecks/TvPluginChecker.cs +++ b/Tools/MediaPortal.DeployTool/InstallationChecks/TvPluginChecker.cs @@ -84,7 +84,7 @@ public bool UnInstall() return true; } - string keyUninstall = Utils.CheckUninstallString("MediaPortal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), true); + string keyUninstall = Utils.CheckUninstallString("MediaPortal TV Server", true, false); if (keyUninstall != null && File.Exists(keyUninstall)) { Utils.UninstallNSIS(keyUninstall); @@ -98,7 +98,7 @@ public CheckResult CheckStatus() result.needsDownload = true; FileInfo tvPluginFile = new FileInfo(_fileName); - result = Utils.CheckNSISUninstallString("Mediaportal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecClient"); + result = Utils.CheckNSISUninstallString("Mediaportal TV Server", "MementoSection_SecClient"); if (tvPluginFile.Exists && tvPluginFile.Length != 0) { diff --git a/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs b/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs index 7f38c512e45..5f445397c2e 100644 --- a/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs +++ b/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs @@ -100,7 +100,7 @@ public bool UnInstall() return true; } - string keyUninstall = Utils.CheckUninstallString("MediaPortal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), true); + string keyUninstall = Utils.CheckUninstallString("MediaPortal TV Server", true, false); if (keyUninstall != null && File.Exists(keyUninstall)) { Utils.UninstallNSIS(keyUninstall); @@ -114,7 +114,7 @@ public CheckResult CheckStatus() result.needsDownload = true; FileInfo tvServerFile = new FileInfo(_fileName); - result = Utils.CheckNSISUninstallString("MediaPortal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecServer"); + result = Utils.CheckNSISUninstallString("MediaPortal TV Server", "MementoSection_SecServer"); if (tvServerFile.Exists && tvServerFile.Length != 0) { @@ -131,7 +131,7 @@ public CheckResult CheckStatus() return result; } - CheckResult already = Utils.CheckNSISUninstallString("MediaPortal TV Server" + (Utils.Is64bit() ? string.Empty : " (x64)"), "MementoSection_SecServer"); + CheckResult already = Utils.CheckNSISUninstallString("MediaPortal TV Server", "MementoSection_SecServer"); if (already.state != CheckState.NOT_INSTALLED) { result.state = CheckState.INSTALLED; diff --git a/Tools/MediaPortal.DeployTool/Sections/DownloadOnlyDlg.cs b/Tools/MediaPortal.DeployTool/Sections/DownloadOnlyDlg.cs index 31be658225c..4a2e41e6505 100644 --- a/Tools/MediaPortal.DeployTool/Sections/DownloadOnlyDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/DownloadOnlyDlg.cs @@ -52,10 +52,10 @@ public override DeployDialog GetNextDialog() // Download only return DialogFlowHandler.Instance.GetDialogInstance(DialogType.DownloadSettings); } - CheckResult resultTvServer = Utils.CheckNSISUninstallString("MediaPortal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecServer"); - CheckResult resultTvClient = Utils.CheckNSISUninstallString("Mediaportal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecClient"); + CheckResult resultTvServer = Utils.CheckNSISUninstallString("MediaPortal TV Server", "MementoSection_SecServer"); + CheckResult resultTvClient = Utils.CheckNSISUninstallString("Mediaportal TV Server", "MementoSection_SecClient"); // "NoRepair" key is not the best choice but we need a key returing 1 as value ;) - CheckResult resultMp = Utils.CheckNSISUninstallString("MediaPortal" + (Utils.Is64bit() ? " (x64)" : string.Empty), "NoRepair"); + CheckResult resultMp = Utils.CheckNSISUninstallString("MediaPortal", "NoRepair"); bool TvServer = resultTvServer.state != CheckState.NOT_INSTALLED; bool TvClient = resultTvClient.state != CheckState.NOT_INSTALLED; diff --git a/Tools/MediaPortal.DeployTool/Sections/UpgradeDlg.cs b/Tools/MediaPortal.DeployTool/Sections/UpgradeDlg.cs index 71ea8fb169f..e72fdb23531 100644 --- a/Tools/MediaPortal.DeployTool/Sections/UpgradeDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/UpgradeDlg.cs @@ -70,7 +70,7 @@ public override void UpdateUI() string MpBuild = "0"; string MpDisplayVer = string.Empty; - RegistryKey key = Utils.GetUninstallKey("MediaPortal" + (Utils.Is64bit() ? " (x64)" : string.Empty)); + RegistryKey key = Utils.GetUninstallKey("MediaPortal", false); if (key != null) { MpBuild = key.GetValue("VersionBuild").ToString(); @@ -96,7 +96,7 @@ public override void UpdateUI() string Tv3Build = "0"; string Tv3DisplayVer = string.Empty; - key = Utils.GetUninstallKey("MediaPortal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty)); + key = Utils.GetUninstallKey("MediaPortal TV Server", false); if (key != null) { Tv3Build = key.GetValue("VersionBuild").ToString(); @@ -248,8 +248,8 @@ private void SelectUpdate() freshForce = false; InstallationProperties.Instance.Set("UpdateMode", "yes"); - CheckResult resultTvServer = Utils.CheckNSISUninstallString("MediaPortal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecServer"); - CheckResult resultTvClient = Utils.CheckNSISUninstallString("Mediaportal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecClient"); + CheckResult resultTvServer = Utils.CheckNSISUninstallString("MediaPortal TV Server", "MementoSection_SecServer"); + CheckResult resultTvClient = Utils.CheckNSISUninstallString("Mediaportal TV Server", "MementoSection_SecClient"); bool TvServer = resultTvServer.state != CheckState.NOT_INSTALLED; bool TvClient = resultTvClient.state != CheckState.NOT_INSTALLED; @@ -272,8 +272,8 @@ private void SelectReinstall() freshForce = false; InstallationProperties.Instance.Set("UpdateMode", "yes"); - CheckResult resultTvServer = Utils.CheckNSISUninstallString("MediaPortal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecServer"); - CheckResult resultTvClient = Utils.CheckNSISUninstallString("Mediaportal TV Server" + (Utils.Is64bit() ? " (x64)" : string.Empty), "MementoSection_SecClient"); + CheckResult resultTvServer = Utils.CheckNSISUninstallString("MediaPortal TV Server", "MementoSection_SecServer"); + CheckResult resultTvClient = Utils.CheckNSISUninstallString("Mediaportal TV Server", "MementoSection_SecClient"); bool TvServer = resultTvServer.state != CheckState.NOT_INSTALLED; bool TvClient = resultTvClient.state != CheckState.NOT_INSTALLED; diff --git a/Tools/MediaPortal.DeployTool/Utils.cs b/Tools/MediaPortal.DeployTool/Utils.cs index aca27dcf1fe..97360ad9904 100644 --- a/Tools/MediaPortal.DeployTool/Utils.cs +++ b/Tools/MediaPortal.DeployTool/Utils.cs @@ -339,12 +339,15 @@ private static RegistryKey PointerToRegistryKey(IntPtr hKey, bool pWritable, boo return result; } - public static RegistryKey LMOpenSubKey(string keyPath, bool writable = false) + public static RegistryKey LMOpenSubKey(string keyPath, bool writable = false, bool bIncludeWow6432 = true) { RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath, writable); if (key == null) { + if (!bIncludeWow6432) + return null; + try { key = OpenSubKey(Registry.LocalMachine, keyPath, writable, eRegWow64Options.KEY_WOW64_32KEY); @@ -392,14 +395,14 @@ public static void UninstallMSI(string clsid) CheckUninstallString(clsid, true); } - public static RegistryKey GetUninstallKey(string clsid) + public static RegistryKey GetUninstallKey(string clsid, bool bIncludeWow6432 = true) { - return LMOpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + clsid); + return LMOpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + clsid, bIncludeWow6432: bIncludeWow6432); } - public static string CheckUninstallString(string clsid, string section) + public static string CheckUninstallString(string clsid, string section, bool bIncludeWow6432 = true) { - RegistryKey key = GetUninstallKey(clsid); + RegistryKey key = GetUninstallKey(clsid, bIncludeWow6432); if (key != null) { string strSection = key.GetValue(section).ToString(); @@ -413,9 +416,9 @@ public static string CheckUninstallString(string clsid, string section) return null; } - public static string CheckUninstallString(string clsid, bool delete) + public static string CheckUninstallString(string clsid, bool delete, bool bIncludeWow6432 = true) { - string strUninstall = CheckUninstallString(clsid, "UninstallString"); + string strUninstall = CheckUninstallString(clsid, "UninstallString", bIncludeWow6432); if (!string.IsNullOrEmpty(strUninstall)) { if (File.Exists(strUninstall)) @@ -426,7 +429,7 @@ public static string CheckUninstallString(string clsid, bool delete) if (delete) { - RegistryKey key = GetUninstallKey(clsid); + RegistryKey key = GetUninstallKey(clsid, bIncludeWow6432); if (key != null) { key.DeleteSubKeyTree("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + clsid); @@ -443,7 +446,7 @@ public static CheckResult CheckNSISUninstallString(string RegistryPath, string M state = CheckState.NOT_INSTALLED }; - RegistryKey key = GetUninstallKey(RegistryPath); + RegistryKey key = GetUninstallKey(RegistryPath, false); if (key != null) { int _IsInstalled = (int)key.GetValue(MementoSection, 0); @@ -809,7 +812,7 @@ public static bool IsCurrentPackageUpdatabled(Version pkgVer) public static string PathFromRegistry(string regkey) { - RegistryKey key = LMOpenSubKey(regkey); + RegistryKey key = LMOpenSubKey(regkey, bIncludeWow6432: false); string Tv3Path = null; if (key != null) @@ -823,7 +826,7 @@ public static string PathFromRegistry(string regkey) public static Version VersionFromRegistry(string regkey) { - RegistryKey key = LMOpenSubKey(regkey); + RegistryKey key = LMOpenSubKey(regkey, bIncludeWow6432: false); int major = 0; int minor = 0; @@ -890,6 +893,53 @@ public static void SetDeployXml(string section, string entry, string value) deployXml.Save(deployXmlLocation); } + /// + /// Fixes MediaPortal 1.32 uninstall registry path + /// + public static void FixMediaPortal64RegistryPath() + { + if (Is64bit()) + { + const string NAME_OLD = "MediaPortal (x64)"; + const string PATH_UNINSTALL = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"; + const string PATH_UNINSTALL_WOW6432 = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"; + const string PATH_MP = PATH_UNINSTALL + @"\MediaPortal"; + const string PATH_MP_OLD = PATH_UNINSTALL_WOW6432 + @"\" + NAME_OLD; + + RegistryKey keyOld = Registry.LocalMachine.OpenSubKey(PATH_MP_OLD); + if (keyOld != null) + { + //Existing old registry path + + RegistryKey key = Registry.LocalMachine.OpenSubKey(PATH_MP); + + if (key == null) + { + //Create new registry path + using (RegistryKey localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)) + { + key = localKey.CreateSubKey(PATH_MP); + } + } + + //Copy all values from the old key to the new key + foreach (string strName in keyOld.GetValueNames()) + { + key.SetValue(strName, keyOld.GetValue(strName), keyOld.GetValueKind(strName)); + } + + //Delete old key + using (RegistryKey k = Registry.LocalMachine.OpenSubKey(PATH_UNINSTALL_WOW6432, true)) + { + k.DeleteSubKeyTree(NAME_OLD); + } + + key.Dispose(); + keyOld.Dispose(); + } + } + } + #endregion } } From 9c56581427839fd5d911fc63a309c92c5be45ce9 Mon Sep 17 00:00:00 2001 From: epbk Date: Wed, 6 Dec 2023 10:32:26 +0100 Subject: [PATCH 09/31] MP1-5185: NSIS TV-Server x64 installation script compatibility fix --- .../include-MP-PreBuild.nsh | 7 +-- .../include/MediaPortalMacros.nsh | 53 +++++-------------- TvEngine3/TVLibrary/Setup/setup.nsi | 31 ++++++----- 3 files changed, 31 insertions(+), 60 deletions(-) diff --git a/Tools/InstallationScripts/include-MP-PreBuild.nsh b/Tools/InstallationScripts/include-MP-PreBuild.nsh index cb0484e6c60..60bac798b48 100644 --- a/Tools/InstallationScripts/include-MP-PreBuild.nsh +++ b/Tools/InstallationScripts/include-MP-PreBuild.nsh @@ -115,16 +115,11 @@ ; Build TV server !ifdef BUILD_TVServer -!if "${Architecture}" == "x64" - !define TVServerArchitecture x86 -!else - !define TVServerArchitecture x86 -!endif !insertmacro PrepareBuildReport TvPlugin !system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform="Any CPU" "${git_TVServer}\TvPlugin\TvPlugin.sln"' = 0 !insertmacro FinalizeBuildReport !insertmacro PrepareBuildReport TvLibrary -!system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform=${TVServerArchitecture} "${git_TVServer}\TvLibrary.sln"' = 0 +!system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform=${Architecture} "${git_TVServer}\TvLibrary.sln"' = 0 !insertmacro FinalizeBuildReport !endif diff --git a/Tools/InstallationScripts/include/MediaPortalMacros.nsh b/Tools/InstallationScripts/include/MediaPortalMacros.nsh index 5e07cb4be12..b28b31afd3a 100644 --- a/Tools/InstallationScripts/include/MediaPortalMacros.nsh +++ b/Tools/InstallationScripts/include/MediaPortalMacros.nsh @@ -930,49 +930,12 @@ ${EndIf} !if "${PRODUCT_NAME}" == "MediaPortal" - -!macro DoPreInstallChecks - -!ifdef GIT_BUILD - ; check if correct MP version ist installed, which is required for this git snapshot - !insertmacro MinimumVersionForGITCheck -!endif - - ; 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} - - ; 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 - + !define _macro_cond_MP_ +!else if "${PRODUCT_NAME}" == "MediaPortal (x64)" + !define _macro_cond_MP_ !endif -!if "${PRODUCT_NAME}" == "MediaPortal (x64)" +!ifdef _macro_cond_MP_ !macro DoPreInstallChecks @@ -1015,7 +978,15 @@ ${EndIf} !endif + + !if "${PRODUCT_NAME}" == "MediaPortal TV Server / Client" + !define _macro_cond_TV_ +!else if "${PRODUCT_NAME}" == "MediaPortal TV Server / Client (x64)" + !define _macro_cond_TV_ +!endif + +!ifdef _macro_cond_TV_ !macro DoPreInstallChecks diff --git a/TvEngine3/TVLibrary/Setup/setup.nsi b/TvEngine3/TVLibrary/Setup/setup.nsi index 4b7520e5259..a81ea41624f 100644 --- a/TvEngine3/TVLibrary/Setup/setup.nsi +++ b/TvEngine3/TVLibrary/Setup/setup.nsi @@ -70,7 +70,11 @@ #--------------------------------------------------------------------------- # DEFINES #--------------------------------------------------------------------------- -!define PRODUCT_NAME "MediaPortal TV Server / Client" +!if "${Architecture}" == "x64" + !define PRODUCT_NAME "MediaPortal TV Server / Client (x64)" +!else + !define PRODUCT_NAME "MediaPortal TV Server / Client" +!endif !define PRODUCT_PUBLISHER "Team MediaPortal" !define PRODUCT_WEB_SITE "www.team-mediaportal.com" @@ -230,7 +234,7 @@ XPStyle on RequestExecutionLevel admin ShowInstDetails show VIProductVersion "${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}" -VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "MediaPortal TV Server" +VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "${PRODUCT_NAME}" VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION_DISP}" VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${PRODUCT_PUBLISHER}" VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${PRODUCT_WEB_SITE}" @@ -572,10 +576,17 @@ ${MementoSection} "MediaPortal TV Server" SecServer ; MediaInfo SetOutPath "$INSTDIR" - File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\MediaInfo.dll" - File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\libcrypto-3.dll" - File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\libcurl.dll" - File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\libssl-3.dll" + ${If} ${RunningX64} + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x64\MediaInfo.dll" + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x64\libcrypto-3-x64.dll" + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x64\libcurl.dll" + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x64\libssl-3-x64.dll" + ${Else} + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\MediaInfo.dll" + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\libcrypto-3.dll" + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\libcurl.dll" + File "${git_ROOT}\Packages\MediaInfo.Native.21.9.1\build\native\x86\libssl-3.dll" + ${EndIf} File "${git_ROOT}\Packages\MediaInfo.Wrapper.21.9.3\lib\net40\MediaInfo.Wrapper.dll" File "${git_ROOT}\Packages\System.ValueTuple.4.5.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll" @@ -585,7 +596,7 @@ ${MementoSection} "MediaPortal TV Server" SecServer ${Else} File "${git_ROOT}\Packages\FFmpeg.Win32.Static.4.1.1.1\ffmpeg\ffmpeg.exe" ${EndIf} - File "${git_TVServer}\TvThumbnails\bin\x86\${BUILD_TYPE}\TvThumbnails.dll" + File "${git_TVServer}\TvThumbnails\bin\${BUILD_TYPE}\TvThumbnails.dll" ; protocol implementations for MPIPTVSource.ax File "${git_DirectShowFilters}\MPIPTVSource\bin\${BUILD_TYPE}\MPIPTV_FILE.dll" @@ -666,10 +677,6 @@ ${MementoSection} "MediaPortal TV Server" SecServer ${MementoSectionEnd} !macro Remove_${SecServer} - ; Currently the x86 version only is suppoertd - ${If} "${Architecture}" == "x86" - - ${LOG_TEXT} "INFO" "Uninstalling MediaPortal TV Server..." ; Kill running Programs @@ -828,8 +835,6 @@ ${MementoSectionEnd} !insertmacro Remove_SecWatchdog ${EndIf} - ${EndIf} - !macroend ${MementoSection} "MediaPortal TV Client plugin" SecClient From 387ab6a16bcb8e742e6ee7e8ffacb110f3ceac36 Mon Sep 17 00:00:00 2001 From: epbk Date: Wed, 6 Dec 2023 10:34:46 +0100 Subject: [PATCH 10/31] MP1-5185: DeployTool: Add TV-Server x64 compatibility warning dialog --- .../DialogFlowHandler.cs | 4 + .../MediaPortal.DeployTool.Designer.cs | 10 ++ .../MediaPortal.DeployTool.resx | 4 + .../Sections/BaseInstallationTypeDlg.cs | 8 +- .../Sections/CustomInstallationTypeDlg.cs | 3 +- .../Sections/TvServerWarningDlg.Designer.cs | 129 +++++++++++++++ .../Sections/TvServerWarningDlg.cs | 62 +++++++ .../Sections/TvServerWarningDlg.resx | 156 ++++++++++++++++++ 8 files changed, 373 insertions(+), 3 deletions(-) create mode 100644 Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs create mode 100644 Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.cs create mode 100644 Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx diff --git a/Tools/MediaPortal.DeployTool/DialogFlowHandler.cs b/Tools/MediaPortal.DeployTool/DialogFlowHandler.cs index 25eb89d3f31..f1cde80def3 100644 --- a/Tools/MediaPortal.DeployTool/DialogFlowHandler.cs +++ b/Tools/MediaPortal.DeployTool/DialogFlowHandler.cs @@ -39,6 +39,7 @@ public enum DialogType DBMSSettings, MPSettings, TvServerSettings, + TvServerWarning, Installation, Finished, MysqlUpgrade @@ -140,6 +141,9 @@ public DeployDialog GetDialogInstance(DialogType dlgType) case DialogType.TvServerSettings: dlg = new TvServerSettingsDlg(); break; + case DialogType.TvServerWarning: + dlg = new TvServerWarningDlg(); + break; case DialogType.Installation: dlg = new InstallDlg(); break; diff --git a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.Designer.cs b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.Designer.cs index 4530610ba80..425cb2bb43c 100644 --- a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.Designer.cs +++ b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.Designer.cs @@ -1236,6 +1236,16 @@ internal static string TvServerSettings_msgSelectDir { } } + /// + /// Looks up a localized string similar to TV-Server x64 is not compatible with some TV cards. + /// If you are owner one of the following devices, please install 32bit version of the TV-Server.. + /// + internal static string TvServerWarning_labelHeading { + get { + return ResourceManager.GetString("TvServerWarning_labelHeading", resourceCulture); + } + } + /// /// Looks up a localized string similar to MediaPortal {0} detected.. /// diff --git a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.resx b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.resx index 51b4f767935..c5fb4f3454b 100644 --- a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.resx +++ b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.resx @@ -555,4 +555,8 @@ Please proceed with it before continuing with MediaPortal installation. Browse other skins + + TV-Server x64 is not compatible with some TV cards. + If you are owner one of the following devices, please install 32bit version of the TV-Server. + \ No newline at end of file diff --git a/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs b/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs index 32346f769d6..9df23e6f471 100644 --- a/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/BaseInstallationTypeDlg.cs @@ -50,9 +50,15 @@ public override void UpdateUI() public override DeployDialog GetNextDialog() { + InstallationProperties.Instance["OneClickInstallation"] = rbOneClickChecked ? "1" : "0"; + if (rbOneClickChecked) { +#if NO_TV_SERVER return DialogFlowHandler.Instance.GetDialogInstance(DialogType.ExtensionChoice); +#else + return DialogFlowHandler.Instance.GetDialogInstance(Utils.Is64bit() ? DialogType.TvServerWarning : DialogType.ExtensionChoice); +#endif } return DialogFlowHandler.Instance.GetDialogInstance(DialogType.CUSTOM_INSTALLATION_TYPE); } @@ -85,7 +91,7 @@ public override void SetProperties() } } - #endregion +#endregion private void rbOneClick_Click(object sender, EventArgs e) { diff --git a/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs b/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs index f29c8394a84..8c18e2f4584 100644 --- a/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs +++ b/Tools/MediaPortal.DeployTool/Sections/CustomInstallationTypeDlg.cs @@ -64,9 +64,8 @@ public override DeployDialog GetNextDialog() switch (installType) { case 1: - return DialogFlowHandler.Instance.GetDialogInstance(DialogType.DBMSType); case 2: - return DialogFlowHandler.Instance.GetDialogInstance(DialogType.DBMSType); + return DialogFlowHandler.Instance.GetDialogInstance(Utils.Is64bit() ? DialogType.TvServerWarning : DialogType.DBMSType); case 3: return DialogFlowHandler.Instance.GetDialogInstance(DialogType.MPSettings); default: diff --git a/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs new file mode 100644 index 00000000000..feabc430fd5 --- /dev/null +++ b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs @@ -0,0 +1,129 @@ +#region Copyright (C) 2005-2023 Team MediaPortal + +// Copyright (C) 2005-2023 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see . + +#endregion + +namespace MediaPortal.DeployTool.Sections +{ + partial class TvServerWarningDlg + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TvServerWarningDlg)); + this.labelDevices = new System.Windows.Forms.Label(); + this.labelHeading = new System.Windows.Forms.Label(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + this.SuspendLayout(); + // + // labelCards + // + this.labelDevices.AutoSize = true; + this.labelDevices.ForeColor = System.Drawing.Color.White; + this.labelDevices.Location = new System.Drawing.Point(330, 113); + this.labelDevices.Name = "labelDevices"; + this.labelDevices.Size = new System.Drawing.Size(37, 13); + this.labelDevices.TabIndex = 19; + this.labelDevices.Text = " - Haupage WinTV_CI: hcwWinTVCI.dll, hauppauge.dll\r\n - TeVii: TeVii.dll\r\n - Technotrend: ttBdaDrvApi_Dll.dll, ttdvbacc.dll\r\n - ODSoft multimedia KNC CI: KNCBDACTRL.dll\r\n - HCWIRBlaster: hcwIRblast.dll"; + // + // labelHeading + // + this.labelHeading.AutoSize = true; + this.labelHeading.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.labelHeading.ForeColor = System.Drawing.Color.White; + this.labelHeading.Location = new System.Drawing.Point(330, 56); + this.labelHeading.Name = "labelHeading"; + this.labelHeading.Size = new System.Drawing.Size(604, 26); + this.labelHeading.TabIndex = 18; + this.labelHeading.Text = "TV-Server x64 is not compatible with some TV cards.\r\nIf you are owner one of the " + + "following devices, please install 32bit version of the TV-Server."; + // + // pictureBox1 + // + this.pictureBox1.Image = global::MediaPortal.DeployTool.Images.Mediaportal_Box; + this.pictureBox1.Location = new System.Drawing.Point(40, 70); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(176, 357); + this.pictureBox1.TabIndex = 25; + this.pictureBox1.TabStop = false; + // + // pictureBox2 + // + this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("Warning"))); + this.pictureBox2.Location = new System.Drawing.Point(243, 70); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(64, 64); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox2.TabIndex = 26; + this.pictureBox2.TabStop = false; + // + // TvServerWarningDlg + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackgroundImage = global::MediaPortal.DeployTool.Images.Background_middle_empty; + this.Controls.Add(this.pictureBox2); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.labelDevices); + this.Controls.Add(this.labelHeading); + this.Name = "TvServerWarningDlg"; + this.Size = new System.Drawing.Size(1311, 430); + this.Controls.SetChildIndex(this.labelSectionHeader, 0); + this.Controls.SetChildIndex(this.labelHeading, 0); + this.Controls.SetChildIndex(this.labelDevices, 0); + this.Controls.SetChildIndex(this.pictureBox1, 0); + this.Controls.SetChildIndex(this.pictureBox2, 0); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label labelDevices; + private System.Windows.Forms.Label labelHeading; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.PictureBox pictureBox2; + } +} \ No newline at end of file diff --git a/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.cs b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.cs new file mode 100644 index 00000000000..e32e1ba5066 --- /dev/null +++ b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.cs @@ -0,0 +1,62 @@ +#region Copyright (C) 2005-2023 Team MediaPortal + +// Copyright (C) 2005-2023 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal 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 of the License, or +// (at your option) any later version. +// +// MediaPortal 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 MediaPortal. If not, see . + +#endregion + +using System; +using System.IO; +using System.Windows.Forms; + +namespace MediaPortal.DeployTool.Sections +{ + public partial class TvServerWarningDlg : DeployDialog + { + public TvServerWarningDlg() + { + InitializeComponent(); + type = DialogType.TvServerWarning; + + UpdateUI(); + } + + #region IDeployDialog interface + + public override void UpdateUI() + { + labelHeading.Text = Localizer.GetBestTranslation("TvServerWarning_labelHeading"); + } + + public override DeployDialog GetNextDialog() + { + return DialogFlowHandler.Instance.GetDialogInstance( + InstallationProperties.Instance["OneClickInstallation"] == "1" ? DialogType.ExtensionChoice : DialogType.DBMSType); + } + + public override bool SettingsValid() + { + return true; + } + + public override void SetProperties() + { + } + + #endregion + + } +} \ No newline at end of file diff --git a/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx new file mode 100644 index 00000000000..bf69b80c7b7 --- /dev/null +++ b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsEAAA7BAbiRa+0AAAbISURBVFhH7ZZ/UJP3HccfoAlKjzm7anVsyoCz0m679Wpb + tMN1Kr0rrbU9a7vT6e46qXe72Wtv6ro/1h//7DrxF4HkeUJIYsIvIRASDCSQ0GB+SRIIQvgllnNOEEwg + JBIktNr3Pk9wnXf7ZVf1bnd97l73/T5Pnuf7fn9+PN8nDPPN8f+YAZlCLmjQ6z+sr6t/TyaT/+S+x6BU + Kjbp9U3T5lY7yEChRMIm3jcTLCv5XmVVzSWr1QibrQ56vXFeKi395X0zIJfLDtdrrTA17sdZ0yqYzSao + 1JpOysRD99wEx7FPazSNUa22DgOupR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2Hnji3oO0UG+OhJeLKBQbCORuK8NAlNkpfh8g6D9oU/ + /8csSCSSb1dUnhp0OHvQUvkKAmcSMU0Rh0iUFw/ZCL6+7fQFVDE4/TF9hIoYeGQMxjQLkQcp6gAJB2oY + TFTTtVMMbIVCtGiO4rSxPcxx3Lp/a6JUVna0xeJFk+4E+rVChHlxaqq/C0+10YJmygLRpWBw4h0GHxYI + 0XyYQZRqHiQTvHCARMeriAqinMGnXBL0R56GzemHUqmq/ZcGKPr06lPaMaPRBHPlZgStiQtRU8Qhaq4Q + L041niaiND+0ky+BAMvTnsTenTm4oKZ7+MhJnI88Ln6LIJlxUhb0ioNoanXMU5Nv/ScTCoVSazA6cJq6 + dkgnpGYTIOykLNhp5EvRnoCwZUF8lkqwYxNvIAXr1m/Br3a/gZ4yeuY0X4IHqP4CBDTCOEGNgHpBiEvq + JCpZJixmK06qqx0njp/4x2tJjZdTq9HN6BtOwq7JwxfnMxHzZyN2bi1ivkcR61qDuc4sxLx03ZMB+NLh + Vq/CS5uzsOO1fMj/tBGTph9gzrYWM23ZuNb2GGasPNlxosS87VH0KFdCJ92LRoMVYgn79pdZUKvLzUZT + O/3N+h06K9LhLV8Dr4pQEoqs28iER5ERx0c4uAyYj6+GkyNDskx0yNago/QWNHffhofmnfSMRfIMWg06 + VNdoLx07djwjbkJdXtHj9nSit9sNf7eH8KKvuwv9PT4M9HZjZHgAly+OIDB+BaFgANNTPEGEeULB+Jxn + KjCO8bHLGB+9jIvDQxjq64k/z6/Dr+f3Lax7ztcNi6X985yc9XlxA4WHC0s4TjolEpVERCLJAsWSSHEJ + GymRsBEJK42wbFmE5coiXJk8UlamWECujNCWHR/pPMxDv4fpvjDLysISlguXiNkwrROm9cJFInFYRBQX + 8zqirsWLU9Jvb0b+s3m/uaPd+Z7f9DdeiS/uFj2IyQAAAABJRU5ErkJggg== + + + \ No newline at end of file From 5f984e1ca894e5b4cb394f408da4e6ce71d87b04 Mon Sep 17 00:00:00 2001 From: epbk Date: Wed, 6 Dec 2023 10:56:07 +0100 Subject: [PATCH 11/31] MP1-5185: DeployTool: Add TV-Server x64 compatibility warning dialog to the project --- .../MediaPortal.DeployTool.csproj | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj index 91009583850..67940620d9f 100644 --- a/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj +++ b/Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj @@ -467,6 +467,10 @@ SkinChoice.cs + + TvServerWarningDlg.cs + Designer + UpgradeDlg.cs Designer @@ -558,6 +562,12 @@ SkinChoice.cs + + UserControl + + + TvServerWarningDlg.cs + UserControl From eb8296fd0b808759fbb0f2c7dc5885385a269038 Mon Sep 17 00:00:00 2001 From: epbk Date: Wed, 6 Dec 2023 11:44:07 +0100 Subject: [PATCH 12/31] MP1-5185: NSIS: Disable TV-Server x64 build until the branch 5184 will be merged --- Tools/InstallationScripts/include-MP-PreBuild.nsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/InstallationScripts/include-MP-PreBuild.nsh b/Tools/InstallationScripts/include-MP-PreBuild.nsh index 60bac798b48..dc96401a4f7 100644 --- a/Tools/InstallationScripts/include-MP-PreBuild.nsh +++ b/Tools/InstallationScripts/include-MP-PreBuild.nsh @@ -119,7 +119,9 @@ !system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform="Any CPU" "${git_TVServer}\TvPlugin\TvPlugin.sln"' = 0 !insertmacro FinalizeBuildReport !insertmacro PrepareBuildReport TvLibrary -!system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform=${Architecture} "${git_TVServer}\TvLibrary.sln"' = 0 +# Use x86 platform target; x64 configuration is not available for tv server yet +!system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform=x86 "${git_TVServer}\TvLibrary.sln"' = 0 +#!system '"${MSBuild_Path}" ${logger} /target:Rebuild /property:Configuration=Release;Platform=${Architecture} "${git_TVServer}\TvLibrary.sln"' = 0 !insertmacro FinalizeBuildReport !endif From cf13d369cea603f0ca3f89238570679d58aaffc1 Mon Sep 17 00:00:00 2001 From: epbk Date: Wed, 6 Dec 2023 12:15:55 +0100 Subject: [PATCH 13/31] MP1-5185: TvThumbnails: Change x86 project output path --- TvEngine3/TVLibrary/TvThumbnails/TvThumbnails.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TvEngine3/TVLibrary/TvThumbnails/TvThumbnails.csproj b/TvEngine3/TVLibrary/TvThumbnails/TvThumbnails.csproj index fb11b3dc69c..96572ea770b 100644 --- a/TvEngine3/TVLibrary/TvThumbnails/TvThumbnails.csproj +++ b/TvEngine3/TVLibrary/TvThumbnails/TvThumbnails.csproj @@ -37,13 +37,13 @@ true - bin\x86\Debug\ + bin\Debug\ DEBUG;TRACE full x86 - bin\x86\Release\ + bin\Release\ TRACE true pdbonly From e79de09a17452ec64965318b36137a9ff811c690 Mon Sep 17 00:00:00 2001 From: epbk Date: Fri, 8 Dec 2023 15:15:43 +0100 Subject: [PATCH 14/31] MP1-5185: DeployTool: Fix old TvServer x64 uninstall registry path --- Tools/MediaPortal.DeployTool/Utils.cs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Tools/MediaPortal.DeployTool/Utils.cs b/Tools/MediaPortal.DeployTool/Utils.cs index 97360ad9904..014dcfe55be 100644 --- a/Tools/MediaPortal.DeployTool/Utils.cs +++ b/Tools/MediaPortal.DeployTool/Utils.cs @@ -900,38 +900,47 @@ public static void FixMediaPortal64RegistryPath() { if (Is64bit()) { - const string NAME_OLD = "MediaPortal (x64)"; + FixMediaPortal64RegistryPath("MediaPortal"); + FixMediaPortal64RegistryPath("MediaPortal TV Server"); + } + } + + public static void FixMediaPortal64RegistryPath(string strName) + { + if (Is64bit()) + { + string strNameOld = strName + " (x64)"; const string PATH_UNINSTALL = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"; const string PATH_UNINSTALL_WOW6432 = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"; - const string PATH_MP = PATH_UNINSTALL + @"\MediaPortal"; - const string PATH_MP_OLD = PATH_UNINSTALL_WOW6432 + @"\" + NAME_OLD; + string strPath = PATH_UNINSTALL + @"\" + strName; + string strPathOld = PATH_UNINSTALL_WOW6432 + @"\" + strNameOld; - RegistryKey keyOld = Registry.LocalMachine.OpenSubKey(PATH_MP_OLD); + RegistryKey keyOld = Registry.LocalMachine.OpenSubKey(strPathOld); if (keyOld != null) { //Existing old registry path - RegistryKey key = Registry.LocalMachine.OpenSubKey(PATH_MP); + RegistryKey key = Registry.LocalMachine.OpenSubKey(strPath); if (key == null) { //Create new registry path using (RegistryKey localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)) { - key = localKey.CreateSubKey(PATH_MP); + key = localKey.CreateSubKey(strPath); } } //Copy all values from the old key to the new key - foreach (string strName in keyOld.GetValueNames()) + foreach (string strValueName in keyOld.GetValueNames()) { - key.SetValue(strName, keyOld.GetValue(strName), keyOld.GetValueKind(strName)); + key.SetValue(strValueName, keyOld.GetValue(strValueName), keyOld.GetValueKind(strValueName)); } //Delete old key using (RegistryKey k = Registry.LocalMachine.OpenSubKey(PATH_UNINSTALL_WOW6432, true)) { - k.DeleteSubKeyTree(NAME_OLD); + k.DeleteSubKeyTree(strNameOld); } key.Dispose(); From 75a816df6dbec20e758d7daac95680d406b5694d Mon Sep 17 00:00:00 2001 From: epbk Date: Fri, 8 Dec 2023 15:17:32 +0100 Subject: [PATCH 15/31] MP1-5185: Fix TvService & WatchdogService registering (try to uninstall first) --- TvEngine3/TVLibrary/TvService/Service1.cs | 4 ++++ TvEngine3/TVLibrary/WatchDogService/Program.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/TvEngine3/TVLibrary/TvService/Service1.cs b/TvEngine3/TVLibrary/TvService/Service1.cs index 0bb902917ed..04f031aa93e 100644 --- a/TvEngine3/TVLibrary/TvService/Service1.cs +++ b/TvEngine3/TVLibrary/TvService/Service1.cs @@ -157,6 +157,10 @@ private static void Main(string[] args) String[] cmdline = { path }; InstallContext ctx = new InstallContext("", cmdline); ti.Context = ctx; + + //Try to uninstall first + try { ti.Uninstall(null); } catch { }; + ti.Install(new Hashtable()); return; } diff --git a/TvEngine3/TVLibrary/WatchDogService/Program.cs b/TvEngine3/TVLibrary/WatchDogService/Program.cs index 91397ae5e94..f10739642b2 100644 --- a/TvEngine3/TVLibrary/WatchDogService/Program.cs +++ b/TvEngine3/TVLibrary/WatchDogService/Program.cs @@ -32,6 +32,10 @@ static void Main(string[] args) String[] cmdline = { path }; InstallContext ctx = new InstallContext("", cmdline); ti.Context = ctx; + + //Try to uninstall first + try { ti.Uninstall(null); } catch { }; + ti.Install(new Hashtable()); return; } From 813645e1dca99466e8b82b63e8c4aba4ab7821a0 Mon Sep 17 00:00:00 2001 From: epbk Date: Fri, 8 Dec 2023 15:18:55 +0100 Subject: [PATCH 16/31] MP1-5185: NSIS: Fix string comparision syntax --- TvEngine3/TVLibrary/Setup/setup.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TvEngine3/TVLibrary/Setup/setup.nsi b/TvEngine3/TVLibrary/Setup/setup.nsi index a81ea41624f..700724a28a1 100644 --- a/TvEngine3/TVLibrary/Setup/setup.nsi +++ b/TvEngine3/TVLibrary/Setup/setup.nsi @@ -887,7 +887,7 @@ ${MementoSectionEnd} ${If} ${TVClientIsInstalled} ${LOG_TEXT} "INFO" "TV Client plugin is installed" - ${If} $MPdir.Base = "" + ${If} $MPdir.Base == "" ${LOG_TEXT} "ERROR" "MediaPortal Directory not found, TVClient plugin uninstallation will fail!!" ${Else} ${LOG_TEXT} "INFO" "Removing TV Client plugin in: $MPdir.Base" From 4203414f8fb0517a9844a08fb758feb7b7a01f66 Mon Sep 17 00:00:00 2001 From: epbk Date: Fri, 8 Dec 2023 15:21:46 +0100 Subject: [PATCH 17/31] MP1-5185: DeployTool: Fix TvServer/TvClient uninstall order --- .../InstallationChecks/TvServerChecker.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs b/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs index 5f445397c2e..a83e1511fd1 100644 --- a/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs +++ b/Tools/MediaPortal.DeployTool/InstallationChecks/TvServerChecker.cs @@ -128,13 +128,16 @@ public CheckResult CheckStatus() if (InstallationProperties.Instance["InstallType"] == "download_only") { result.state = result.needsDownload == false ? CheckState.DOWNLOADED : CheckState.NOT_DOWNLOADED; - return result; } - - CheckResult already = Utils.CheckNSISUninstallString("MediaPortal TV Server", "MementoSection_SecServer"); - if (already.state != CheckState.NOT_INSTALLED) + else if (result.state != CheckState.VERSION_MISMATCH) { - result.state = CheckState.INSTALLED; + //If the TvServer uninstall is not going to be executed, then check if the client is installed. If yes, then force to uninstall TvSever first. + //Otherwise the client will unistall the new TvServer installation. + CheckResult resultClient = Utils.CheckNSISUninstallString("MediaPortal TV Server", "MementoSection_SecClient"); + if (resultClient.state == CheckState.VERSION_MISMATCH) + { + result.state = CheckState.VERSION_MISMATCH; + } } return result; From 84c477334639db34bbffd0fb3a1b5a516897da56 Mon Sep 17 00:00:00 2001 From: epbk Date: Fri, 8 Dec 2023 16:00:26 +0100 Subject: [PATCH 18/31] MP1-5185: DeployTool: Update TV-Server x64 compatibility warning dialog --- .../Sections/TvServerWarningDlg.Designer.cs | 10 +-- .../Sections/TvServerWarningDlg.resx | 68 ++++++++++--------- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs index feabc430fd5..48993f5cfbd 100644 --- a/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs +++ b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.Designer.cs @@ -57,15 +57,17 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.SuspendLayout(); // - // labelCards + // labelDevices // this.labelDevices.AutoSize = true; this.labelDevices.ForeColor = System.Drawing.Color.White; this.labelDevices.Location = new System.Drawing.Point(330, 113); this.labelDevices.Name = "labelDevices"; - this.labelDevices.Size = new System.Drawing.Size(37, 13); + this.labelDevices.Size = new System.Drawing.Size(267, 65); this.labelDevices.TabIndex = 19; - this.labelDevices.Text = " - Haupage WinTV_CI: hcwWinTVCI.dll, hauppauge.dll\r\n - TeVii: TeVii.dll\r\n - Technotrend: ttBdaDrvApi_Dll.dll, ttdvbacc.dll\r\n - ODSoft multimedia KNC CI: KNCBDACTRL.dll\r\n - HCWIRBlaster: hcwIRblast.dll"; + this.labelDevices.Text = " - Haupage WinTV_CI: hcwWinTVCI.dll, hauppauge.dll\r\n - TeVii: TeVii.dll\r\n - Techn" + + "otrend: ttBdaDrvApi_Dll.dll, ttdvbacc.dll\r\n - ODSoft multimedia KNC CI: KNCBDACT" + + "RL.dll\r\n - HCWIRBlaster: hcwIRblast.dll"; // // labelHeading // @@ -90,7 +92,7 @@ private void InitializeComponent() // // pictureBox2 // - this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("Warning"))); + this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); this.pictureBox2.Location = new System.Drawing.Point(243, 70); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(64, 64); diff --git a/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx index bf69b80c7b7..6c0968afe19 100644 --- a/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx +++ b/Tools/MediaPortal.DeployTool/Sections/TvServerWarningDlg.resx @@ -118,39 +118,43 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsEAAA7BAbiRa+0AAAbISURBVFhH7ZZ/UJP3HccfoAlKjzm7anVsyoCz0m679Wpb - tMN1Kr0rrbU9a7vT6e46qXe72Wtv6ro/1h//7DrxF4HkeUJIYsIvIRASDCSQ0GB+SRIIQvgllnNOEEwg - JBIktNr3Pk9wnXf7ZVf1bnd97l73/T5Pnuf7fn9+PN8nDPPN8f+YAZlCLmjQ6z+sr6t/TyaT/+S+x6BU - Kjbp9U3T5lY7yEChRMIm3jcTLCv5XmVVzSWr1QibrQ56vXFeKi395X0zIJfLDtdrrTA17sdZ0yqYzSao - 1JpOysRD99wEx7FPazSNUa22DgOupRi9IISlbiuaTF5QFj66pwZYlk0qL6/QGgw2NNduB8DE6Wn/FtpM - J6GpM105duzo4/fMBEX/i8bGthvNzVUY6Uz+0gBuMjBXbYTdMUBZkNOhSLjrJiQS8dKqqpphu72PUp6/ - ID53CzLQa3kQHnsZjCZXTMpJN991A1Kp9FBLy1mcsbK44E4GJ34SB97dgoMHNuGDP+bhU18qHHVPwNXh - R1V1bWtpqSz5rpkQi8VrdbqmQJfPB1dzLj6LMti/vwAFBe9jb8F72LPnABzG1Rj1pMLZ/Ac4O/q/KCoS - vXlXDFDjJapUqtL+gb/irOMI/uIXYn4mCYcO7sK+fe+Sid9g95434TKmA6FFaC9/HONXJtCgMw6wLJf2 - tU2IxcU/M1uc1zvcTgzavg/cTMCNqIDS/yp27noLr7+xC1tf3ga3kX4LLMMVVwpsmr2YCMyCyvDx1zJA - qU+urKz2TFy9BrvxLcyMCoHZhxCbTME7b+ch/8XXkff8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cg5QF+4ISJLSgo6G4eQI3tdqDsqskW + ofzvaAwM3MDP46U4xqiF9v/m3tMUB9udPpxbCWhVo9R1c5cFrCzwHxu/4M8vqoMwAAAAAElFTkSuQmCC \ No newline at end of file From 2b9b2da56f3a0968f2a8bcc2e47b02fcdb444947 Mon Sep 17 00:00:00 2001 From: epbk Date: Sat, 9 Dec 2023 09:57:00 +0100 Subject: [PATCH 19/31] MP1-5185: DeployTool: Add extension platform compatibility whitelist --- .../MPE/MpeCore/Classes/GeneralInfoItem.cs | 73 ++++++++++++++++++- .../ExtensionPlatformCompatibilityList.txt | 3 + mediaportal/MPE/MpeCore/MpeCore.csproj | 3 + 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 mediaportal/MPE/MpeCore/Data/ExtensionPlatformCompatibilityList.txt diff --git a/mediaportal/MPE/MpeCore/Classes/GeneralInfoItem.cs b/mediaportal/MPE/MpeCore/Classes/GeneralInfoItem.cs index c5ca348b50c..49dc4f9f5d9 100644 --- a/mediaportal/MPE/MpeCore/Classes/GeneralInfoItem.cs +++ b/mediaportal/MPE/MpeCore/Classes/GeneralInfoItem.cs @@ -21,11 +21,14 @@ using System; using System.Collections.Generic; using System.Text; +using System.IO; namespace MpeCore.Classes { public class GeneralInfoItem { + private static List _ExtensionsWhiteList = null; + public GeneralInfoItem() { Version = new VersionInfo(); @@ -62,7 +65,13 @@ public GeneralInfoItem() public string Tags { get; set; } public PlatformCompatibilityEnum PlatformCompatibility { - get { return this._PlatformCompatibility; } + get + { + if (this.TryGetPlatformCompatibilityFromList(out PlatformCompatibilityEnum compatibility)) + return compatibility; + + return this._PlatformCompatibility; + } set { this._PlatformCompatibility = value; } } private PlatformCompatibilityEnum _PlatformCompatibility = PlatformCompatibilityEnum.x86; @@ -78,5 +87,67 @@ public TagCollection TagList { get { return new TagCollection(Tags); } } + + private bool TryGetPlatformCompatibilityFromList(out PlatformCompatibilityEnum compatibility) + { + compatibility = PlatformCompatibilityEnum.x86; + + if (_ExtensionsWhiteList == null) + { + //Build extension list from embeded resource txt file + try + { + using (Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MpeCore.Data.ExtensionPlatformCompatibilityList.txt")) + { + List list = new List(); + StreamReader sr = new StreamReader(stream); + string strLine; + while (!sr.EndOfStream) + { + strLine = sr.ReadLine().Trim(); + if (string.IsNullOrWhiteSpace(strLine) || strLine.StartsWith("#")) + continue; + + //#GUID;VERSION;COMPATIBILITY;DESCRIPTION + string[] parts = strLine.Split(';'); + if (parts.Length < 4) + continue; + + VersionInfo version = new VersionInfo(new Version(parts[1])); + + if (list.Exists(p => p.Id.Equals(parts[0], StringComparison.CurrentCultureIgnoreCase) && p.Version == version)) + continue; + + list.Add(new GeneralInfoItem() + { + Id = parts[0], + Version = version, + PlatformCompatibility = (PlatformCompatibilityEnum)Enum.Parse(typeof(PlatformCompatibilityEnum), parts[2]), + ExtensionDescription = parts[3] + }); + + } + + //Set the extension list + _ExtensionsWhiteList = list; + } + + } + catch + { + return false; + } + } + + //Try find the extension in the whitelist + GeneralInfoItem gi = _ExtensionsWhiteList.Find(p => p.Id.Equals(this.Id, StringComparison.CurrentCultureIgnoreCase) && p.Version == this.Version); + if (gi != null) + { + compatibility = gi._PlatformCompatibility; //use private field to avoid recursion + return true; + } + + return false; + } } } \ No newline at end of file diff --git a/mediaportal/MPE/MpeCore/Data/ExtensionPlatformCompatibilityList.txt b/mediaportal/MPE/MpeCore/Data/ExtensionPlatformCompatibilityList.txt new file mode 100644 index 00000000000..88d134d7bfa --- /dev/null +++ b/mediaportal/MPE/MpeCore/Data/ExtensionPlatformCompatibilityList.txt @@ -0,0 +1,3 @@ +#GUID;VERSION;COMPATIBILITY;DESCRIPTION +b7738156-b6ec-4f0f-b1a8-b5010349d8b1;0.78.0.0;AnyCPU;LAV Filters +e14cf436-6e19-4b40-b65f-3bbc934ae521;1.11.0.2;AnyCPU;SchedulesDirect Plugin \ No newline at end of file diff --git a/mediaportal/MPE/MpeCore/MpeCore.csproj b/mediaportal/MPE/MpeCore/MpeCore.csproj index f9f860ac1af..58051b1ed8f 100644 --- a/mediaportal/MPE/MpeCore/MpeCore.csproj +++ b/mediaportal/MPE/MpeCore/MpeCore.csproj @@ -346,6 +346,9 @@ + + +