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.

Get EventGhost.exe Location

If you have a question or need help, this is the place to be.
Post Reply
jsonnabend
Experienced User
Posts: 127
Joined: Wed Apr 23, 2008 7:35 pm

Get EventGhost.exe Location

Post by jsonnabend »

Is it possible to find the location of the EventGhost executable using a Python script?

TIA

- Jeff
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Get EventGhost.exe Location

Post by Pako »

Here are two possible solutions:

Inside of EventGhost:

Code: Select all

import os
print os.path.abspath("")
Outside of EventGhost:

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
Pako
jsonnabend
Experienced User
Posts: 127
Joined: Wed Apr 23, 2008 7:35 pm

Re: Get EventGhost.exe Location

Post by jsonnabend »

Thanks as always, Pako.

- Jeff
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Get EventGhost.exe Location

Post by Bitmonster »

Inside EventGhost you can write

Code: Select all

import sys
print sys.argv
sys.argv[0] will be the path to the executable.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
Post Reply