Solved Open EXE file in KODI
#1
Hi

I have created a script, which is compiled to an EXE file.
I want to add a submenu button, which launches this script.

I have a working setup, where I have added the EXE in advanced launcher, added it as a favorite, and then had the submenu open that favorite.
The problem is that I use Advanced Launcher for games, so now I have an unwanted file together with the list of games.
Does anyone have a solution?

Is there an easier way to do this? Can I have 2 instances of Advanced launcher running, independent of each other?

Thanks

David
Reply
#2
I doubt it but anything is possible if you have the means to add a little code here and there i guess
Reply
#3
Couldn't you just write a python Kodi script that launches the exe with something like
import os
os.system('MyExe')

then just use RunScript as your submenu button onclick action.

scott s
.
Reply
#4
I would move this question to whatever Skin you use support forum as im sure they could point you in the correct direction, the only python i could hope to control would bite me so sorry i've reached my help limit Smile But your idea seems sound, i have played with python in my unix/linux days but not to any extreme extent.
Reply
#5
I think you can a map a button in the skin in the form:

<onclick>XBMC.System.Exec(C:\some\path\to\an.exe)</onclick>

You can also use turn your script into a bat file and use this.
Reply
#6
(2016-02-16, 22:58)scott967 Wrote: Couldn't you just write a python Kodi script that launches the exe with something like
import os
os.system('MyExe')

then just use RunScript as your submenu button onclick action.

scott s
.


Hi scott

Great suggestion.
I managed to create a simple python script, to run my EXE file:

import subprocess
import xbmc
child = subprocess.call(["C:\test\file.exe", "-k"])


Unfortunately my skin doesn't have the opportunity to run a script from a menu/submenu (Aeon MQ 6)
But I can run the python file from the file manager, and that works fine. So I added the python file to favorites, and configured the submenu to start that favorite.
That doesn't work either. Apparently files from the file manager can't be executed as favorites.

Any ideas?
Reply
#7
Okay I managed to solve it by creating my own addon, based on my simple python script.

I used the "Hello World" add on example, and modified it to use my own python script.
http://kodi.wiki/view/HOW-TO:HelloWorld_addon

It's a little bit complicated, considering I "just" want to open an exe file, but it works Smile

Thanks to everyone for your inputs!

- David
Reply
#8
That's the best way to do it. You could hack MQ6 to just run your .py file, though Kodi will complain in the logs it seems to work OK. Bundling it into an addon with an extension point is the approved method.

scott s.
.
Reply
#9
I'd be interested in a copy of the script if you get it going seems like a handy addon if you dont mind.

Ta

Dek
Reply
#10
Hi Derek

Yeah sure Smile
You can download a zip here with an example: https://www.dropbox.com/s/qnxn400jbxiz87...r.zip?dl=1

1. Unzip it
2. Open addon.py with notepad and change the path to point at your target file. (I have included a "TestFile.exe" which just opens a pop up message. This can be used for testing if you'd like)
3. Open addon.xml - Here you can change addon id, name, description etc. if you want.
4. Zip the content of the folder, and add it as an addon from zip file in Kodi. It should now be available in program add ons :-)

I have noticed that if you make changes in the add on, and uninstall it, then you may have to restart Kodi before you install it from zip again.

Let me know if you need help.

- David
Reply
#11
Thanks alot always interested in other peoples creations and this one sees v.useful thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
Open EXE file in KODI0