Kodi Community Forum
[CLOSED] Advanced Launcher - Applications Launcher Addon for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Game Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=291)
+---- Thread: [CLOSED] Advanced Launcher - Applications Launcher Addon for XBMC (/showthread.php?tid=85724)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453


- Angelscry - 2012-02-15

tria Wrote:You are correct. The problem was due to my text editor. I forgot to set it to auto check for update on the log file, so whenever an error happened I never saw it in the log (no auto update). Once I sorted that, I managed to fix the issues one by one and now have it running with subproccess. However, I had to remove one parameter which is "startupinfo". If I leave it as a parameter I get this error

Code:
18:31:24 T:5008    INFO: -->Python script returned the following error<--
18:31:24 T:5008   ERROR: Error Type: <type 'exceptions.AttributeError'>
18:31:24 T:5008   ERROR: Error Contents: 'str' object has no attribute 'dwFlags'
18:31:24 T:5008   ERROR: Traceback (most recent call last):
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\addon.py", line 20, in <module>
                                                plugin.Main()
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 179, in __init__
                                                self._run_rom(launcher, rom)
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 1316, in _run_rom
                                                proc = subprocess.Popen(r'%s %s' % (launcher["application"], arguments), shell=False, stdout=subprocess.PIPE, cwd=apppath, startupinfo=info)
                                              File "C:\Program Files (x86)\XBMC\system\python\Lib\subprocess.py", line 623, in __init__
                                                errread, errwrite)
                                              File "C:\Program Files (x86)\XBMC\system\python\Lib\subprocess.py", line 798, in _execute_child
                                                startupinfo.dwFlags |= _subprocess.STARTF_USESTDHANDLES
                                            AttributeError: 'str' object has no attribute 'dwFlags'
18:31:24 T:5008    INFO: -->End of Python script error report<--
18:31:24 T:5008    INFO: Python script stopped

If you have any idea why (because I don't want to change your script default actions). Without it, the emulator run fine, and I get back output from STDOUT. But I want it to be with that parameter if it is important.

This was with "subproccess", if I used the hacked one "subprocess_hack" (whether it is with the parameter "startupinfo" or without it), then I get this error:

Code:
18:42:26 T:6116   ERROR: Error Type: <type 'exceptions.TypeError'>
18:42:26 T:6116   ERROR: Error Contents: an integer is required
18:42:26 T:6116   ERROR: Traceback (most recent call last):
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\addon.py", line 20, in <module>
                                                plugin.Main()
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 179, in __init__
                                                self._run_rom(launcher, rom)
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\launcher_plugin.py", line 1316, in _run_rom
                                                proc = subprocess_hack.Popen(r'%s %s' % (launcher["application"], arguments), shell=False, stdout=subprocess.PIPE, cwd=apppath)
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\subprocess_hack.py", line 537, in __init__
                                                errread, errwrite) = self._get_handles(stdin, stdout, stderr)
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\subprocess_hack.py", line 595, in _get_handles
                                                p2cread = self._make_inheritable(p2cread)
                                              File "XXXX\AppData\Roaming\XBMC\addons\plugin.program.advanced.launcher\resources\lib\subprocess_hack.py", line 636, in _make_inheritable
                                                DUPLICATE_SAME_ACCESS)
                                            TypeError: an integer is required
18:42:26 T:6116    INFO: -->End of Python script error report<--
18:42:26 T:6116    INFO: Python script stopped

It would be better if I get a possible fix for the subprocess_hack version, as it will be closer to your implementation. Any ideas?

Oh, and I managed to get output from STDOUT as I wished, so expect some contribution in a couple of weeks (if not closer).

Thanks.

Startupinfo is used to control the windows state of the started application. Advanced Launcher need it and use it to show/hide the bash windows when a .bat executable is started. So it is important to keep it.

For the use with subprocess_hack function call must not be :
Quote:proc= subprocess_hack.Popen(r'%s %s' % (launcher["application"], arguments), shell=False, stdout=subprocess_hack.PIPE, cwd=apppath)



- 13car - 2012-02-15

tria Wrote:If you don't mind "Angelscry", this is how you run it in fullscreen as described in the wiki for Advanced Lancher
http://www.gwenael.org/xbmc/index.php?title=VirtuaNES
You have to edit the ini file.

sorry I should have found that, Thank you.

And great add on thank you Angelscry!


- tria - 2012-02-15

Your suggestion (while being logical) didn't work. It gave me the same "type 'exceptions.TypeError'>" and "Error Contents: an integer is required" (just like the one I gave before).

If you are not aware of any possible fix, can I know if subprocess_hack is only needed for bat that need to be minimized (and I can safely use subprocess instead for any other cases, like autoit or exe/bin programs). If so, then I can move the subprocess_hack into the if statement for the bat, and use subprocess for the else part.

Thank you.

Edit:
By the way, I figured what is causing "startupinfo" to make errors. In the code you made the variable "info" equals "None" as a string (in the else part), and all what it takes to fix it is to use the constant/reserved-word: None (without quotes making it a string). But I still think subprocess won't have the same result as subprocess_hack regardless of this.


- Angelscry - 2012-02-15

tria Wrote:If you are not aware of any possible fix, can I know if subprocess_hack is only needed for bat that need to be minimized (and I can safely use subprocess instead for any other cases, like autoit or exe/bin programs). If so, then I can move the subprocess_hack into the if statement for the bat, and use subprocess for the else part.
Subprocess_hack is used specifically to allows started windows applications to kill XBMC if needed. By defaut, with subprocess, as child process cannot kill it's parent process. But... I have to check this. Because Eden version of XBMC use a different version for python... it could be different now. You can also hide .bat windows using Subprocess.

tria Wrote:By the way, I figured what is causing "startupinfo" to make errors. In the code you made the variable "info" equals "None" as a string (in the else part), and all what it takes to fix it is to use the constant/reserved-word: None (without quotes making it a string). But I still think subprocess won't have the same result as subprocess_hack regardless of this.
I will try to fix this.... Thank you... Nod


- benholtby - 2012-02-16

Just a quick one.

I have set up scriot to suspend xbmc when running emulators etc but whenever I launch a game from the program it is only starting the emulator and not booting directly to the rom. What do i need to add to the .sh below to do this?

#!/bin/bash
killall -STOP xbmc.bin
/usr/bin/zsnes -fs "$1"
killall -CONT xbmc.bin

thanks


- Angelscry - 2012-02-16

benholtby Wrote:Just a quick one.

I have set up scriot to suspend xbmc when running emulators etc but whenever I launch a game from the program it is only starting the emulator and not booting directly to the rom. What do i need to add to the .sh below to do this?

#!/bin/bash
killall -STOP xbmc.bin
/usr/bin/zsnes -fs "$1"
killall -CONT xbmc.bin

thanks
Your command line to start zsnes is not at all the good one (http://www.gwenael.org/xbmc/index.php?title=ZSNES#Linux). That's why zsnes do not start the roms correctly. A good script could be :
Code:
#!/bin/bash
killall -STOP xbmc.bin
/usr/bin/zsnes -m -s -v 22 "$1"
killall -CONT xbmc.bin
Then you have to configure your file launcher correctly :

application : pointing to your zsnes .sh script
arguments : "%rom%"


- seijmo - 2012-02-16

Hi,

I'm using advanced launcher on mac and I wasn't able to have snes9X directly loading a rom from xbmc so I asked on the dedicated forum and actually the code to load a rom directly at startup of snes9x needs to be like this

Code:
open -a /Applications/Snes9x.app /path/game.smc

Is there any way that I can configure this kind of call from advanced launcher or should I edit manually a configuration file?

Thanks


- Angelscry - 2012-02-16

seijmo Wrote:Hi,

I'm using advanced launcher on mac and I wasn't able to have snes9X directly loading a rom from xbmc so I asked on the dedicated forum and actually the code to load a rom directly at startup of snes9x needs to be like this

Code:
open -a /Applications/Snes9x.app /path/game.smc

Is there any way that I can configure this kind of call from advanced launcher or should I edit manually a configuration file?

Thanks
If you have the possibility to directly reach the open executable file from Advanced launcher, a possible files launcher configuration could be :
  • Application: /path_to/open
  • Items path: /path/
  • Arguments: -a /Applications/Snes9x.app "%rom%"
  • Roms Extension: smc



- seijmo - 2012-02-17

I don't know where open executable path is so I can't access it.

Maybe I can edit manually
Application: once I have define it in Advanced Launcher?


- Blackhebrew - 2012-02-17

I'm back again with yet another problem, but this time it is my emulators rather than comics, my emulators seem to have massive frame rate drops when launched from advanced launcher. F-Zero X runs at 60 FPS in PJ64 for me out when only using pj64. It runs at 20 FPS when launched from XBMC, this is the same across all my emulators, am I missing something obvious? All my arguments are in check.


- Angelscry - 2012-02-17

seijmo Wrote:I don't know where open executable path is so I can't access it.

Maybe I can edit manually
Application: once I have define it in Advanced Launcher?
according to this web page (https://blogs.oracle.com/scblog/entry/mac_os_leopard_usr_bin) the path must be /usr/bin/open.


- Angelscry - 2012-02-17

Blackhebrew Wrote:I'm back again with yet another problem, but this time it is my emulators rather than comics, my emulators seem to have massive frame rate drops when launched from advanced launcher. F-Zero X runs at 60 FPS in PJ64 for me out when only using pj64. It runs at 20 FPS when launched from XBMC, this is the same across all my emulators, am I missing something obvious? All my arguments are in check.
It could be related to your system or your graphic resources that is not enough powerful to run both emulators and XBMC at the same time.

What you can try is to use a small script that will suspend or close XBMC just before starting the emulator and then restart XBMC when the emulator will be closed. You will found some example of such script here and here.


- jickler - 2012-02-17

I'm trying to configure Mupen64Plus to run on my AppleTV out of Advanced Launcher. I'm using a stripped down Ubuntu 8.0.4 installation (Crystalbuntu), and I know that mupen has been installed correctly because I'm able to run it from terminal, but when I try to launch it from XBMC the screen just flashes briefly. This doesn't happen with any of my other emulators. I'm brutally confused as to why this would happen, does anyone have any ideas?


- Angelscry - 2012-02-17

jickler Wrote:I'm trying to configure Mupen64Plus to run on my AppleTV out of Advanced Launcher. I'm using a stripped down Ubuntu 8.0.4 installation (Crystalbuntu), and I know that mupen has been installed correctly because I'm able to run it from terminal, but when I try to launch it from XBMC the screen just flashes briefly. This doesn't happen with any of my other emulators. I'm brutally confused as to why this would happen, does anyone have any ideas?
With so few information it is really hard to have an idea what is going wrong. No information about the mupenplus64 version, no information about the command line you use to start mupen64plus, and no information about your mupen64plus launcher configuration... Eek

BTW, if you are able to start it form terminal and not from XBMC/Advanced launcher that means that you may have something wrong into the mupen64plus configuration into advanced launcher.

What you can try to debug this is to start XBMC from the terminal then start Mupen64plus from Advanced Launcher. If there is some errors they will be displayed into the terminal windows, and so you may be able to fix thwe error.


- BigNoid - 2012-02-17

For the platform infolabel (ListItem.Writer), are these constant values or does it depend on the scraper used? If they are constant, do you have a list of possible values?