From 68da28cba142c7f29c6a5826d7513d687df86cc2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 27 Nov 2014 17:36:33 +0100 Subject: ftclient: also enable freetrack on Linux for Wine Issue: #97 --- ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ftnoir_protocol_wine') diff --git a/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx b/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx index b7dc531c..5d19608a 100644 --- a/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx +++ b/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx @@ -8,14 +8,15 @@ #include "compat/compat.cpp" #include "wine-shm.h" -void create_registry_key(void) { +static void write_path(const char* key, const char* subkey) +{ char dir[8192]; if (GetCurrentDirectoryA(8192, dir) < 8190) { HKEY hkpath; if (RegCreateKeyExA(HKEY_CURRENT_USER, - "Software\\NaturalPoint\\NATURALPOINT\\NPClient Location", + key, 0, NULL, 0, @@ -28,8 +29,13 @@ void create_registry_key(void) { if (dir[i] == '\\') dir[i] = '/'; strcat(dir, "/"); - (void) RegSetValueExA(hkpath, "Path", 0, REG_SZ, (BYTE*) dir, strlen(dir) + 1); + (void) RegSetValueExA(hkpath, subkey, 0, REG_SZ, (BYTE*) dir, strlen(dir) + 1); RegCloseKey(hkpath); } } } + +void create_registry_key(void) { + write_path("Software\\NaturalPoint\\NATURALPOINT\\NPClient Location", "Path"); + write_path("Software\\Freetrack\\FreeTrackClient", "Path"); +} -- cgit v1.2.3