Kodi Community Forum
[RELEASE] Launcher - application launcher plugin for Linux, Mac, Windows, and Xbox - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Add-ons Help and Support (/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] Launcher - application launcher plugin for Linux, Mac, Windows, and Xbox (/showthread.php?tid=35739)



- rausch101 - 2010-10-16 02:03

XmemphistoX Wrote:I don't know how I did it, but I would like to find out so I can do the same on another machine. I made my games menu auto load the launcher plugin.

There's an option in settings to go right into launcher. I'm pretty sure Hitcher put it there initially in his mod of Aeon like a year ago and phil added it to his.


nulldc problems - reienno - 2010-10-16 17:05

Sorry to keep buggin u guys with different questions, but I have a problem that I can't seem to figure out. I have nulldc and around 50 dreamcast games. I'm using nulldc because it has a much better compatability with my computer rather than demul-v looked and looked for a loader that will work for xbmc but can't find anything. Only for demul. I was wondering if anyone has figured this out or what? The only other thing I know to do is make individual batch files for each game but would have to add them to the launcher as standalone exe's. Any help would be greatly appreciated. Thanks


- XmemphistoX - 2010-10-17 04:02

rausch101 Wrote:There's an option in settings to go right into launcher. I'm pretty sure Hitcher put it there initially in his mod of Aeon like a year ago and phil added it to his.

Awesome, thanks for the info.


- filigran - 2010-10-18 15:20

Loving this plugin, but one thing bothers me: launchers.xml isn't sorted after scanning a folder. Possible to fix?

I also noticed that if you edit the file manually, and then add a game through the interface it borks up the file, leaving you with this:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<launchers>
    <launcher>
        <name>Super Nintendo</name>
        <application>/usr/bin/snes9x-gtk</application>
        <args></args>
        <rompath>/storage/roms/Super Nintendo/</rompath>
        <romext>smc</romext>
        <thumb></thumb>
        <fanart></fanart>
        <genre></genre>
        <release></release>
        <publisher></publisher>
        <launcherplot></launcherplot>
        <wait>true</wait>
        <roms>
            <rom>
                <name>Legend of zelda - a link to the past</name>
                <filename>/storage/roms/Super Nintendo/Legend of Zelda - A link to the past.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Zelda Link to the past.jpg</thumb>
                <fanart>/storage/roms/Super Nintendo/fanart/Zelda Link to the past.jpg</fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot></gameplot>
            </rom>
            <rom>
                <name>Asterix & obelix</name>
                <filename>/storage/roms/Super Nintendo/Asterix & Obelix.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Asterix and Obelix.jpg</thumb>
                <fanart></fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot></gameplot>
            </rom>
            <rom>
                <name>Tetris 2 added manually</name>
                <filename>/storage/roms/Super Nintendo/Tetris 2.smc</filename>
                <thumb></thumb>
Stops after <thumb></thumb> that is. XBMC says the script failed, and the log says this: http://pastebin.com/NfAnyZYh

I think this is the important part:
Code:
15:07:35 T:140336875837504 M:1329094656   DEBUG: ------ Window Deinit (DialogKeyboard.xml) ------
15:07:35 T:140336397915920 M:1329094656    INFO: -->Python script returned the following error<--
15:07:35 T:140336397915920 M:1329094656   ERROR: Error Type: exceptions.KeyError
15:07:35 T:140336397915920 M:1329094656   ERROR: Error Contents: fanart
15:07:35 T:140336875837504 M:1329094656   DEBUG: ------ Window Init (DialogKaiToast.xml) ------
15:07:35 T:140336875837504 M:1329094656   DEBUG: Alloc resources: 0.00ms (0.00 ms skin load)
15:07:35 T:140336397915920 M:1329094656   ERROR: Traceback (most recent call last):
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/default.py", line 20, in ?
                                                plugin.Main()
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/resources/lib/launcher_plugin.py", line 150, in __init__
                                                self._add_new_rom(launcher)
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/resources/lib/launcher_plugin.py", line 759, in _add_new_rom
                                                self._save_launchers()
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/resources/lib/launcher_plugin.py", line 343, in _save_launchers
                                                usock.write("\t\t\t\t<fanart>"+romdata["fanart"]+"</fanart>\n")
                                            KeyError: fanart
15:07:35 T:140336397915920 M:1329094656    INFO: -->End of Python script error report<--
Which would make sense seeing as it stops after <thumb></thumb>.

This is probably (well, it is) because I'm using Angelscry's edited version, to add fanart/thumb support. I suppose this is going to be added to the official version at some point, so this could be good to be aware of (although you probably know there's no fanart key. Wink).

Easy fix though: add games manually via launchers.xml

Oh yeah, one more thing: is is possible to add a check to see if XBMC is windowed/full screened? If it is FS and you launch a game, XBMC is windowed and the game is played FS, upon exit XBMC is FS again. However, if XBMC is already windowed, it is fullscreened and the game is windowed (sometimes it works though), and then XBMC is windowed again upon exit. No need to do the "hit backslash key"-action if already windowed. Smile


- Angelscry - 2010-10-18 22:19

filigran, do you use the last version of my patch : http://pastebin.com/F53888EC ?


open casting call - zosky - 2010-10-18 23:38

the-launcher-crew (Zerqent, Wipmonkey & me) is looking for peeps to join our ranks. we have a growing wish-list of enhancements and are in need of talented python'ers who would like to get involved

PM me for details

( PS: wipMonkey is offering punch and pie Wink )


- tinybutstrong - 2010-10-19 22:00

Can someone confirm command line parameters is not working? I tested with Warcraft 3 game to open in window mode, but fails. My config:

<application>x:\Warcraft III\war3.exe</application>
<args>-window</args>

Game open in full screen, like no parameter.


- zosky - 2010-10-19 22:41

tinybutstrong Wrote:<application>x:\Warcraft III\war3.exe</application>

use x:\Warcraft~1\war3.exe or make a bat file
launcher doesn't like <spaces> in the path, exe or rom
(this has been mentioned a few times on the thread)


- filigran - 2010-10-20 00:42

Angelscry Wrote:filigran, do you use the last version of my patch : http://pastebin.com/F53888EC ?

I believe so. Can't check at the moment, but IIRC these lines:
Code:
listitem.setProperty("fanart_image", romfanart)
listitem.setInfo( "video", { "Title": name, "Plot" : romplot , "Studio" : romstudio , "Genre" : romgenre , "Premiered" : romrelease } )

or these:
Code:
listitem.setProperty("fanart_image", fanart)
listitem.setInfo( "video", { "Title": name, "Plot" : plot , "Studio" : studio , "Genre" : genre , "Premiered" : release } )

... were changed, right? Only two lines of code changed. If so, yes, I'm using the latest version.

I'll diff them when I get a chance, but I believe I am using the latest version.


- tinybutstrong - 2010-10-20 12:20

zosky Wrote:use x:\Warcraft~1\war3.exe or make a bat file
launcher doesn't like <spaces> in the path, exe or rom
(this has been mentioned a few times on the thread)

The problem still..

x:\Warcra~1\war3.exe

The args are ignored. I hope someone can test any program with parameter to confirm this problem.

For now I will appeal to batch scripts.

edit:

tried, with notepad and works fine:

<application>notepad</application>
<args>c:\test.vbs</args>

No idea why it failed in war 3 game.


- Angelscry - 2010-10-20 13:12

filigran Wrote:... were changed, right? Only two lines of code changed. If so, yes, I'm using the latest version.

I'll diff them when I get a chance, but I believe I am using the latest version.
Yes with is the last modification I have done on my patch. I have also try on my own to reproduce your error using the information you post here but I was not able to reproduce it.

I have encountered this error with the first version of my patch, and I have fixed it (error when thumb or fanart tags are empty).

When you manually add a rom to the launcher.xml file, do you add I with all the fields like this ?
Code:
<rom>
    <name>Tetris 2 added manually</name>
    <filename>/storage/roms/Super Nintendo/Tetris 2.smc</filename>
    <thumb></thumb>
    <fanart></fanart>
    <genre></genre>
    <release></release>
    <publisher></publisher>
    <gameplot></gameplot>
</rom>

or just like this ?
Code:
<rom>
    <name>Tetris 2 added manually</name>
    <filename>/storage/roms/Super Nintendo/Tetris 2.smc</filename>
</rom>

Also, could someone tell me if he encounter the same problem than filigran?


- filigran - 2010-10-20 14:55

Angelscry Wrote:Yes with is the last modification I have done on my patch. I have also try on my own to reproduce your error using the information you post here but I was not able to reproduce it.

I have encountered this error with the first version of my patch, and I have fixed it (error when thumb or fanart tags are empty).

When you manually add a rom to the launcher.xml file, do you add I with all the fields like this ?
Code:
<rom>
    <name>Tetris 2 added manually</name>
    <filename>/storage/roms/Super Nintendo/Tetris 2.smc</filename>
    <thumb></thumb>
    <fanart></fanart>
    <genre></genre>
    <release></release>
    <publisher></publisher>
    <gameplot></gameplot>
</rom>

or just like this ?
Code:
<rom>
    <name>Tetris 2 added manually</name>
    <filename>/storage/roms/Super Nintendo/Tetris 2.smc</filename>
</rom>

Also, could someone tell me if he encounter the same problem than filigran?

I add it with all the fields.
I did however use xsl to sort my file, since it wasn't sorted automatically, and it closed the tags like so:
Code:
<rom>
                <name>Mega man x 3</name>
                <filename>/storage/roms/Super Nintendo/Mega Man X 3.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Mega Man X3.jpg</thumb>
                <fanart/>
                <genre/>
                <release/>
                <publisher/>
                <gameplot/>
            </rom>
Will try to make them "incorrectly closed" again, and give it a shot.

Edit: didn't work. Sad

This is my launchers.xml file before the manual add:
http://pastebin.com/XXi2zzKu

And this is it after:
http://pastebin.com/hgguf7UK

And the log has this, like before:
Code:
15:00:06 T:139842814961728 M:1325019136   DEBUG: ------ Window Deinit (DialogKeyboard.xml) ------
15:00:06 T:139842814961728 M:1325019136   DEBUG: ------ Window Init (DialogKaiToast.xml) ------
15:00:06 T:139842814961728 M:1325019136   DEBUG: Alloc resources: 0.00ms (0.00 ms skin load)
15:00:06 T:139842367923984 M:1325019136    INFO: -->Python script returned the following error<--
15:00:06 T:139842367923984 M:1325019136   ERROR: Error Type: exceptions.KeyError
15:00:06 T:139842367923984 M:1325019136   ERROR: Error Contents: fanart
15:00:06 T:139842367923984 M:1325019136   ERROR: Traceback (most recent call last):
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/default.py", line 20, in ?
                                                plugin.Main()
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/resources/lib/launcher_plugin.py", line 150, in __init__
                                                self._add_new_rom(launcher)
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/resources/lib/launcher_plugin.py", line 759, in _add_new_rom
                                                self._save_launchers()
                                              File "/home/htpc/.xbmc/addons/plugin.program.launcher/resources/lib/launcher_plugin.py", line 343, in _save_launchers
                                                usock.write("\t\t\t\t<fanart>"+romdata["fanart"]+"</fanart>\n")
                                            KeyError: fanart
15:00:06 T:139842367923984 M:1325019136    INFO: -->End of Python script error report<--
15:00:06 T:139842367923984 M:1325019136   DEBUG: xbp_dlopen loading python lib /usr/lib/xbmc/system/python/python24.zip/collections.so. flags: 2
15:00:06 T:139842367923984 M:1325019136   DEBUG: Loading: /home/htpc/.xbmc/temp/collections.so
15:00:06 T:139842367923984 M:1325019136   DEBUG: RegisterExtensionLib, adding collections.so (0x7f2f983333a0)
15:00:06 T:139842367923984 M:1325019136   DEBUG: xbp_dlsym - load symbol initcollections
15:00:06 T:139842367923984 M:1325019136    INFO: Python script stopped

I tried to diff with your latest patch, and they are indeed identical. Will try to reinstall the plugin and see if that helps.

Edit: same thing. I'm out of ideas. Sad


- Angelscry - 2010-10-21 02:58

Ok Filigran, with your files and additionnal information, I was able to reproduce your bug and surely fixed it. Try this new launcher_plugin.py file and tell me if it solve your problem : http://pastebin.com/LcY5Ur1M


- StasMan - 2010-10-21 08:31

zosky Wrote:use x:\Warcraft~1\war3.exe or make a bat file
launcher doesn't like <spaces> in the path, exe or rom
(this has been mentioned a few times on the thread)

But understands inverted commas, in <application> path and don't understande in <thumb>...
Like this <application>"x:\Warcraft III\war3.exe"</application>, it work for me Rolleyes
My english is bad Laugh


- filigran - 2010-10-21 12:36

Angelscry Wrote:Ok Filigran, with your files and additionnal information, I was able to reproduce your bug and surely fixed it. Try this new launcher_plugin.py file and tell me if it solve your problem : http://pastebin.com/LcY5Ur1M

Yeah, problem solved! Easy fix, too, I see. Smile

One thing still bothers me though, the sorting. I had everything in my launchers.xml file sorted alphabetically, like the file you saw in my previous post. I now added "Actraiser added manually through XBMC", and it borked up my sorting again. I now get this sorting:
Code:
            <rom>
                <name>Clayfighter 2 - Judgment Clay</name>
                <filename>/storage/roms/Super Nintendo/Clayfighter 2 - Judgment Clay.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Clayfighter 2.jpg</thumb>
                <fanart>/storage/roms/Super Nintendo/fanart/Clayfighter 2.jpg</fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot>A meteor made entirely out of clay crash-lands on the grounds of a humble American circus. The goo from the interstellar object contaminates all of the circus' employees, transforming them into bizarre caricatures of their former selves, with new superpowers.</gameplot>
            </rom>
            <rom>
                <name>Lejonkungen</name>
                <filename>/storage/roms/Super Nintendo/Lejonkungen.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Lion King.jpg</thumb>
                <fanart>/storage/roms/Super Nintendo/fanart/Lion King.png</fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot>The Lion King is a video game based on Disney's popular animated film. The game is a side-scrolling platform game, with the controlled character having to leap, climb, run and descend from platform to platform.</gameplot>
            </rom>
            <rom>
                <name>Actraiser added through XBMC</name>
                <filename>/storage/roms/Super Nintendo/Actraiser.smc</filename>
                <thumb></thumb>
                <fanart></fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot></gameplot>
            </rom>
            <rom>
                <name>Lost vikings</name>
                <filename>/storage/roms/Super Nintendo/Lost Vikings.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Lost Vikings.jpg</thumb>
                <fanart>/storage/roms/Super Nintendo/fanart/Lost Vikings.jpg</fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot>In the game, the three Vikings get kidnapped by Tomator, emperor of the alien Croutonian empire, for an inter-galactic zoo and become lost in various periods of time. The purpose of the game is to control the three characters (who all have separate abilities) in order to solve puzzles to escape and get back home.</gameplot>
            </rom>
            <rom>
                <name>Secret of mana</name>
                <filename>/storage/roms/Super Nintendo/Secret of Mana.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Secret of Mana.jpg</thumb>
                <fanart></fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot></gameplot>
            </rom>
            <rom>
                <name>Mega man x</name>
                <filename>/storage/roms/Super Nintendo/Mega Man X.smc</filename>
                <thumb>/storage/roms/Super Nintendo/covers/Mega Man X.jpg</thumb>
                <fanart></fanart>
                <genre></genre>
                <release></release>
                <publisher></publisher>
                <gameplot></gameplot>
            </rom>
So the starting letters ar eC L A L S M. No ABC there. Smile I want them to be sorted A C L L M S, so that the file is easily browsable. Is that hard to do? Isn't there a simple theobject.sort(); in python? I seem to recall that from the last time I tried to learn the language. Smile And I see you using sorted() at some points in the file. Surely there's a way to sort the end result, before shunting it into the file? I'll see if I can hack something up. Smile

Edit: Ah, dictionaries can't be sorted that easy. Dang. Sad