Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Nov 24, 2025

Fixes CMake install path detection for EA App installations on 64-bit Windows

Tested on EA App install

@xezon
Copy link

xezon commented Dec 1, 2025

This feature worked correctly for me already. Are you trying to cater it to the EA App install which uses different registry keys? Can you show how it looked before and after this change? What does your InstallPath registry key look like and what do you try to transform it to?

@bobtista
Copy link
Author

bobtista commented Dec 2, 2025

This feature worked correctly for me already. Are you trying to cater it to the EA App install which uses different registry keys? Can you show how it looked before and after this change? What does your InstallPath registry key look like and what do you try to transform it to?

Yes I have the EA App install.

Registry entries:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Generals\InstallPath = C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Command and Conquer Generals Zero Hour\InstallPath = C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals Zero Hour\

Current CMakeLists.txt checks HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Generals (not WOW6432Node), which doesn't have InstallPath.

Maybe we should also add explicit WOW6432Node registry checks to CMakeLists.txt?

@xezon
Copy link

xezon commented Dec 2, 2025

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Generals\InstallPath = C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Command and Conquer Generals Zero Hour\InstallPath = C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals Zero Hour\

And where are the root dirs of the games?

@bobtista
Copy link
Author

bobtista commented Dec 2, 2025

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Generals\InstallPath = C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Electronic Arts\EA Games\Command and Conquer Generals Zero Hour\InstallPath = C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals Zero Hour\

And where are the root dirs of the games?

"C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals Zero Hour\Generals.exe"
and
"C:\Program Files\EA Games\Command and Conquer Generals Zero Hour\Command and Conquer Generals\Generals.exe"

I love how they're both under a ZH parent directory

@xezon
Copy link

xezon commented Dec 2, 2025

Ok that appears to match the entries in your InstallPath keg keys. Then I do not understand why this change is modifying strings. It should read InstallPath and use that value. See the code above the one you touched.

@bobtista bobtista force-pushed the bobtista/fix-cmake-install-nested-path branch from 7ba2742 to 2025f85 Compare December 2, 2025 16:32
@bobtista
Copy link
Author

bobtista commented Dec 2, 2025

Ok that appears to match the entries in your InstallPath keg keys. Then I do not understand why this change is modifying strings. It should read InstallPath and use that value. See the code above the one you touched.

That worked :) I amended the commit and pushed

@bobtista bobtista changed the title Fix(CMake): Update install path to use nested EA game directory structure Fix(CMake): Update cmake install to check for EA App install registry key Dec 2, 2025
@bobtista bobtista changed the title Fix(CMake): Update cmake install to check for EA App install registry key Fix(CMake): Add WOW6432Node registry support for EA App installs Dec 2, 2025
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks much better

@xezon xezon added the Build Anything related to building, compiling label Dec 2, 2025
@xezon xezon changed the title Fix(CMake): Add WOW6432Node registry support for EA App installs build: Add WOW6432Node to registry path lookups for EA App install path detection Dec 2, 2025
@xezon xezon merged commit cc9d649 into TheSuperHackers:main Dec 2, 2025
28 checks passed
@OmniBlade
Copy link

I realise this is already merged, but I do wonder why it needs the WOW6432 lookup, CMake is supposed to correctly infer if it should use that for registry queries based on if the compiler is targeting 32bit or 64bit. Indeed it seems to do so for the ZH path, just not the Generals path (since on 64bit windows its always in the WOW6432 key)?

@bobtista
Copy link
Author

bobtista commented Dec 3, 2025

I realise this is already merged, but I do wonder why it needs the WOW6432 lookup, CMake is supposed to correctly infer if it should use that for registry queries based on if the compiler is targeting 32bit or 64bit. Indeed it seems to do so for the ZH path, just not the Generals path (since on 64bit windows its always in the WOW6432 key)?

Good question - I just did some homework on this, and I think it's because I'm running 64-bit CMake while building 32-bit targets. With get_filename_component, Windows only automatically redirects the 32-bit build to WOW6432Node - not 64 bit build. #1943 makes this cleaner, we can replace get_filename_component() with cmake_host_system_information() for registry lookups. This gives us explicit control over registry views via VIEW 32_64, which checks both 32-bit and 64-bit registry views regardless of CMake architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Anything related to building, compiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants