home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Language specific support
Deutsches MediaPortal Forum
Allgemein
Einsteigerforum
Tvservice.exe manuell starten?!
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="level20peon" data-source="post: 185215" data-attributes="member: 28613"><p>Hallo Enforcer,</p><p></p><p><span style="color: Red">german version:</span></p><p>grundsätzlich ist diese Funktion nicht in MediaPortal enthalten, da der Sinn eines Services nicht darin liegt, ihn zu starten, wenn ein bestimmtes Programm gestartet wird und ihn zu beenden, wenn dieses Programm wieder geschlossen wird. Ein Service läuft quasi immer (im Hintergrund).</p><p></p><p>Du könntest aber zB mit <a href="http://www.autoitscript.com/autoit3/" target="_blank">AutoIt</a> ein script verfassen und kompilieren, über das du dann MediaPortal startest, der Code würde in etwa so aussehen (Der Code bezieht sich darauf, dass er zu der Datei "MP.exe" kompiliert wird):</p><p></p><p></p><p><span style="color: Red">english version:</span></p><p>this option is not integrated in MediaPortal since the purpose of a service lays in always running in the background.</p><p></p><p>Is is however possible to use an <a href="http://www.autoitscript.com/autoit3/" target="_blank">AutoIt</a> script. Compile it an start MediaPortal through it afterwards. The Code would be something like this (It is intended to name the compiled .exe "MP.exe"):</p><p></p><p>[CODE]</p><p>#NoTrayIcon</p><p></p><p>ProcessSetPriority("MP.exe", 0)</p><p></p><p>Func _Singleton($occurenceName, $flag = 0)</p><p> Local $ERROR_ALREADY_EXISTS = 183</p><p> $occurenceName = StringReplace($occurenceName, "\", "") ; to avoid error</p><p> ; Local $handle = DllCall("kernel32.dll", "int", "CreateSemaphore", "int", 0, "long", 1, "long", 1, "str", $occurenceName)</p><p> Local $handle = DllCall("kernel32.dll", "int", "CreateMutex", "int", 0, "long", 1, "str", $occurenceName)</p><p> Local $lastError = DllCall("kernel32.dll", "int", "GetLastError")</p><p> If $lastError[0] = $ERROR_ALREADY_EXISTS Then</p><p> If $flag = 0 Then</p><p> Exit -1</p><p> Else</p><p> SetError($lastError[0])</p><p> Return 0</p><p> EndIf</p><p> EndIf</p><p> Return $handle[0]</p><p>EndFunc</p><p></p><p></p><p></p><p>if Not _Singleton("MP.exe",1) = 0 Then</p><p> Run("C:\Windows\System32\net.exe start TVService", "", @SW_HIDE)</p><p> Run("C:\Programme\Team MediaPortal\MediaPortal\MediaPortal.exe")</p><p> ProcessWait("MediaPortal.exe")</p><p> ProcessWaitClose("MediaPortal.exe")</p><p> Run("C:\Windows\System32\net.exe stop TVService", "", @SW_HIDE)</p><p>EndIf</p><p>[/CODE]</p><p></p><p></p><p>-level20peon</p></blockquote><p></p>
[QUOTE="level20peon, post: 185215, member: 28613"] Hallo Enforcer, [COLOR="Red"]german version:[/COLOR] grundsätzlich ist diese Funktion nicht in MediaPortal enthalten, da der Sinn eines Services nicht darin liegt, ihn zu starten, wenn ein bestimmtes Programm gestartet wird und ihn zu beenden, wenn dieses Programm wieder geschlossen wird. Ein Service läuft quasi immer (im Hintergrund). Du könntest aber zB mit [URL="http://www.autoitscript.com/autoit3/"]AutoIt[/URL] ein script verfassen und kompilieren, über das du dann MediaPortal startest, der Code würde in etwa so aussehen (Der Code bezieht sich darauf, dass er zu der Datei "MP.exe" kompiliert wird): [COLOR="Red"]english version:[/COLOR] this option is not integrated in MediaPortal since the purpose of a service lays in always running in the background. Is is however possible to use an [URL="http://www.autoitscript.com/autoit3/"]AutoIt[/URL] script. Compile it an start MediaPortal through it afterwards. The Code would be something like this (It is intended to name the compiled .exe "MP.exe"): [CODE] #NoTrayIcon ProcessSetPriority("MP.exe", 0) Func _Singleton($occurenceName, $flag = 0) Local $ERROR_ALREADY_EXISTS = 183 $occurenceName = StringReplace($occurenceName, "\", "") ; to avoid error ; Local $handle = DllCall("kernel32.dll", "int", "CreateSemaphore", "int", 0, "long", 1, "long", 1, "str", $occurenceName) Local $handle = DllCall("kernel32.dll", "int", "CreateMutex", "int", 0, "long", 1, "str", $occurenceName) Local $lastError = DllCall("kernel32.dll", "int", "GetLastError") If $lastError[0] = $ERROR_ALREADY_EXISTS Then If $flag = 0 Then Exit -1 Else SetError($lastError[0]) Return 0 EndIf EndIf Return $handle[0] EndFunc if Not _Singleton("MP.exe",1) = 0 Then Run("C:\Windows\System32\net.exe start TVService", "", @SW_HIDE) Run("C:\Programme\Team MediaPortal\MediaPortal\MediaPortal.exe") ProcessWait("MediaPortal.exe") ProcessWaitClose("MediaPortal.exe") Run("C:\Windows\System32\net.exe stop TVService", "", @SW_HIDE) EndIf [/CODE] -level20peon [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Language specific support
Deutsches MediaPortal Forum
Allgemein
Einsteigerforum
Tvservice.exe manuell starten?!
Contact us
RSS
Top
Bottom