Import new tvguide.xml file from within MediaPortal (1 Viewer)

bombonator

MP Donator
  • Premium Supporter
  • September 23, 2004
    43
    0
    Sydney, Australia
    EDIT --turned out not fun at all until I tried on another computer and the autorun did work, dunno why it worked on 1 PC but not the other - YMMV too.

    The following files need to be in the root of your USB Drive.

    Simplest form of Autorun.inf for USB Drive:

    Code:
    [autorun]
    action=EPGUpdaterUSB
    shellexecute=EPGUpdaterUSB.cmd

    Basic batch file (EPGUpdaterUSB.cmd) to do the copying (important stuff is between the first ==== lines, you'll need to change at least 1 path):

    Code:
    @echo off
    setlocal
    echo.
    echo Autorun USB Drive TVGuide Updater!
    echo.
    
    rem ==========================================================
    rem Set parameters to control execution.
    rem Possible Values: 1=On. 0, not set, or any other value=Off.
    SET ENABLECOPYTOUSB=1
    SET ENABLECOPYFROMUSB=1
    rem Set paths to copy from/to.
    SET SOURCETVGUIDEPATH=C:\PathWhereYourGuideDataIsDownloaded
    SET DESTINATIONTVGUIDEPATH=C:\Program Files\Team MediaPortal\MediaPortal\xmltv
    rem ==========================================================
    
    IF /I NOT "%ENABLECOPYTOUSB%"=="1" GOTO CopyToUSBEnd
    echo.
    rem ==========================================================
    IF EXIST "%SOURCETVGUIDEPATH%\tvguide.xml" copy "%SOURCETVGUIDEPATH%\tvguide.xml" .
    rem ==========================================================
    echo.
    echo Copy downloaded TVGuide to USB Drive Done!
    :CopyToUSBEnd
    
    IF /I NOT "%ENABLECOPYFROMUSB%"=="1" GOTO CopyFromUSBEnd
    echo.
    rem ==========================================================
    IF EXIST "%DESTINATIONTVGUIDEPATH%\*.*" copy tvguide.xml "%DESTINATIONTVGUIDEPATH%"
    rem ==========================================================
    echo.
    echo Copy TVGuide from USB Drive to MediaPortal Done!
    :CopyFromUSBEnd
    
    endlocal

    It can copy to and from the USB Drive.

    NOTE: The "IF EXIST ..." commands between ==== lines should all be on single line, not on 2 lines as it can appear here. The SET= lines can also appear like that, the paths cannot wrap to the next line in the batch file.
     

    bombonator

    MP Donator
  • Premium Supporter
  • September 23, 2004
    43
    0
    Sydney, Australia
    now that i know that it can work - the way it is above does still pop a box asking the user to confirm the autorun so may not appear in the foreground if MP is running (using Exclusive Fullscreen Directx Mode and/or MediaPortal always on top may stop it from appearing).

    maybe i can avoid the popup, but maybe not as it may be a security measure by windows to stop a disk autorunning a virus from the disk without the user knowing about it...
     

    dale_mac

    Portal Pro
    November 6, 2005
    51
    0
    Brisbane, Australia
    Home Country
    Australia Australia
    You're right, the popup comes up behind Media Portal and waits for a response from me.
    I think I'll use the MyPrograms batch file setup. It works fine, even if it a bit convoluted navigating to the shortcut.
    Thanks for all the effort.
     

    Users who are viewing this thread

    Top Bottom