diff --git a/MSI/MSIBuild b/MSI/MSIBuild index e1a0146..538cea0 160000 --- a/MSI/MSIBuild +++ b/MSI/MSIBuild @@ -1 +1 @@ -Subproject commit e1a01465701da2f554e27a9eaccf7a2a5da0f23b +Subproject commit 538cea09453a2ee52f918036f7b2e7b51347d7cc diff --git a/MSI/MSICA b/MSI/MSICA index 1e48c20..757ad14 160000 --- a/MSI/MSICA +++ b/MSI/MSICA @@ -1 +1 @@ -Subproject commit 1e48c204063258c12615033e5bc66fc39c0d081a +Subproject commit 757ad1497554500e2369348455225aa454e2c4e9 diff --git a/MSI/ZRCola/Main/Makefile b/MSI/ZRCola/Main/Makefile index bc278ea..acf839d 100644 Binary files a/MSI/ZRCola/Main/Makefile and b/MSI/ZRCola/Main/Makefile differ diff --git a/Makefile b/Makefile index 8a0e97c..b4ace5e 100644 --- a/Makefile +++ b/Makefile @@ -240,19 +240,25 @@ UnregisterShortcuts :: copy /y $** $@ > NUL "$(OUTPUT_DIR)\catalog.xml" : \ - "$(OUTPUT_DIR)\ZRColaEn32.msi" \ - "$(OUTPUT_DIR)\ZRColaEn64.msi" \ - "$(OUTPUT_DIR)\ZRColaRu32.msi" \ - "$(OUTPUT_DIR)\ZRColaRu64.msi" \ - "$(OUTPUT_DIR)\ZRColaSl32.msi" \ - "$(OUTPUT_DIR)\ZRColaSl64.msi" + "$(OUTPUT_DIR)\ZRColaEn-x86.msi" \ + "$(OUTPUT_DIR)\ZRColaEn-amd64.msi" \ + "$(OUTPUT_DIR)\ZRColaEn-arm64.msi" \ + "$(OUTPUT_DIR)\ZRColaRu-x86.msi" \ + "$(OUTPUT_DIR)\ZRColaRu-amd64.msi" \ + "$(OUTPUT_DIR)\ZRColaRu-arm64.msi" \ + "$(OUTPUT_DIR)\ZRColaSl-x86.msi" \ + "$(OUTPUT_DIR)\ZRColaSl-amd64.msi" \ + "$(OUTPUT_DIR)\ZRColaSl-arm64.msi" copy /y "$(PUBLISH_DIR)\catalog-0001.xml" "$(@:"=).tmp" > NUL - "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn32.msi" -f "$(OUTPUT_DIR)\ZRColaEn32.msi" - "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn64.msi" -f "$(OUTPUT_DIR)\ZRColaEn64.msi" - "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu32.msi" -f "$(OUTPUT_DIR)\ZRColaRu32.msi" - "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu64.msi" -f "$(OUTPUT_DIR)\ZRColaRu64.msi" - "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl32.msi" -f "$(OUTPUT_DIR)\ZRColaSl32.msi" - "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl64.msi" -f "$(OUTPUT_DIR)\ZRColaSl64.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn-x86.msi" -f "$(OUTPUT_DIR)\ZRColaEn-x86.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn-amd64.msi" -f "$(OUTPUT_DIR)\ZRColaEn-amd64.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-arm64 en_US "$(PUBLISH_PACKAGE_URL)/ZRColaEn-arm64.msi" -f "$(OUTPUT_DIR)\ZRColaEn-arm64.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu-x86.msi" -f "$(OUTPUT_DIR)\ZRColaRu-x86.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu-amd64.msi" -f "$(OUTPUT_DIR)\ZRColaRu-amd64.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-arm64 ru_RU "$(PUBLISH_PACKAGE_URL)/ZRColaRu-arm64.msi" -f "$(OUTPUT_DIR)\ZRColaRu-arm64.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-x86 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl-x86.msi" -f "$(OUTPUT_DIR)\ZRColaSl-x86.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-amd64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl-amd64.msi" -f "$(OUTPUT_DIR)\ZRColaSl-amd64.msi" + "$(OUTPUT_DIR)\$(PLAT).Release\UpdPublish.exe" "$(@:"=).tmp" "$(@:"=).tmp" win-arm64 sl_SI "$(PUBLISH_PACKAGE_URL)/ZRColaSl-arm64.msi" -f "$(OUTPUT_DIR)\ZRColaSl-arm64.msi" "$(OUTPUT_DIR)\$(PLAT).Release\UpdSignXML.exe" "$(@:"=).tmp" $@ -if exist "$(@:"=).tmp" del /f /q "$(@:"=).tmp" @@ -263,11 +269,15 @@ UnregisterShortcuts :: ###################################################################### PLAT=Win32 -PLAT_SUFFIX=32 +PLAT_SUFFIX=-x86 !INCLUDE "MakefilePlat.mak" PLAT=x64 -PLAT_SUFFIX=64 +PLAT_SUFFIX=-amd64 +!INCLUDE "MakefilePlat.mak" + +PLAT=ARM64 +PLAT_SUFFIX=-arm64 !INCLUDE "MakefilePlat.mak" diff --git a/MakefileLang.mak b/MakefileLang.mak index 029daad..a804f4d 100644 Binary files a/MakefileLang.mak and b/MakefileLang.mak differ diff --git a/Updater b/Updater index dc4cc1b..67124a8 160000 --- a/Updater +++ b/Updater @@ -1 +1 @@ -Subproject commit dc4cc1b22e46b376d273d420a50ea4d4c588ec3a +Subproject commit 67124a8434e253efdf423f1b4e5467b62fc674b7 diff --git a/ZRColaInstall/ZRColaInstall.props b/ZRColaInstall/ZRColaInstall.props index a016a6c..a39c463 100644 --- a/ZRColaInstall/ZRColaInstall.props +++ b/ZRColaInstall/ZRColaInstall.props @@ -7,19 +7,7 @@ ..\output\$(Platform).$(Configuration)\ - false - - - false - false - Default - false - - - true - - MultiThreadedDebug diff --git a/ZRColaInstall/main.cpp b/ZRColaInstall/main.cpp index 8213bf9..9fb9234 100644 --- a/ZRColaInstall/main.cpp +++ b/ZRColaInstall/main.cpp @@ -23,35 +23,47 @@ /// /// Main function /// -extern "C" void WinMainCRTStartup() +int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) { - // Load "KERNEL32.DLL". - HMODULE hKernel32 = LoadLibrary(TEXT("KERNEL32.DLL")); - if (!hKernel32) - ExitProcess(1); + UNREFERENCED_PARAMETER(hInstance); + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + UNREFERENCED_PARAMETER(nCmdShow); - // Get IsWow64Process() address. - BOOL (WINAPI *_IsWow64Process)(__in HANDLE hProcess, __out PBOOL Wow64Process) = (BOOL(WINAPI*)(__in HANDLE, __out PBOOL))::GetProcAddress(hKernel32, "IsWow64Process"); + TCHAR szArchProc[MAX_PATH]; + if (!GetEnvironmentVariable(TEXT("PROCESSOR_ARCHITECTURE"), szArchProc, _countof(szArchProc))) + szArchProc[0] = 0; + szArchProc[_countof(szArchProc) - 1] = 0; - BOOL bIs64Bit; -#ifndef _WIN64 - // Determine if this is a 32-bit process under Windows-over-Windows64. - if (_IsWow64Process) { - // See what IsWow64Process() says. - if (!_IsWow64Process(::GetCurrentProcess(), &bIs64Bit)) { - // IsWow64Process() returned an error. Assume not 64-bit Windows. - bIs64Bit = FALSE; - } - } else { - // This platform does not have IsWow64Process(). Therefore, this is definitely not 64-bit Windows. - bIs64Bit = FALSE; + TCHAR szArchWin[MAX_PATH]; + if (!GetEnvironmentVariable(TEXT("PROCESSOR_ARCHITEW6432"), szArchWin, _countof(szArchWin))) + szArchWin[0] = 0; + szArchWin[_countof(szArchWin) - 1] = 0; + + // If PROCESSOR_ARCHITEW6432 is defined, this is a Windows-on-Windows + // guest of some kind. szArchWin is the host's architecture and szArchProc + // is the current process' architecture. + + // If PROCESSOR_ARCHITEW6432 is not defined, then PROCESSOR_ARCHITECTURE + // is both the process and OS architecture. + if (szArchWin[0] == 0) + memcpy_s(szArchWin, sizeof(szArchWin), szArchProc, sizeof(szArchProc)); + + // If PROCESSOR_ARCHITECTURE is not defined, then either we're running on + // Windows 9x or something is messing with the environment. Make the + // Windows 9x assumption. + if (szArchProc[0] == 0) { + memcpy_s(szArchProc, sizeof(szArchProc), TEXT("x86"), sizeof(TEXT("x86"))); + memcpy_s(szArchWin , sizeof(szArchWin ), TEXT("x86"), sizeof(TEXT("x86"))); } -#else - // This is a running 64-bit process. The Windows must be 64 bit then. - bIs64Bit = TRUE; -#endif - FreeLibrary(hKernel32); + LPCTSTR pszPlatSuffix; + if (_tcsicmp(szArchWin, TEXT("amd64")) == 0) + pszPlatSuffix = TEXT("-amd64"); + else if (_tcsicmp(szArchWin, TEXT("arm64")) == 0) + pszPlatSuffix = TEXT("-arm64"); + else + pszPlatSuffix = TEXT("-x86"); // Get temporary folder path. static const LPTSTR pszTempFolderDefault = TEXT(""); @@ -74,7 +86,7 @@ extern "C" void WinMainCRTStartup() LPTSTR pszParams; DWORD_PTR aArgs[] = { (DWORD_PTR)TEXT(ZRCOLA_INSTALL_LANG), - (DWORD_PTR)(bIs64Bit ? TEXT("64") : TEXT("32")), + (DWORD_PTR)pszPlatSuffix, (DWORD_PTR)pszTempFolder, }; FormatMessage( diff --git a/ZRColaInstall/pch.h b/ZRColaInstall/pch.h index 4a43b0c..7fc33cb 100644 --- a/ZRColaInstall/pch.h +++ b/ZRColaInstall/pch.h @@ -20,3 +20,4 @@ #pragma once #include +#include diff --git a/include/MSIBuildCfg.mak b/include/MSIBuildCfg.mak index 7a601fb..cdf8feb 100644 Binary files a/include/MSIBuildCfg.mak and b/include/MSIBuildCfg.mak differ