Kodi Community Forum

Full Version: RestartApp function not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Using XBMC 12.2 Windows 7 Home Premium w. Aeon Nox

Triggering RestartApp from remote shortcut or Skin menu isn't working properly. It is closing XBMC, but not restarting it once it is closed. Trying to make it easier for the family as XBMC needs to be restarted once a day because if it isn't videos start to stutter.

Debug log:
http://pastebin.com/KKcW40GF
Anyone?
Its not implemented under win32 as its not simple to do that. For vista and up there're some api's available which could be helpful but we still run on XP.
So, you're saying the function just doesn't work?
Thats what not implemented means, yes.
Forgive the confusion...

I was simply following the guidelines for posting questions. As such, I had checked the wiki for information on this function and did not see that it was "not implemented":

http://wiki.xbmc.org/index.php?title=Lis..._functions

Perhaps this wiki should be updated to reflect that. I know that the developers and mods here don't like posts without the required information, likewise, I wasted a lot of time on this issue trying to get a function to work that would never work.

Also, it seems to be at least partially implemented, since it closes the program. I would think "Not Implemented" would mean it wasn't there at all.

Thanks for your time.
the core XBMC has some triggers to work with exit, restart, etc. It stops the services and does some other stuff. exit is easy so this is implemented ofc Wink Restart is done differently as every platform needs other steps.
You can mimic a restart function using autohotkey scripts. I will post it if you want.
Thanks baijuxavior for the offer. If you post the script, I will check it out for sure, but don't go too out of your way to do so. I was pretty much trying to save myself one press of a button on a remote. If the playback didn't get choppy after a day or so, I could leave XBMC running indefinitely without issue. I could probably program a sequence into my Harmony as well. The RestartApp function seemed like it would offer the cleanest solution (other than fixing the choppy playback).

Thanks for the replies. Very much appreciated.
(2013-08-12, 17:23)relayer35 Wrote: [ -> ]Perhaps this wiki should be updated to reflect that.

Done.
Here's what I did... (Windows 7, 64 bit)

Created a simple batch file by opening up notepad and typing this:
Code:
C:\Windows\Syswow64\TaskKill /F /IM xbmc.exe
timeout /T 1
start "XBMC" "C:\Program Files (x86)\XBMC\XBMC.exe"

Save the file name as "restartxbmc.bat". Change the "Save as type" to "All Files". (Be sure to add the .bat at the end.) Save this file somewhere (C: drive for example).

Now, I have it as a part of my shutdown menu by editing the DialogButtonMenu.xml in Aeon Nox. You can also add it to your keyboard.xml file to be able to restart it using a button push on your remote. Either option, use the "XBMC.System.Exec(C:\restartxbmc.bat)" function.
Thanks. I will give it a try tomorrow. The machine is running 32 bit Windows 7 so the folder names are different, but it should work the same.
The BAT file thing worked well. I assigned it to a key, and programmed my Harmony with a restart button and it works great. Thanks!

Here is something else I did with Aeon Nox,
I changed the custom_1144_FunctionSelection.xml file to replace the RestartApp command with the "XBMC.System.Exec(C:\restartxbmc.bat)" command, so when I pick the custom function Restart XBMC from the menu, it automatically runs the new command instead of RestartApp.