Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support


Go Back   Australian Media Center Community > The Electronic Program Guide (EPG) > Vista EPG Support

Community Information

Reply
 
Thread Tools
Old 23rd October 2007, 07:54 PM   #1 (permalink)
Newbie
No Avatar
Status mmutti is Offline:
ActivityPosts: 2
Reputation & Thanks Support Rating:
mmutti
Points Earned: 10

mmutti has been Thanked 0 times in 0 posts
How to trigger the guide download

Hi guys,
I would like to know if someone has found a way to trigger the guide download automatically in Vista.

In MCE 2005 I was using Microsoft.Ehome.Epg.Helper.EhepgdatHelper class to trigger it.
But in Vista Microsoft kindly decided to do not give anymore access to this class.

Any idea ?

Cheers
  Reply With Quote
Old 28th October 2007, 09:33 AM   #2 (permalink)
MC Journeyman
 
mikehayton's Avatar
Status mikehayton is Offline:
Location Media Center Team, Microsoft
ActivityPosts: 223
Reputation & Thanks Support Rating:
mikehayton mikehayton mikehayton mikehayton mikehayton
Points Earned: 411

mikehayton has been Thanked 149 times in 49 posts
Re: How to trigger the guide download

Please note: Calling these APIs is totally unsupported and such APIs are subject to change from version to version.

However, with Type.InvokeMember() you can instantiate any object & call private methods - so you might want to give that a go.

Also I think there's some tools out there that change the download time (by editing a reg key - I think its called nextDownloadTime from memory). Changing the download time to (now+1min), is probably another way of programatically triggering a download. Note: in Vista, the mcupdate process will clobber your updated download time when it runs. But it would be unlikely that mcupdate clobbers the download time between now & (now+1min).

Cheers

Mike
__________________
This posting is provided "AS IS" with no warranties, and confers no rights.
  Reply With Quote
Old 7th November 2007, 06:31 AM   #3 (permalink)
Newbie
No Avatar
Status mmutti is Offline:
ActivityPosts: 2
Reputation & Thanks Support Rating:
mmutti
Points Earned: 10

mmutti has been Thanked 0 times in 0 posts
Re: How to trigger the guide download

Hi Mike,
thank you for your answer.
I tried the Type.InvokeMember technique as you suggested… it take me a while to made it work… and the technique works.
But the downloadEPG method raise an exception:

Eccezione non gestita: System.Reflection.TargetInvocationException: Eccezione generata dalla destinazione di una chiamata. ---> System.Runtime.InteropServices.COMException (0x80040202): Eccezione da HRESULT: 0x80040202 in System.Runtime.InteropServices.ComTypes.IConnectio nPoint.Advise(Object pUn
kSink, Int32& pdwCookie) in ehiProxy.IEhepgdatEvents_EventProvider.add_Ehepgda tConnectionStateUpdate(I
EhepgdatEvents_EhepgdatConnectionStateUpdateEventH andler A_1) in ehiProxy.EhEPGdatEventsMediatorClass.add_EhepgdatC onnectionStateUpdate(IEh
epgdatEvents_EhepgdatConnectionStateUpdateEventHan dler A_1) in Microsoft.Ehome.Epg.Helper.EhepgdatHelper.Establis hConnectionHelper.Connec
tEvent() in Microsoft.Ehome.Epg.Helper.EhepgdatHelper.AsyncOpe rationController.DoOpera
tion(Int32 maxWaitInMs) in Microsoft.Ehome.Epg.Helper.EhepgdatHelper.Establis hConnection()
--- Fine dell'analisi dello stack dell'eccezione interna ---
in System.RuntimeMethodHandle._InvokeMethodFast(Objec t target, Object[] argum
ents, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle
typeOwner)
in System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argume
nts, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwn
er)
in System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisib
ilityChecks)
in System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
in System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Bi
nder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers
, CultureInfo culture, String[] namedParams)
in System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder bind
er, Object target, Object[] args)
in EPGLoader.MainClass.Main(String[] args)

Have you any suggestion about what is causing this problem?

Regards
mmutti

Last edited by mmutti; 7th November 2007 at 06:35 AM. Reason: Typos
  Reply With Quote
Old 8th November 2007, 03:22 PM   #4 (permalink)
MC Journeyman
 
mikehayton's Avatar
Status mikehayton is Offline:
Location Media Center Team, Microsoft
ActivityPosts: 223
Reputation & Thanks Support Rating:
mikehayton mikehayton mikehayton mikehayton mikehayton
Points Earned: 411

mikehayton has been Thanked 149 times in 49 posts
Re: How to trigger the guide download

Sorry, I dont. All I can suggest is changing the download time.

Search for "How to set the time the EPG (Program Guide) downloads" for a post on how to change the download time.
Or you could try out one of the freeware apps that does this (e.g http://www.avsoft.nl/Tools/guidedltime/)

Cheers

Mike
__________________
This posting is provided "AS IS" with no warranties, and confers no rights.
  Reply With Quote
Old 13th January 2008, 06:37 PM   #5 (permalink)
MCE Apprentice
 
justlynden's Avatar
Status justlynden is Offline:
Location Adelaide
ActivityPosts: 24
Reputation & Thanks Support Rating:
justlynden
Points Earned: 63

justlynden has been Thanked 6 times in 6 posts
justlynden's
Media Center
Re: How to trigger the guide download

I haven't found as nice a way to do it in Vista as we could in MCE 2005 using Microsoft.Ehome.Epg.Helper.EhepgdatHelper.Download Epg() but there's a clunkier way to force an immediate Guide update in Vista by writing code to do the following:

1. Delete the value "dlLastTime" in Registry Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Cur rentVersion\Media Center\Service\EPG".

2. Run the MCUPDATE task (%SystemRoot%\eHome\mcupdate.exe)
  Reply With Quote
The following Member(s) said "Thank You!" to justlynden for this information:
Old 2nd August 2008, 09:02 AM   #6 (permalink)
MCE Apprentice
No Avatar
Status avatar1976 is Offline:
ActivityPosts: 37
Reputation & Thanks Support Rating:
avatar1976
Points Earned: 10

avatar1976 has been Thanked 0 times in 0 posts
Re: How to trigger the guide download

Quote:
Originally Posted by justlynden View Post
I haven't found as nice a way to do it in Vista as we could in MCE 2005 using Microsoft.Ehome.Epg.Helper.EhepgdatHelper.Download Epg() but there's a clunkier way to force an immediate Guide update in Vista by writing code to do the following:

1. Delete the value "dlLastTime" in Registry Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Cur rentVersion\Media Center\Service\EPG".

2. Run the MCUPDATE task (%SystemRoot%\eHome\mcupdate.exe)
Hmm that didn't seem to work for me, do you know if the Media Center has to be expecting guide data to come in for this to work? I tried your fix directly after doing a "Get Latest Guide Listings" I also noticed MCUpdate-Next there with what looks like some sort of binary date could this be part of the puzzle?

Well tried deleting that reg entry also and nothing happened then either, the values don't get recreated until I manually select "Get Latest Guide Listings" from within Media Center.

Last edited by avatar1976; 2nd August 2008 at 09:10 AM. Reason: Further information.
  Reply With Quote
Old 2nd August 2008, 03:50 PM   #7 (permalink)
MC Specialist
 
Bryce's Avatar
Status Bryce is Offline:
Location Sydney
ActivityPosts: 341
Reputation & Thanks Support Rating:
Bryce Bryce Bryce
Points Earned: 233

Bryce has been Thanked 69 times in 53 posts
Bryce's
Media Center
Re: How to trigger the guide download

Quote:
Originally Posted by avatar1976 View Post
Hmm that didn't seem to work for me,
Hi avatar1976 / mmutti

It will work as long as you use elevated rights. Right click Run as administrator
Or make it permanent by going into the properties box and select the advanced tab. (Permanent is best option)
Make sure your Command Prompt dos box looks like this.


Delete "dlLastTime"

Then copy and past this command into the dos box.
%SystemRoot%\eHome\mcupdate.exe
Then hit enter.

Quote:
Originally Posted by avatar1976 View Post
I also noticed MCUpdate-Next there with what looks like some sort of binary date could this be part of the puzzle?
This link goes into explanation about the binary you’re looking at in the dlLastTime entry.
Decoding the schedule By Cowboy At The Green Button.


Bryce
  Reply With Quote
The following Member(s) said "Thank You!" to Bryce for this information:
Old 2nd August 2008, 08:20 PM   #8 (permalink)
MCE Apprentice
 
justlynden's Avatar
Status justlynden is Offline:
Location Adelaide
ActivityPosts: 24
Reputation & Thanks Support Rating:
justlynden
Points Earned: 63

justlynden has been Thanked 6 times in 6 posts
justlynden's
Media Center
Re: How to trigger the guide download

Hi avatar1976,

It has been a long time since I looked at the ins and outs of this as it has been running twice a day flawlessly for me for many months.

What Bryce says is probably correct, as my scheduled guide download/update does run under an account with administrative priviledges.

From memory, it also doesn't work if you set your guide download options in VMCE to "Run Manually" rather than "Download when Connected", and I have a vague memory that perhaps it doesn't update the guide again if you've only just updated it manually as you mentioned.

Personally, I have the mcupdate scheduled task disabled, have the guide download options in VMCE set to "Download when Connected", have a morning and evening scheduled task which runs my guide update then deletes the registry key and launches mcupdate.exe. The scheduled task runs under the same user account that the media center runs as and this is an account with admin priviledges. I then use file system permissions to restrict access to files and folders for that account so that whoever is using the Media Center can't delete or modify any files I don't want them to.
  Reply With Quote
The following Member(s) said "Thank You!" to justlynden for this information:
Old 2nd August 2008, 09:31 PM   #9 (permalink)
MCE Apprentice
No Avatar
Status avatar1976 is Offline:
ActivityPosts: 37
Reputation & Thanks Support Rating:
avatar1976
Points Earned: 10

avatar1976 has been Thanked 0 times in 0 posts
Re: How to trigger the guide download

Quote:
Originally Posted by justlynden View Post
Hi avatar1976,
Personally, I have the mcupdate scheduled task disabled, have the guide download options in VMCE set to "Download when Connected", have a morning and evening scheduled task which runs my guide update then deletes the registry key and launches mcupdate.exe. The scheduled task runs under the same user account that the media center runs as and this is an account with admin priviledges. I then use file system permissions to restrict access to files and folders for that account so that whoever is using the Media Center can't delete or modify any files I don't want them to.
So could I potentially put this on the back of my BladeRunnerPro 3.0 task? As a postprocess task for example? I have my scheduled task for bladerunner set to run with highest privilages. How did you go about deleting a reg value in a script though? Did you just merge a reg hack with that entry blank or did you figure out a way to delete the actual value out of the key?
  Reply With Quote
Old 2nd August 2008, 09:32 PM   #10 (permalink)
MCE Apprentice
No Avatar
Status avatar1976 is Offline:
ActivityPosts: 37
Reputation & Thanks Support Rating:
avatar1976
Points Earned: 10

avatar1976 has been Thanked 0 times in 0 posts
Re: How to trigger the guide download

Yeah I was definitely running as administrator, but as justlynden said it was probably that my guide was pretty up to date anyway.
  Reply With Quote
Old 2nd August 2008, 10:28 PM   #11 (permalink)
MCE Apprentice
 
justlynden's Avatar
Status justlynden is Offline:
Location Adelaide
ActivityPosts: 24
Reputation & Thanks Support Rating:
justlynden
Points Earned: 63

justlynden has been Thanked 6 times in 6 posts
justlynden's
Media Center
Re: How to trigger the guide download

I don't use BladeRunner or any third party software for my EPG. I wrote my own and its this code that writes the registry and runs mceupdate after updating the guide.

I can give you an executable that I wrote for when I want to manually force a guide update if you want. This could be used as a post-process task with Bladerunner.
  Reply With Quote
The following Member(s) said "Thank You!" to justlynden for this information:
Old 3rd August 2008, 12:11 AM   #12 (permalink)
MC Specialist
 
Bryce's Avatar
Status Bryce is Offline:
Location Sydney
ActivityPosts: 341
Reputation & Thanks Support Rating:
Bryce Bryce Bryce
Points Earned: 233

Bryce has been Thanked 69 times in 53 posts
Bryce's
Media Center
Re: How to trigger the guide download

Quote:
Originally Posted by avatar1976 View Post
Did you figure out a way to delete the actual value out of the key?
The following line deletes dlLastTime reg entry.
Code:
REG.exe DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Media Center\Service\EPG" /v dllasttime /f
I use this code within a batch file when using epgStreams wmcGuideServiceProxy.
It deletes the reg value first. Then triggers a guide download.
The reg value returns after the download has finished.

Trigger guide.bat
Code:
cls
cd\
c:
REG.exe DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Media Center\Service\EPG" /v dllasttime /f
%SystemRoot%\eHome\mcupdate.exe
For %%c in (Cls Exit) do %%c
Bryce
  Reply With Quote
The following Member(s) said "Thank You!" to Bryce for this information:
Old 3rd August 2008, 11:31 PM   #13 (permalink)
MCE Apprentice
No Avatar
Status avatar1976 is Offline:
ActivityPosts: 37
Reputation & Thanks Support Rating:
avatar1976
Points Earned: 10

avatar1976 has been Thanked 0 times in 0 posts
Re: How to trigger the guide download

Thanks for the replies there guys, Justlynden, I'd be happy to try out yout code and Bryce thanks for the reply there that will work great also. Always good to have a couple of ways of doing things incase one stops working.
Confirmed it definitely works I just had to not download for a few hours, it then quite happily downloaded the latest guide information out BladeRunnerPro 3.0 after deleting the key and calling the mcupdate command.
  Reply With Quote
Reply

Bookmarks

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Working Vista EPG Setup that Works Neilwa Vista EPG Support 57 25th May 2007 07:00 PM
Anti-virus and Anti-Spyware Guide For Beginners by Bella bella Media Center Articles & Guides