Introducing WMC mini-mods

Discussion of getting WMC to work on Windows 11 (unsupported)
User avatar
IT Troll

Posts: 1234
Joined: Sun Nov 27, 2011 9:42 am
Location: Edinburgh, UK

HTPC Specs: Show details

#21

Post by IT Troll » Sat Jan 27, 2024 8:40 am

I've not gone ALAC, but I did switch to M4A a few years back. I use iTunes on Windows with iTunes Match to keep a copy in the cloud for ease of access on my phone, in the car etc.
Are you a Recorded TV HD user or want to give it a try? Check out the community-made update; Recorded TV HD v2.1.1

jea101

Posts: 5
Joined: Wed Apr 01, 2015 2:57 pm
Location:

HTPC Specs: Show details

#22

Post by jea101 » Wed Jan 31, 2024 1:34 am

Does 1.3 include all the patches?

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#23

Post by Kevin Chalet » Wed Jan 31, 2024 1:50 am

jea101 wrote: Wed Jan 31, 2024 1:34 am Does 1.3 include all the patches?
It does.

Peter167

Posts: 23
Joined: Sat Jul 23, 2016 3:31 pm
Location:

HTPC Specs: Show details

#24

Post by Peter167 » Thu Feb 01, 2024 6:42 pm

Kevin

Very impressive work.

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#25

Post by Kevin Chalet » Thu Feb 01, 2024 6:58 pm

Thanks Peter. I hope one of these mini-mods will be useful for you :mrgreen:

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#26

Post by Kevin Chalet » Fri Feb 02, 2024 2:42 am

New 1.4.0 release:

Microsoft.MediaCenter.dll patches:

Option to override the command code associated with the spacebar shortcut:

By default, the spacebar is mapped to CommandCode.Enter and pressing the spacebar while watching live TV always switches between the current channel and the previous one.
This behavior differs from what we see in other programs like VLC, where pressing the spacebar allows playing or pausing the media. Since all keyboards (and MCE remotes) already have a dedicated Enter button that does exactly the same thing, being able to remap the spacebar shortcut to do something else can be very handy. For that, I simply had to patch the Shortcuts class:

Code: Select all

using System;
using Microsoft.MediaCenter.UI;
using Microsoft.MediaCenter.UI.Legacy;
using Microsoft.Win32;

namespace Microsoft.MediaCenter.Hosting.Infrastructure
{
    // Token: 0x02000098 RID: 152
    internal sealed partial class Shortcuts
    {
        // Token: 0x060004DE RID: 1246 RVA: 0x00012420 File Offset: 0x00010620
        // Note: this type is marked as 'beforefieldinit'.
        static Shortcuts()
        {
            Shortcuts._cRepCampValue = 7;
            Shortcuts.s_Constants = new Shortcuts.Shortcut[]
            {
                new Shortcuts.Shortcut(Keys.P, CommandCode.Play, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.G, CommandCode.Guide, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.R, CommandCode.Record, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.D, CommandCode.Details, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.M, CommandCode.DVDMenu, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.T, CommandCode.LiveTV, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.M, CommandCode.MyMusic, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.A, CommandCode.MyRadio, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.E, CommandCode.MyVideos, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.I, CommandCode.MyPictures, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.A, CommandCode.DVDAudio, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.U, CommandCode.DVDSubtitles, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.P, CommandCode.Pause, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.S, CommandCode.Stop, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.B, CommandCode.SkipBack, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F, CommandCode.SkipForward, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.T, CommandCode.MyTV, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.B, CommandCode.Rewind, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F, CommandCode.FF, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F8, CommandCode.Mute, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F9, CommandCode.VolumeDown, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.F10, CommandCode.VolumeUp, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.Back, CommandCode.Back, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Escape, CommandCode.Clear, false, false, false, false, Shortcuts.Device.Remote, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.OemPlus, CommandCode.ChannelUp, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.OemPlus, CommandCode.ChannelUp, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.OemMinus, CommandCode.ChannelDown, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.Subtract, CommandCode.ChannelDown, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.Add, CommandCode.ChannelUp, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.BrowserForward, CommandCode.Forward, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Next, CommandCode.ChannelDown, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.PageUp, CommandCode.ChannelUp, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.Yes),
                new Shortcuts.Shortcut(Keys.Home, CommandCode.StartOfList, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Home, CommandCode.Home, false, false, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.End, CommandCode.EndOfList, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.C, CommandCode.ClosedCaption, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.N, CommandCode.SourceSwitch, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.L, CommandCode.VideoSelection, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                GetSpacebarShortcut(),
                new Shortcuts.Shortcut(Keys.Enter, CommandCode.Enter, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Enter, CommandCode.ToggleWindowMode, false, false, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Enter, CommandCode.Home, false, false, true, true, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.O, CommandCode.RecordedTV, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F5, CommandCode.Refresh, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F4, CommandCode.Reload, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Print, CommandCode.Print, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.OemTilde, CommandCode.Console, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.OemTilde, CommandCode.DesignMode, false, false, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F3, CommandCode.Kanji, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F6, CommandCode.Kana, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.C, CommandCode.Copy, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.V, CommandCode.Paste, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Z, CommandCode.AdvanceZoomMode, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.R, CommandCode.MorePrograms, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.N, CommandCode.Messenger, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.T, CommandCode.Interactive, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.R, CommandCode.Red, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.G, CommandCode.Green, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Y, CommandCode.Yellow, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.B, CommandCode.Blue, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.V, CommandCode.Reveal, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.H, CommandCode.Hold, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Q, CommandCode.PlayPause, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.Home, CommandCode.GoToBeginning, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.End, CommandCode.GoToEnd, false, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F10, CommandCode.Preset10, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F11, CommandCode.Preset11, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F12, CommandCode.Preset12, false, true, true, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.H, CommandCode.AudioSelection, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.G, CommandCode.DVDAngle, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.D, CommandCode.DVDMenu, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F1, CommandCode.OEMExtensibility0, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F2, CommandCode.OEMExtensibility1, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F3, CommandCode.OEMExtensibility2, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F4, CommandCode.OEMExtensibility3, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F5, CommandCode.OEMExtensibility4, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F6, CommandCode.OEMExtensibility5, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F7, CommandCode.OEMExtensibility6, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F8, CommandCode.OEMExtensibility7, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F9, CommandCode.OEMExtensibility8, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.F10, CommandCode.OEMExtensibility9, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No),
                new Shortcuts.Shortcut(Keys.N, CommandCode.LogicalChannel, true, true, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No)
            };

            static Shortcut GetSpacebarShortcut()
            {
                CommandCode code;

                using var key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Media Center");
                if (key is null || key.GetValue("SpacebarShortcutCommandCode") is not string value || !Enum.TryParse<CommandCode>(value, ignoreCase: true, result: out code))
                {
                    code = CommandCode.Enter;
                }

                return new Shortcuts.Shortcut(Keys.Space, code, false, false, false, false, Shortcuts.Device.Any, Shortcuts.Repeat.No);
            }
        }
    }
}
For instance, to remap the spacebar shortcut to PlayPause:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center]
"SpacebarShortcutCommandCode"="PlayPause"
If you want to remap it to something else, here's the complete list of supported command codes:

Code: Select all

internal enum CommandCode
{
	None = 0,
	Guide = 1,
	ChannelUp = 2,
	PageUp = 2,
	ChannelDown = 3,
	PageDown = 3,
	Play = 4,
	Pause = 5,
	Record = 6,
	FF = 7,
	Rewind = 8,
	SkipForward = 9,
	SkipBack = 10,
	Stop = 11,
	Mute = 12,
	VolumeUp = 13,
	VolumeDown = 14,
	Details = 15,
	Back = 16,
	Home = 17,
	MyPictures = 18,
	LiveTV = 19,
	MyShows = 20,
	MyMusic = 21,
	DVDMenu = 22,
	MyVideos = 23,
	DVDAudio = 24,
	DVDSubtitles = 25,
	Clear = 26,
	MyTV = 27,
	Forward = 28,
	PlayPause = 30,
	GoToBeginning = 31,
	GoToEnd = 32,
	StartOfList = 33,
	EndOfList = 34,
	ClosedCaption = 35,
	Enter = 36,
	ToggleWindowMode = 37,
	RecordedTV = 38,
	Refresh = 39,
	DVDAngle = 40,
	Reload = 41,
	Print = 42,
	Console = 43,
	Kanji = 44,
	Kana = 45,
	MyRadio = 46,
	Copy = 47,
	Paste = 48,
	SearchGuide = 49,
	AdvanceZoomMode = 50,
	MyGames = 51,
	MorePrograms = 52,
	Interactive = 53,
	Red = 54,
	Green = 55,
	Yellow = 56,
	Blue = 57,
	MCEPower = 58,
	DesignMode = 59,
	ToBeRecorded = 60,
	Messenger = 61,
	Deprecated1 = 62,
	Hangul = 63,
	Hanja = 64,
	PlayDisc = 65,
	ToggleLock = 66,
	SymphonyMessenger = 67,
	OnlineSpotlight = 68,
	OEMExtensibilityLaunch1 = 69,
	Extender = 70,
	Minimize = 71,
	Close = 72,
	OEMExtensibility0 = 73,
	OEMExtensibility1 = 74,
	OEMExtensibility2 = 75,
	OEMExtensibility3 = 76,
	OEMExtensibility4 = 77,
	OEMExtensibility5 = 78,
	OEMExtensibility6 = 79,
	OEMExtensibility7 = 80,
	OEMExtensibility8 = 81,
	OEMExtensibility9 = 82,
	OEMExtensibility10 = 83,
	OEMExtensibility11 = 84,
	LogicalChannel = 85,
	AudioSelection = 86,
	Preset10 = 87,
	Preset11 = 88,
	Preset12 = 89,
	Reveal = 90,
	Hold = 91,
	DIRECTVPrevious = 92,
	DIRECTVMenu = 93,
	DIRECTVActive = 94,
	DIRECTVRed = 95,
	DIRECTVGreen = 96,
	DIRECTVBlue = 97,
	DIRECTVYellow = 98,
	DIRECTVDash = 99,
	ToggleDebugOverlay = 100,
	SourceSwitch = 101,
	VideoSelection = 102,
	CampFF = 103,
	CampRewind = 104,
	TransportCaptioning = 105
}
acer-5100> thanks for the idea! :mrgreen:
You do not have the required permissions to view the files attached to this post.

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#27

Post by Kevin Chalet » Fri Feb 02, 2024 3:30 am

New 2.0.0 release:

To make the mini-mods-specific registry hooks easier to configure, I decided to centralize them under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\MiniMods.
The previous locations are no longer supported and you'll need to move them under the new location for the mini-mods to have an affect when using the 2.0.0+ version.

For clarity, WriteAdditionalMetadata was also renamed to WriteAdditionalRecordingMetadata.

Here's the complete list of supported hooks:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\MiniMods]
"AlbumPlaylistSortAttribute"="SourceURL"
"DisableFullscreenOptimizations"=dword:00000001
"DisableInvalidRecordingsDeletion"=dword:00000001
"DisableQuickLinkImageFilters"=dword:00000001
"DisableRemoteSessionSupport"=dword:00000001
"DisableVideoOverscan"=dword:00000001
"DisableWindowedMode"=dword:00000001
"SpacebarShortcutCommandCode"="PlayPause"
"WriteAdditionalRecordingMetadata"=dword:00000001
Note: the 2.0.0 release also includes the tweaked .cs file for each modded API.
You do not have the required permissions to view the files attached to this post.

User avatar
IT Troll

Posts: 1234
Joined: Sun Nov 27, 2011 9:42 am
Location: Edinburgh, UK

HTPC Specs: Show details

#28

Post by IT Troll » Fri Feb 02, 2024 10:27 am

This is shaping up to be a really nice collection of fixes/mods. :thumbup:
You might want to consider posting something in the Windows 10 & 8 forums as it may be of interest to folks who aren't monitoring the 11 forum.
Are you a Recorded TV HD user or want to give it a try? Check out the community-made update; Recorded TV HD v2.1.1

Space

Posts: 2860
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#29

Post by Space » Sat Feb 03, 2024 12:29 am

It might also be a good idea to make them available for the Win7 version of WMC, as I would guess that is the largest audience (just guessing here). Of course, if it's a hassle, you might want to see if there is a demand for it first.

User avatar
StinkyImp

Posts: 676
Joined: Thu May 11, 2017 7:53 pm
Location:

HTPC Specs: Show details

#30

Post by StinkyImp » Sat Feb 03, 2024 3:48 pm

Space wrote: Sat Feb 03, 2024 12:29 am It might also be a good idea to make them available for the Win7 version of WMC...
To quote Kevin, "It won't work (at all) on Windows 7..."

Original post -> viewtopic.php?t=14526#p152800

stuartm

Posts: 742
Joined: Mon Nov 05, 2012 8:05 pm
Location: Longmont, CO

HTPC Specs: Show details

#31

Post by stuartm » Sat Feb 03, 2024 6:33 pm

To also quote Kevin:

"It should be possible to apply the same modifications using dnSpy: the only difference is WMC for Windows 7 is compiled against .NET Framework 2.0 while WMC for WIndows 8 targets .NET Framework 4.0 (which means a lot more APIs are available). That said, I don't think I used any of these new APIs in my mods so it should be trivial."

So there would presumably be an equivalent seperate set of mods against the win 7 DLL(s) possible.
Which I assume is what Space was asking for.

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#32

Post by Kevin Chalet » Sat Feb 03, 2024 7:29 pm

Offering a Windows 7 version is something I considered but I no longer have any machine on Windows 7, which would make testing WMC mini-mods releases on real setups a lot more complicated (I was an absolute Vista/7 fan but I migrated all my PCs/HTPCs to Windows 10 shortly after 7 stopped being supported).

That's also the reason why WMC mini-mods is officially 64-bits only: so far, I've only patched AnyCPU .NET assemblies, but it's not impossible I'll need to patch .NET assemblies compiled for x86 or x64 at some point... which will require maintaining 2 separate versions (and sadly, Microsoft stopped offering x86 versions of Windows 11, so x86 is pretty much a dead end).

So, not a strong "no", but it would require a strong demand from the community to justify doing 4 times the same work for each release (2 x86 versions + 2 x64 versions) :mrgreen:

Space

Posts: 2860
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#33

Post by Space » Sat Feb 03, 2024 10:14 pm

stuartm wrote: Sat Feb 03, 2024 6:33 pm ...
So there would presumably be an equivalent seperate set of mods against the win 7 DLL(s) possible.
Which I assume is what Space was asking for.
Yes, but I'm not asking for them, just suggesting that there might be a wider audience for them. I personally don't have a big enough need for them (I use win7 WMC) to substantiate the extra work involved, but there may be many others that would appreciate the effort to make them available to them.

There may also be additional future mods that I WOULD want for my win7 system.

This thread is the in Win11 section of the forums, so there may be many Win7 WMC users that don't even know about it, or the potential for it to be ported to Win7.

I know that Gary has VMs set up to test EPG123 using different operating systems, so that is one way to do it, but I understand this is not a small undertaking, so it's why I suggested to Kevin, that if he was open to it and wanted a potential larger audience to use his mods, it might be something to look in to.

For some people, just knowing that many others are enjoying their work is enough to motivate them, and this would be a way to increase the audience of people who would be able to utilize these nice mods. It is completely up to Kevin if he chooses to do so, so there is no pressure here (at least from me :D).

I just suggested that there might be a larger audience on the Win7 side, but to be honest, I don't really know if this is the case anymore. The biggest reason to stay on Win7 WMC is PlayReady and DRM recordings. With Win7 you can record DRM protected recordings from cable and also play back DRM recordings that you have from the past. Even if you are not using your WMC to record anymore, you would still need to keep it to play back any old DRM recordings you have. So just based on that, I would think there are many Win7 users, but I may be mistaken.

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#34

Post by Kevin Chalet » Mon Feb 05, 2024 7:19 pm

IT Troll wrote: Fri Feb 02, 2024 10:27 am This is shaping up to be a really nice collection of fixes/mods. :thumbup:
You might want to consider posting something in the Windows 10 & 8 forums as it may be of interest to folks who aren't monitoring the 11 forum.
Good idea! I'll ping holidayboy and see if we can add a link to this thread (having parallel threads would be painful to follow)
Space wrote: Sat Feb 03, 2024 10:14 pm This thread is the in Win11 section of the forums, so there may be many Win7 WMC users that don't even know about it, or the potential for it to be ported to Win7.
Amusingly, I don't have any production machine on Windows 11 (I'm still on Windows 10). I only posted it here because the section seemed less crowded :mrgreen:
Space wrote: Sat Feb 03, 2024 10:14 pm I know that Gary has VMs set up to test EPG123 using different operating systems, so that is one way to do it, but I understand this is not a small undertaking, so it's why I suggested to Kevin, that if he was open to it and wanted a potential larger audience to use his mods, it might be something to look in to.
I do have a Windows 7 Hyper-V VM I can use for that, but nothing beats testing on a real machine :mrgreen:
Space wrote: Sat Feb 03, 2024 10:14 pm For some people, just knowing that many others are enjoying their work is enough to motivate them, and this would be a way to increase the audience of people who would be able to utilize these nice mods. It is completely up to Kevin if he chooses to do so, so there is no pressure here (at least from me :D).
I'm not against it. Let's see if there's a demand.

stuartm

Posts: 742
Joined: Mon Nov 05, 2012 8:05 pm
Location: Longmont, CO

HTPC Specs: Show details

#35

Post by stuartm » Mon Feb 05, 2024 10:35 pm

"Yes, but I'm not asking for them"
Sorry Space didn't mean to misrepresent you. Probably should have said which may be why Space is suggesting looking into Win 7 interest. :)

Space

Posts: 2860
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#36

Post by Space » Tue Feb 06, 2024 2:16 am

Kevin Chalet wrote: Mon Jan 22, 2024 11:17 am Thanks for all these details! I started taking a look, but of course, it's like looking for a needle in a haystack: that part is absolutely massive (of course, it's not surprising as the scheduling stuff in WMC is very powerful and one of its best features!).
I'll set up a VM and try to recreate the scenario you describe. If you could isolate a specific program that causes and create two MXF files with just that program (one buggy and one with the fixed series info), that would also help a lot.

If you're interested in giving it a try too, you can download ILSpy from GitHub (https://github.com/icsharpcode/ILSpy/re ... 35-x64.zip) and load mcepg.dll from the ehome folder: it's very likely the root cause is somewhere in that assembly :mrgreen:
I'm not sure that the MXF file will help or not, since if you use EPG123 to Rebuild the DB and reload the same MXF file, the problem is no longer in the guide, which indicates to me that it may not be captured in the MXF file (or the backup files).

One show that it happens quite often with is on MTV, "Jersey Shore: Family Vacation" (don't judge :D), but I would think many MTV shows may have the issue since MTV tends to load a lot of "generic" episodes well in advance before they later provide updates that give each of those episodes specific episode information (ESI). So you end up with dozens of episodes being scheduled to record (because they are just generic episodes) but then later then the ESI is provided, they (mostly) are removed from the record list due to being repeats, etc.

What I usually see in this situation is that the NEW episode on Thursday night at 8pm is scheduled to record (and it has ESI), but also the second airing of the same episode (a repeat of the premier which also has ESI) is set to record at 10pm. Only the 8pm airing should be scheduled to record.

For instance right now the season premier (s07e01) is set to record at 8pm (Feb 8), as is the repeat of the premier episode at 10pm which also has the same ESI as the airing at 8pm, but if I look at next weeks episode, the 7/15 @ 8pm episode has ESI and is scheduled to record, but the 10pm episode only has generic info (and, of course, is also set to record).

I'm not sure if this is a clue to what may be happening, but maybe if only one of the repeating episodes is updated with ESI and the other airing remains with generic info, but is then later updated with ESI, (as opposed to both the 8pm and 10pm airings being updated from generic to ESI in the same update) it may cause this issue. I will keep an eye on it to see if next weeks 10pm airing is update with ESI and if it continues to be scheduled to record afterwards, even though it is already recording that episode at 8pm.

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#37

Post by Kevin Chalet » Sat Feb 10, 2024 2:54 am

New 2.1.0 release:

ehshell.dll patches:

Option to configure the home media shares via HKLM:

In 2019, I discovered an undocumented method to force remote paths to appear in WMC's "shared" tab and mentioned it here: https://forums.mydigitallife.net/thread ... st-1545224. With the removal of Homegroup in Windows 10 1803, this undocumented method became particularly useful for those who want to bring back the "shared" tab to life:
WMC.png
There's sadly a downside to that approach: the HomeMediaSharing hook must be configured via HKCU and has no effect if you do it via HKLM, which can makes configuring this registry key via PowerShell remoting a bit painful if, like me, you use a separate Windows user account just for WMC.

The 2.1.0 release patches HomeGroupProvider.PerformInitialQuery() to support resolving HomeMediaSharing from HKLM:

Code: Select all

using System;
using System.Collections.Generic;
using System.Globalization;
using Microsoft.MediaCenter.Debug;
using Microsoft.Win32;

namespace Microsoft.MediaCenter.Library.HomeGroup
{
    // Token: 0x02000584 RID: 1412
    public partial class HomeGroupProvider : Provider
    {
        // Token: 0x06002F73 RID: 12147 RVA: 0x00028C83 File Offset: 0x00026E83
        private void PerformInitialQuery()
        {
            this._statePolicy.LockState(delegate
            {
                if (this._statePolicy.State != RunningState.Started)
                {
                    return;
                }
                using var machineRegistryKey = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Media Center\\MiniMods");
                if (machineRegistryKey != null)
                {
                    ImportPaths(machineRegistryKey);
                }
                using var userRegistryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Media Center\\MediaFolders");
                if (userRegistryKey != null)
                {
                    ImportPaths(userRegistryKey);
                }
                string[] array3;
                if (HomeGroupInterop.EhGetHomeGroupComputers(out array3) == 0 && array3 != null)
                {
                    foreach (string text4 in array3)
                    {
                        if (string.Compare(Environment.MachineName, text4, StringComparison.OrdinalIgnoreCase) != 0)
                        {
                            this.AddComputer(text4);
                        }
                    }
                }

                void ImportPaths(RegistryKey key)
                {
                    string text = key.GetValue("HomeMediaSharing") as string;
                    if (text != null)
                    {
                        string[] array = text.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                        if (array != null)
                        {
                            foreach (string text2 in array)
                            {
                                if (HomeGroupProvider.IsValidHmsPath(text2))
                                {
                                    this.AddWatchedDirectory(text2);
                                }
                                else
                                {
                                    string text3 = string.Format(CultureInfo.InvariantCulture, "{0} is an invalid HMS path. AddWatchedDirectory skipped", new object[] { text2 });
                                    eDebug.DumpToLog(text3);
                                }
                            }
                        }
                    }
                }
            });
        }
    }
}
When using this new hook, the added paths automatically apply to all WMC users (instead of just the current user as the original one).
You can use the two hooks if you want to have global paths and per-user paths at the same time.
If necessary, multiple paths can also be specified by separating them with a semicolon (don't forget to escape the backslashes):

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\MiniMods]
"HomeMediaSharing"="\\\\MACHINE1\\Recorded TV;\\\\MACHINE2\\Recorded TV"
You do not have the required permissions to view the files attached to this post.

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#38

Post by Kevin Chalet » Sat Feb 10, 2024 4:16 pm

New 2.2.0 release:

This new version exclusively focuses on improving the installer:
  • An early check now prevents running the tool on < Windows 8.1/Windows Server 2012 R2.
  • An interactive prompt was added to ask for confirmation before starting the installation process.
  • The installer will now automatically stops the WMC services/processes before replacing the assemblies to ensure the overwritten files are not locked (thanks acer-5100 for the idea!)
  • Third-party tools/services like Recording Broker, Remote Potato and EPG123 are automatically stopped before starting the process.
  • The WMC services and the EH tray are automatically restarted at the end of the process.
You do not have the required permissions to view the files attached to this post.
Last edited by Kevin Chalet on Sat Feb 10, 2024 7:05 pm, edited 1 time in total.

User avatar
Kevin Chalet

Posts: 190
Joined: Mon Oct 08, 2018 12:00 pm
Location:

HTPC Specs: Show details

#39

Post by Kevin Chalet » Sat Feb 10, 2024 5:05 pm

New 2.2.1 release:

This new version fixes two issues in the installer:
  • The ehshell.exe process was not correctly terminated.
  • The ehRecvr service is now automatically disabled to ensure it doesn't auto-restart after being killed and re-enabled once the installation is complete.
You do not have the required permissions to view the files attached to this post.

Space

Posts: 2860
Joined: Sun Jun 02, 2013 9:44 pm
Location:

HTPC Specs: Show details

#40

Post by Space » Sat Feb 10, 2024 10:15 pm

Space wrote: Tue Feb 06, 2024 2:16 am...
I will keep an eye on it to see if next weeks 10pm airing is update with ESI and if it continues to be scheduled to record afterwards, even though it is already recording that episode at 8pm.
The 7/15 10pm airing has now been updated with ESI and it seems identical to the episode that is airing at 8pm but they are both scheduled to record, as predicted. So annoying...

Does no one else see this issue?

Post Reply