1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2024-11-14 19:17:35 +01:00

Setup: Block ARM64 devices from running the x64 setup

This commit is contained in:
Amrsatrio 2024-07-14 17:29:37 +07:00
parent 2b9c747212
commit 5d0d218d38
4 changed files with 37 additions and 9 deletions

View File

@ -517,6 +517,32 @@ int WINAPI wWinMain(
return !bOk;
}
#if defined(_M_X64)
typedef BOOL (WINAPI *IsWow64Process2_t)(HANDLE hProcess, USHORT* pProcessMachine, USHORT* pNativeMachine);
IsWow64Process2_t pfnIsWow64Process2 = (IsWow64Process2_t)GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "IsWow64Process2");
if (pfnIsWow64Process2)
{
USHORT processMachine, nativeMachine;
if (pfnIsWow64Process2(GetCurrentProcess(), &processMachine, &nativeMachine))
{
if (nativeMachine == IMAGE_FILE_MACHINE_ARM64)
{
WCHAR szFormat[256];
szFormat[0] = 0;
int written = LoadStringW(hInstance, IDS_SETUP_UNSUPPORTED_ARCH, szFormat, ARRAYSIZE(szFormat));
if (written > 0 && written < ARRAYSIZE(szFormat))
{
WCHAR szMessage[256];
szMessage[0] = 0;
_swprintf_p(szMessage, ARRAYSIZE(szMessage), szFormat, L"ARM64", L"x64");
MessageBoxW(NULL, szMessage, _T(PRODUCT_NAME), MB_OK | MB_ICONERROR);
}
exit(0);
}
}
}
#endif
WCHAR wszOwnPath[MAX_PATH];
ZeroMemory(wszOwnPath, ARRAYSIZE(wszOwnPath));
if (!GetModuleFileNameW(NULL, wszOwnPath, ARRAYSIZE(wszOwnPath)))

View File

@ -68,11 +68,11 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "VALINET Solutions SRL"
VALUE "CompanyName", "ExplorerPatcher Developers"
VALUE "FileDescription", "ExplorerPatcher Setup Program"
VER_FILE_STRING
VALUE "InternalName", "ep_setup.exe"
VALUE "LegalCopyright", "Copyright (C) 2006-2024 VALINET Solutions SRL. All rights reserved."
VALUE "LegalCopyright", "(C) 2021-2024 ExplorerPatcher Developers. All rights reserved."
VALUE "OriginalFilename", "ep_setup.exe"
VALUE "ProductName", "ExplorerPatcher"
VER_PRODUCT_STRING
@ -126,7 +126,7 @@ IDR_EP_TASKBAR_5 RCDATA "..\\build\\Release\\x64\\ep_taskbar.
#elif defined(PLATFORM_ARM64)
IDR_EP_ARM64 RCDATA "..\\build\\Release\\ARM64\\ExplorerPatcher.arm64.dll"
IDR_EP_AMD64 RCDATA "..\\build\\Release\\ARM64\\ExplorerPatcher.arm64.dll"
IDR_EP_DWM RCDATA "..\\build\\Release\\ARM64\\ep_dwm.exe"

View File

@ -5,6 +5,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STRINGTABLE
BEGIN
IDS_SETUP_UNSUPPORTED_ARCH "Please run the %1$s version of the setup file on %1$s devices. This setup file is only for %2$s devices."
IDS_SETUP_UNINSTALL_PROMPT "Are you sure you want to remove ExplorerPatcher from your PC?"
IDS_SETUP_INSTALL_LOGOFF "In order to install, you will be automatically signed out of Windows. ExplorerPatcher will be ready for use when you sign back in.\n\nDo you want to continue?"
IDS_SETUP_UNINSTALL_LOGOFF "To complete the uninstallation, you will be automatically signed out of Windows.\n\nDo you want to continue?"

View File

@ -15,12 +15,13 @@
#define IDR_EP_TASKBAR_4 112
#define IDR_EP_TASKBAR_5 113
#define IDS_SETUP_UNINSTALL_PROMPT 301
#define IDS_SETUP_INSTALL_LOGOFF 302
#define IDS_SETUP_UNINSTALL_LOGOFF 303
#define IDS_SETUP_UNINSTALL_RESTART 304
#define IDS_SETUP_UNINSTALL_FINISH 305
#define IDS_SETUP_FAILED 306
#define IDS_SETUP_UNSUPPORTED_ARCH 301
#define IDS_SETUP_UNINSTALL_PROMPT 302
#define IDS_SETUP_INSTALL_LOGOFF 303
#define IDS_SETUP_UNINSTALL_LOGOFF 304
#define IDS_SETUP_UNINSTALL_RESTART 305
#define IDS_SETUP_UNINSTALL_FINISH 306
#define IDS_SETUP_FAILED 307
// Next default values for new objects