Is it possible to find the location of the EventGhost executable using a Python script?
TIA
- Jeff
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Get EventGhost.exe Location
-
jsonnabend
- Experienced User
- Posts: 127
- Joined: Wed Apr 23, 2008 7:35 pm
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: Get EventGhost.exe Location
Here are two possible solutions:
Inside of EventGhost:Outside of EventGhost:Pako
Inside of EventGhost:
Code: Select all
import os
print os.path.abspath("")Code: Select all
import _winreg
try:
eg_reg = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\EventGhost_is1"
)
EventGhostPath = _winreg.QueryValueEx(eg_reg, "Inno Setup: App Path")[0]
_winreg.CloseKey(eg_reg)
except:
EventGhostPath = None
print EventGhostPath-
jsonnabend
- Experienced User
- Posts: 127
- Joined: Wed Apr 23, 2008 7:35 pm
Re: Get EventGhost.exe Location
Thanks as always, Pako.
- Jeff
- Jeff
- Bitmonster
- Site Admin
- Posts: 2239
- Joined: Mon Feb 06, 2006 10:28 pm
Re: Get EventGhost.exe Location
Inside EventGhost you can write
sys.argv[0] will be the path to the executable.
Code: Select all
import sys
print sys.argv
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!