summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-11-27 17:36:33 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-11-27 17:36:33 +0100
commit68da28cba142c7f29c6a5826d7513d687df86cc2 (patch)
tree97cc04175b8d5e398c47d3cf022d195028ef3aea /ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx
parent848998daa1203fede9ee063a7c188a7c54d4b978 (diff)
ftclient: also enable freetrack on Linux for Wine
Issue: #97
Diffstat (limited to 'ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx')
-rw-r--r--ftnoir_protocol_wine/opentrack-wrapper-wine-windows.cxx12
1 files changed, 9 insertions, 3 deletions
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");
+}