| |||||||
| Installation, configuration support Having trouble installing or configuring MediaPortal? |
![]() |
| | Thread Tools | Display Modes |
| | #21 (permalink) | |
| Retired Team Member Join Date: Sep 2004 Location: Wellington
Posts: 346
Thanks: 0
Thanked 2 Times in 1 Post
Country: | Quote:
![]() | |
| | |
| | #22 (permalink) | |
| Portal Member Join Date: Jan 2006 Location: Denver, CO USA
Posts: 354
Thanks: 0
Thanked 0 Times in 0 Posts
| Quote:
There is a simple way around this... well... sorta simple. You launch a program that waits for however long the network normally takes to connect and then it launches MP. Great if you are a programmer right? Actually, there is a simple scripting tool called AutoIt that lets you do something like this with just 2 lines of code, it's free and it can generate executables. I use this program at work to automate the launch, login and setup of programs used for remote video security. I have it lauching web pages, loading programs, moving windows, clicking on buttons, typing logins... all sorts of stuff. It's very slick and pretty easy to learn. Here's the website: http://www.autoitscript.com/autoit3/ I think the script you'd need would look something like this: ;------------------------------------ ;AutoIt 3 script to delay and then launch MediaPortal ;build into an executable and then place in the startup folder. ;------------------------------------ ;sleep for 2 minutes. (Fine tune for your startup. 1000 = 1 sec) Sleep(120000) ;launch MediaPortal. (Check the path and executable name) Run ( "C:\Program Files\TeamMediaPortal\MediaPortal\MP.exe", "" ) ;Done! ;------------------------------------ | |
| | |
| | #23 (permalink) | |
| Portal Member Join Date: Dec 2004 Location: North America
Posts: 265
Thanks: 1
Thanked 0 Times in 0 Posts
Country: | Quote:
Code: sleep 60000 rem "C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe"
__________________ -CodeMonkey P4 2.8gHz, 512MB memory, nVidia FX5200, 40GB HD, 200GB HD OS: Windows XP Home SP2 TVcard(s): Hauppauge PVR500MCE, Hauppauge PVR 250MCE(Installed in development machine) Remote: MCE 2005 (US Model) ________________ | |
| | |
| | #24 (permalink) | |
| Portal Member Join Date: Jan 2006 Location: Denver, CO USA
Posts: 354
Thanks: 0
Thanked 0 Times in 0 Posts
| Quote:
Corrected script: Code: ;------------------------------------ ;AutoIt 3 script to delay 1 minute and then launch MediaPortal ;build into an executable and then place a link to it in the startup folder. ;------------------------------------ Sleep(60000) Run ( "C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe", "" ) | |
| | |
| | #25 (permalink) | ||
| Portal Member Join Date: Jan 2006 Location: London, United Kingdom Age: 29
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Country: | Quote:
Hello, If I am right, this code you are giving would work if MP was set to run on windows startup. But has anyone an idea on how to make MP to get the focus after launching it by pressing the green button? I have had a look at the available functions in AutoIt, I could create a script that checks if MP is running (with ProcessList i could check if MP process is in the process list) and then give the focus back to MP (with WinActivate). To make it cleaner I could pause the script until MP has not been closed, or does not has the focus any more, or even close the script once MP has the focus... Well it's a nice program with many options. My problem is that mptray was working fine at the begining and it is not any more, has anyone experienced that? I spend the whole day at work scratching my head (yes, I am a developer as well) and when I get back home I like just enjoying a film from the confort of my sofa... I would not like to start coding something unless it is really necessaire... Has anyone had the same problem with mptray? If so, how did you fix it? Thanks. | ||
| | |
| | #26 (permalink) |
| Portal Member Join Date: Jan 2006 Location: London, United Kingdom Age: 29
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Country: | hello all! i could not stand any more MP randomly loosing the focus on startup so i decided to write a small script to force MP to get the focus back. i have seen a few posts on that issue, it looks that i am not the only one. some people fixed it by uninstalling divx6 or any other program that was stealing the focus (from the task bar or anywhere else). it is not my case, i have very few applications installed and non of them are responsible of this random behaviour, it does not even happen every time! and it also only happens on MP startup... i have solved this with the following script written with autoit http://www.autoitscript.com/autoit3/ Code: ;-----------
;this small script wait for a window to exist and then force it to get the focus
;-----------
;variable needed for the infinite loop
$i = 0
;start infinite loop, it will never finish...
;you can manually exit the script from the tray
Do
;this will make the script to wait for Media Portal window to be opened
;the script will wait here until Media Portal is started
WinWait("Media Portal - ")
;if we get here it's because the Media Portal is open
;this will activate (give focus) to Media Portal window
WinActivate("Media Portal - ", "")
;this will make the script to sleep until the window is not active
;the script will wake up again and carry on looping
WinWaitNotActive("Media Portal - ")
;this condition will never happen and will keep the script alive
;everything starts over again and from the beginning of the loop
Until $i = 1
;-----------
i run AutoFocusOnMP.exe on windows startup. mptray.exe is there as well listening to my mce remote for the green button to be pushed to launch MP. using mptray.exe you will then be able to open MP from the remote and with AutoFocusOnMP.exe you will make sure MP does not lose the focus. in case MP loses the focus, AutoFocusOnMP.exe will quickly give the focus back to MP. the setting Media Portal Always On Top is not needed any more but it won´t harm anyone either... as you can understand that feature doesn't work every time for me, hence this script! i can not test it when MP is on a secondary screen. i only have 1 monitor. it my work on a multi display setup as well... who knows! this script takes 3580K memory, 00% when waiting and only up to 02% when running (it runs for a few milliseconds only...) suggestions, comments welcome. it works for me, i hope it does for you as well! |
| | |
| | #27 (permalink) |
| Portal Designer | Very nice! One question though: You say that when MP looses focus it automatically gets the focus back? So does that mean that its impossible to have MP just run in the background and do some other work in MP? I think thats what it means. If so, could you make available another version that simply waits for MP to load, but then exits instead of sitting there and waiting for it to loose focus again? I think this should solve the issue with MP not getting focus initially, but still making a manual focus switch possible. Correct? Inker |
| | |
| | #28 (permalink) | |||
| Portal Member Join Date: Jan 2006 Location: London, United Kingdom Age: 29
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Country: | Quote:
Quote:
I did this script because I wanted to be able to start MP with my MCE remote (green button) and never loose the focus on MP. I hate walking to my PC when I am already sitting on the sofa just to click anywhere in the screen in order to set the focus on MP when runnig fullscreen... I first installed mptray (as cheezey told me to do) and then since I started experiencing problems with MP losing the focus I wrote this script. It allows me to run MP from the remote, close it, run it again, close it... And I never loose the focus on it! I do not have to move any more from the sofa!!! Quote:
I have a better idea. Let's make the script stay alive like the previous one but let's only allow it to give the focus back to MP once (5seconds after MP starts). The following script will wait until you open MP and after 5 seconds it will force MP to get the focus. The script will then wait until MP is shut down to carry on with its execution. If MP is reopened, the script will then start again from scratch. Doing this, MP is forced to get the focus on startup after 5 seconds and will allow you to manually set the focus onto something else... I think that is what you want... But if for any reason MP looses the focus again without any user interaction after those 5 seconds, MP will not get the focus back until you restart it or set manually the focus on it! Code: ;-----------
;this small script waits for MP to start and after 5 seconds it will force the focus onto it
;the focus can be manually set to something else after those 5 seconds
;-----------
;variable needed for the infinite loop
$i = 0
;start infinite loop, it will never finish...
;you can manually exit the script from the tray
Do
;this will make the script to wait for Media Portal window to be opened
;the script will wait here until Media Portal is started
WinWait("Media Portal - ")
;wait for 5 seconds
Sleep(5000)
;if we get here it's because the Media Portal window has been opened 5 seconds ago
;this will activate (give focus) to Media Portal window
WinActivate("Media Portal - ", "")
;this will make the script to sleep until Media Portal is closed
;when Media Portal is closed, the script will wake up and carry on looping
ProcessWaitClose("MediaPortal.exe")
;this condition will never happen and will keep the script alive
;everything starts over again and from the beginning of the loop
Until $i = 1
;-----------
I have the feeling that this would work work as well in a dual display setup, but I cannot test it. By the way, I am at work and I cannot test this just created ForceFocusOnMPAfter5Sec.exe with MP but have done my tests with other windows and it works fine. Load this on windows startup like AutoFocusOnMP.exe! Remember both scripts do similar things but in different ways, choose yours! Small and easy scripts that give me a lot of satisfaction... I like a lot MP and would like to contribute in any way I can... If this can be considered as a contribution I will be then be very pleased to help you all in anything I can. Suggestions, questions and comments welcome. See you soon! | |||
| | |
| | #29 (permalink) |
| Portal Designer | Wow cool, will try it out and report back. Thanks for modifying this version for me. And yes you were correct, sometimes I need to do some other things on my MP box such as start a download or even change some settings etc. Anyways, I will report back later. Inker |
| | |
| | #30 (permalink) |
| Portal Member Join Date: Jan 2006 Location: London, United Kingdom Age: 29
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Country: | How did it go Inker? Have anyone tryed those scripts? I am using the fist one I wrote, AutoFocusOnMP.exe. It works perfectly, holds just over 3500K in memory and makes my MP never loose the focus! |
| | |
![]() |
| Bookmarks |
| Tags |
| button, green, mce, remote |
| Thread Tools | |
| Display Modes | |
| |