Skip to content

Commit

Permalink
Merge pull request #230 from MediaPortal/MP1-5181-Add_platform_compat…
Browse files Browse the repository at this point in the history
…ibility_information_to_MPE_InstallerMaker

MP1-5181: Add platform compatibility information to MPE Installer/Maker
  • Loading branch information
andrewjswan authored Nov 13, 2023
2 parents 99c36e2 + 9be198d commit ce0e328
Show file tree
Hide file tree
Showing 19 changed files with 1,277 additions and 1,108 deletions.
2 changes: 2 additions & 0 deletions mediaportal/MPE/MpeCore/Classes/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public ApplicationSettings()
IgnoredUpdates = new List<string>();
ExpandTile = false;
ExpandTileFullWidth = false;
PlatformCompatibilityCheck = true;
}

public DateTime LastUpdate { get; set; }
Expand All @@ -65,6 +66,7 @@ public ApplicationSettings()
public bool ExpandTile { get; set; }
public bool ExpandTileFullWidth { get; set; }
public Size FormSize { get; set; }
public bool PlatformCompatibilityCheck { get; set; }

public void Save()
{
Expand Down
8 changes: 6 additions & 2 deletions mediaportal/MPE/MpeCore/Classes/ExtensionCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,26 @@ public ExtensionCollection()
/// <returns></returns>
public ExtensionCollection GetUniqueList()
{
return GetUniqueList(null);
return GetUniqueList(null, false);
}

/// <summary>
/// Gets the unique list of extensions with highest version
/// </summary>
/// <param name="exlude">Exlude these extensions</param>
/// <param name="bPlatformCompatibleOnly">Check for platform compatibility</param>
/// <returns></returns>
public ExtensionCollection GetUniqueList(ExtensionCollection exlude)
public ExtensionCollection GetUniqueList(ExtensionCollection exlude, bool bPlatformCompatibleOnly)
{
HashSet<string> exludedIds = new HashSet<string>();
if (exlude != null) exlude.Items.ForEach(p => exludedIds.Add(p.GeneralInfo.Id));
Dictionary<string, PackageClass> ids = new Dictionary<string, PackageClass>();

foreach (PackageClass item in Items)
{
if (bPlatformCompatibleOnly && !item.IsPlatformCompatible)
continue;

if (item.IsHiden || exludedIds.Contains(item.GeneralInfo.Id))
continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace MpeCore.Classes
{
public static class ExtensionUpdateDownloader
{
public const string UpdateIndexUrl = "http://install.team-mediaportal.com/MPEI/extensions.txt";
public const string UpdateIndexUrl = "https://install.team-mediaportal.com/MPEI/extensions.txt";

static string tempUpdateIndex;

Expand Down
5 changes: 5 additions & 0 deletions mediaportal/MPE/MpeCore/Classes/GeneralInfoItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public GeneralInfoItem()
public string OnlineLocation { get; set; }
public DateTime ReleaseDate { get; set; }
public string Tags { get; set; }
public PlatformCompatibilityEnum PlatformCompatibility
{
get { return this._PlatformCompatibility; }
set { this._PlatformCompatibility = value; }
} private PlatformCompatibilityEnum _PlatformCompatibility = PlatformCompatibilityEnum.x86;

/// <summary>
/// Gets or sets the location of packed file.
Expand Down
14 changes: 14 additions & 0 deletions mediaportal/MPE/MpeCore/Classes/PlatformCompatibilityEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MpeCore.Classes
{
public enum PlatformCompatibilityEnum
{
x86 = 0,
x64 = 1,
AnyCPU = 2
}
}
1 change: 1 addition & 0 deletions mediaportal/MPE/MpeCore/MpeCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<Compile Include="Classes\InstallerType\GenericSkinFile.cs" />
<Compile Include="Classes\ParamNamesConst.cs" />
<Compile Include="Classes\PathProvider\TvServerPaths.cs" />
<Compile Include="Classes\PlatformCompatibilityEnum.cs" />
<Compile Include="Classes\PluginDependencyItem.cs" />
<Compile Include="Classes\PluginDependencyItemCollection.cs" />
<Compile Include="Classes\PluginLoader.cs" />
Expand Down
21 changes: 19 additions & 2 deletions mediaportal/MPE/MpeCore/PackageClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public PackageClass()
public FileItemCollection UniqueFileList { get; set; }
public ProjectSettings ProjectSettings { get; set; }
public bool IsSkin { get; set; }

[XmlIgnore]
[XmlIgnore]
public ExtensionCollection Parent { get; set; }

[XmlIgnore]
Expand All @@ -86,6 +86,23 @@ public PackageClass()
[XmlIgnore]
public bool IsHiden { get; set; }

[XmlIgnore]
public bool IsPlatformCompatible
{
get
{
if (this.GeneralInfo == null)
return false;

if (IntPtr.Size == 8)
return this.GeneralInfo.PlatformCompatibility == PlatformCompatibilityEnum.AnyCPU ||
this.GeneralInfo.PlatformCompatibility == PlatformCompatibilityEnum.x64;
else
return this.GeneralInfo.PlatformCompatibility == PlatformCompatibilityEnum.AnyCPU ||
this.GeneralInfo.PlatformCompatibility == PlatformCompatibilityEnum.x86;
}
}

/// <summary>
/// Gets the location folder were stored the backup and the uninstall informations. Ended with \
/// </summary>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ public ExtensionControlCollapsed()
InitializeComponent();
}

public void Initialize(string name, string authors, string version, bool meetsAllDependencies, string updateVersion, Action<ExtensionControlCollapsed> onClick)
public void Initialize(string name, string authors, string platform, string version, bool meetsAllDependencies, string updateVersion, Action<ExtensionControlCollapsed> onClick)
{
lbl_name.Text = name;
lblAuthors.Text = string.Format("[{0}]", authors);
lbl_Platform.Text = string.Format("[{0}]", platform);
lbl_version.Text = version;
img_dep.Visible = meetsAllDependencies;
if (meetsAllDependencies)
Expand Down
Loading

0 comments on commit ce0e328

Please sign in to comment.