summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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");
+}