Process Hacker Discussion Forum

 
User avatar
Vasilich
Member
Posts: 28
Joined: 04 Nov 2015 09:44
OS: W7 x64

Specify path to GeoIP DB for portable installations

30 Jan 2019 13:58

I like the "country" column in network view :thumbup: .
And i have configured the location of GeoIP DB file to have no path (only filename.ext), so PH should take the file from the directory with HP exe file.
That works if i start PH from its directory. But it doesn't, if i have configured it as "replace task manager" and started via Ctrl+Shift+Esc (or via rightClick on taskbar - start TaskManager, or Ctrl+Alt+Del and select "Start task manager").
Is there any possibility to set the path to GeoIP DB file so, that it can be found when PH has been started not from own directory, and not have to define an absolute path?
 
User avatar
diversenok
Contributor
Posts: 49
Joined: 26 Jun 2017 17:55
OS: Windows 7 x64
Contact:

Re: Specify path to GeoIP DB for portable installations

30 Jan 2019 15:37

You might want to add the location of GeoIP DB to PATH using App Paths, so it will appear only for Process Hacker. Here is an example:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ProcessHacker.exe]
"Path"="C:\\Program Files\\Process Hacker\\"
It also works on per-user basis if you switch HKLM to HKCU.
 
User avatar
viksoftru
Member
Posts: 629
Joined: 15 Aug 2011 06:01
OS: Win7 (Live! DVD), BSD

Re: Specify path to GeoIP DB for portable installations

30 Jan 2019 20:51

Your can use any patch format - absolute, relative or UNC. I save this DB in to server and use UNC patch for save disk space. No problems.
 
User avatar
Vasilich
Member
Posts: 28
Joined: 04 Nov 2015 09:44
OS: W7 x64

Re: Specify path to GeoIP DB for portable installations

02 Feb 2019 02:11

thanks for the replies, but i try to find solution for portable version from USB stick - in that case no registry hacks will work, and the path can be different on different PCs.
e.g. in TotalCommander there is kind of environment variable %TOTALCMD%, that contains path to the folder with started EXE file. This variable does exist only in TotalCommander internally, but works perfectly when starting TotalCommander from USB.
 
User avatar
viksoftru
Member
Posts: 629
Joined: 15 Aug 2011 06:01
OS: Win7 (Live! DVD), BSD

Re: Specify path to GeoIP DB for portable installations

02 Feb 2019 13:49

Seve PH config as ProcessHacker.exe.settings.xml in to some directory that place ProcessHacker.exe and all your can save other settings in to this dir as portable mode. Example file list for portable copy:

plugins\plugindata\kprocesshacker2_x*.sys --- needed only if use Terminator plug-in
x86\plugins\DotNetTools.dll -- 32-th bit copy, some version as x64 copy;
x86\plugins\ExtendedTools.dll -- 32-th bit copy, some version as x64 copy;
x86\dbgcore.dll -- 32-th bit copy, some version as x64 copy;
x86\ProcessHacker.exe -- 32-th bit copy, some version as x64 copy;;
capslist.txt
dbgcore.dll - latest verson, included In to Windows Platform SDK as part of Windows Debugger Tools;
GeoLite2-Country.mmdb -- can download use toolbar menu item Tools -> Network tools -> GeoIP database update...
kprocesshacker.sys -- v3.1 signed
peview.exe
ProcessHacker.exe
ProcessHacker.sig
ProcessHacker.exe.settings.xml
usernotesdb.xml
 
User avatar
Vasilich
Member
Posts: 28
Joined: 04 Nov 2015 09:44
OS: W7 x64

Re: Specify path to GeoIP DB for portable installations

02 Feb 2019 18:25

i did so already, as i wrote in first post. Pls read it carefully.
The problem is that if PH was started not directly from its folder, than specifying just filename without path won't work? as it will search the file in windows/system32 folder (as a taskManager replacement?).
 
User avatar
viksoftru
Member
Posts: 629
Joined: 15 Aug 2011 06:01
OS: Win7 (Live! DVD), BSD

Re: Specify path to GeoIP DB for portable installations

02 Feb 2019 22:19

Search Path Used by Windows to Locate a DLL. if you specified a relative path, then the root directory is the directory in which ProcessHacker.exe is located and the directory tree structure is read from it. If you just specified the file name without a previous path, then the file is searched only in the directory where the executable file is located ProcessHacker.exe, and all other directories are ignored.

If ProcessHacker.exe acts as a replacement for taskmgr.exe, a program matching mechanism is used, example (if Process Hacker installed in to "C:\Program Files\Process Hacker":
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe]
"Debugger"="\"C:\\Program Files\\Process Hacker\\ProcessHacker.exe\""
 
User avatar
dmex
Admin
Posts: 1698
Joined: 17 Jan 2011 05:43

Re: Specify path to GeoIP DB for portable installations

02 Feb 2019 22:27

Vasilich wrote: 02 Feb 2019 18:25
specifying just filename without path won't work?
This was fixed a few days ago in the nightly build. You don't need to use any of above workarounds. :?
 
User avatar
Vasilich
Member
Posts: 28
Joined: 04 Nov 2015 09:44
OS: W7 x64

Re: Specify path to GeoIP DB for portable installations

03 Feb 2019 19:00

thank you, dmex.
After update to v3.02154 (last update was at 29.01.2019, i don't remember version) the relative path works with any way of starting PH.
Problem solved.