Get Far installation path

A place where plug-in developers can share their knowledge and experience.
Post Reply
User avatar
techie
Posts: 795
Joined: Mon 03 Oct, 2005 22:42
Has thanked: 35 times
Been thanked: 6 times

Get Far installation path

Post by techie »

How to get path to Far installation from registry, i.e. for external tool or plugin installer?
Maximus5
Posts: 3295
Joined: Sun 11 Nov, 2007 02:03
Been thanked: 10 times
Contact:

Re: Get Far installation path

Post by Maximus5 »

Use %FARHOME% env.var, when external tool is started from Far
, imho, is not safe - Far may not be installed, but simply unpacked.
User avatar
techie
Posts: 795
Joined: Mon 03 Oct, 2005 22:42
Has thanked: 35 times
Been thanked: 6 times

Re: Get Far installation path

Post by techie »

Thanks. I couldn't find this myself, because it appeared that I've entered wrong search parameters. I actually found Far2 installation key in HKLM/Software/Far2/InstallDir, but I've installed Far2 for all users, and I am not sure if the same key will be created in HKCU. I am also not sure if Far 1.7x create keys in the same manner.

Uninstaller key has a different name in my case and I am afraid that it can not be used reliably HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{514B211A-E883-4F8D-B783-D0393E2E1CA5}
User avatar
chupakabra
Posts: 1023
Joined: Wed 27 Jul, 2005 19:36
Contact:

Re: Get Far installation path

Post by chupakabra »

You can see example plugin installer here: http://code.google.com/p/farplug/source ... Finstaller
User avatar
techie
Posts: 795
Joined: Mon 03 Oct, 2005 22:42
Has thanked: 35 times
Been thanked: 6 times

Re: Get Far installation path

Post by techie »

Thanks. I already have working installer. I just need a mechanism for reliably detecting Far installation without redundant stuff.
User avatar
chupakabra
Posts: 1023
Joined: Wed 27 Jul, 2005 19:36
Contact:

Re: Get Far installation path

Post by chupakabra »

Far installer saves installation path into the following registry parameter:
HKLM (per-machine install) or HKCU (per-user install)
Software
Far (for Far 1.75) or Far2 (for Far 2)
InstallDir (for x86) or InstallDir_x64 (for Far x64)

Example:
Far 2 x64 per-machine installation: HKLM\Software\Far2\InstallDir_x64

When installing x64 plugin using x86 installer (and vice versa) you should take registry virtualization into account (per-machine install only).

Btw. Far installer is open source.
User avatar
techie
Posts: 795
Joined: Mon 03 Oct, 2005 22:42
Has thanked: 35 times
Been thanked: 6 times

Re: Get Far installation path

Post by techie »

Thanks. I ended up with the following lookup order:

HKCU Software/Far2 InstallDir
HKLM Software/Far2 InstallDir
%PROGRAMFILES%\Far2
HKCU Software/Far InstallDir
HKLM Software/Far InstallDir
%PROGRAMFILES%\Far

What is this "registry virtualization"?
User avatar
chupakabra
Posts: 1023
Joined: Wed 27 Jul, 2005 19:36
Contact:

Re: Get Far installation path

Post by chupakabra »

What is this "registry virtualization"?
32-bit application will read from HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Far2\InstallDir_x64 instead of HKEY_LOCAL_MACHINE\SOFTWARE\Far2\InstallDir_x64 by deafult.
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

Re: Get Far installation path

Post by DrKnS »

techie wrote: %PROGRAMFILES%
Don't forget about %ProgramFiles(x86)%.
User avatar
techie
Posts: 795
Joined: Mon 03 Oct, 2005 22:42
Has thanked: 35 times
Been thanked: 6 times

Re: Get Far installation path

Post by techie »

I've placed NSIS sources to https://sourceforge.net/apps/trac/color ... eadist.nsi
Feel free to send a patch if the installer from https://sourceforge.net/projects/colore ... rer-1.0.3/ won't work correctly.
Post Reply

Return to “Plug-In Developers”