summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2013-08-17 20:53:22 +0000
committerSimon Howard2013-08-17 20:53:22 +0000
commit0a94c0f99d6c34b30d2ac6fd7d5e516bd14dffb5 (patch)
treebb209b918bd16321cf11bbc5d584ea14969f2da5 /src
parent46547d4b48f3e52c12a4de526d11e877b2185cd2 (diff)
downloadchocolate-doom-0a94c0f99d6c34b30d2ac6fd7d5e516bd14dffb5.tar.gz
chocolate-doom-0a94c0f99d6c34b30d2ac6fd7d5e516bd14dffb5.tar.bz2
chocolate-doom-0a94c0f99d6c34b30d2ac6fd7d5e516bd14dffb5.zip
Fix IWAD registry locations when using 64-bit Windows. Change imported
from Odamex r4128 (thanks AlexMax). Subversion-branch: /branches/v2-branch Subversion-revision: 2618
Diffstat (limited to 'src')
-rw-r--r--src/d_iwad.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c
index 715687de..647dbbc7 100644
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -100,13 +100,21 @@ typedef struct
//
// With some munging we can find where Doom was installed.
-static registry_value_t uninstall_values[] =
+// [AlexMax] From the persepctive of a 64-bit executable, 32-bit registry
+// keys are located in a different spot.
+#if _WIN64
+#define SOFTWARE_KEY "Software\\Wow6432Node"
+#else
+#define SOFTWARE_KEY "Software"
+#endif
+
+static registry_value_t uninstall_values[] =
{
// Ultimate Doom, CD version (Depths of Doom trilogy)
{
- HKEY_LOCAL_MACHINE,
- "Software\\Microsoft\\Windows\\CurrentVersion\\"
+ HKEY_LOCAL_MACHINE,
+ SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
"Uninstall\\Ultimate Doom for Windows 95",
"UninstallString",
},
@@ -114,8 +122,8 @@ static registry_value_t uninstall_values[] =
// Doom II, CD version (Depths of Doom trilogy)
{
- HKEY_LOCAL_MACHINE,
- "Software\\Microsoft\\Windows\\CurrentVersion\\"
+ HKEY_LOCAL_MACHINE,
+ SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
"Uninstall\\Doom II for Windows 95",
"UninstallString",
},
@@ -123,8 +131,8 @@ static registry_value_t uninstall_values[] =
// Final Doom
{
- HKEY_LOCAL_MACHINE,
- "Software\\Microsoft\\Windows\\CurrentVersion\\"
+ HKEY_LOCAL_MACHINE,
+ SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
"Uninstall\\Final Doom for Windows 95",
"UninstallString",
},
@@ -132,8 +140,8 @@ static registry_value_t uninstall_values[] =
// Shareware version
{
- HKEY_LOCAL_MACHINE,
- "Software\\Microsoft\\Windows\\CurrentVersion\\"
+ HKEY_LOCAL_MACHINE,
+ SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
"Uninstall\\Doom Shareware for Windows 95",
"UninstallString",
},
@@ -144,7 +152,7 @@ static registry_value_t uninstall_values[] =
static registry_value_t collectors_edition_value =
{
HKEY_LOCAL_MACHINE,
- "Software\\Activision\\DOOM Collector's Edition\\v1.0",
+ SOFTWARE_KEY "\\Activision\\DOOM Collector's Edition\\v1.0",
"INSTALLPATH",
};
@@ -162,7 +170,7 @@ static char *collectors_edition_subdirs[] =
static registry_value_t steam_install_location =
{
HKEY_LOCAL_MACHINE,
- "Software\\Valve\\Steam",
+ SOFTWARE_KEY "\\Valve\\Steam",
"InstallPath",
};