diff options
Diffstat (limited to 'C/Util/7zipInstall')
| -rw-r--r-- | C/Util/7zipInstall/7zipInstall.c | 32 | ||||
| -rw-r--r-- | C/Util/7zipInstall/Precomp.h | 13 | ||||
| -rw-r--r-- | C/Util/7zipInstall/makefile | 9 | ||||
| -rw-r--r-- | C/Util/7zipInstall/resource.rc | 5 |
4 files changed, 31 insertions, 28 deletions
diff --git a/C/Util/7zipInstall/7zipInstall.c b/C/Util/7zipInstall/7zipInstall.c index 7f5fd19..7d8e8c4 100644 --- a/C/Util/7zipInstall/7zipInstall.c +++ b/C/Util/7zipInstall/7zipInstall.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* 7zipInstall.c - 7-Zip Installer | 1 | /* 7zipInstall.c - 7-Zip Installer |
| 2 | 2023-04-04 : Igor Pavlov : Public domain */ | 2 | 2024-04-05 : Igor Pavlov : Public domain */ |
| 3 | 3 | ||
| 4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
| 5 | 5 | ||
| @@ -11,6 +11,8 @@ | |||
| 11 | #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union | 11 | #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union |
| 12 | #endif | 12 | #endif |
| 13 | 13 | ||
| 14 | Z7_DIAGNOSTIC_IGNORE_CAST_FUNCTION | ||
| 15 | |||
| 14 | #ifdef Z7_OLD_WIN_SDK | 16 | #ifdef Z7_OLD_WIN_SDK |
| 15 | struct IShellView; | 17 | struct IShellView; |
| 16 | #define SHFOLDERAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE | 18 | #define SHFOLDERAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE |
| @@ -41,16 +43,6 @@ typedef enum { | |||
| 41 | // #pragma GCC diagnostic ignored "-Wcast-function-type" | 43 | // #pragma GCC diagnostic ignored "-Wcast-function-type" |
| 42 | #endif | 44 | #endif |
| 43 | 45 | ||
| 44 | #if defined(__clang__) || defined(__GNUC__) | ||
| 45 | typedef void (*Z7_voidFunction)(void); | ||
| 46 | #define MY_CAST_FUNC (Z7_voidFunction) | ||
| 47 | #elif defined(_MSC_VER) && _MSC_VER > 1920 | ||
| 48 | #define MY_CAST_FUNC (void *) | ||
| 49 | // #pragma warning(disable : 4191) // 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)()' | ||
| 50 | #else | ||
| 51 | #define MY_CAST_FUNC | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #define LLL_(quote) L##quote | 46 | #define LLL_(quote) L##quote |
| 55 | #define LLL(quote) LLL_(quote) | 47 | #define LLL(quote) LLL_(quote) |
| 56 | 48 | ||
| @@ -118,11 +110,13 @@ static LPCWSTR const k_Reg_Path32 = L"Path" | |||
| 118 | #define k_Reg_WOW_Flag 0 | 110 | #define k_Reg_WOW_Flag 0 |
| 119 | #endif | 111 | #endif |
| 120 | 112 | ||
| 113 | #ifdef USE_7ZIP_32_DLL | ||
| 121 | #ifdef _WIN64 | 114 | #ifdef _WIN64 |
| 122 | #define k_Reg_WOW_Flag_32 KEY_WOW64_32KEY | 115 | #define k_Reg_WOW_Flag_32 KEY_WOW64_32KEY |
| 123 | #else | 116 | #else |
| 124 | #define k_Reg_WOW_Flag_32 0 | 117 | #define k_Reg_WOW_Flag_32 0 |
| 125 | #endif | 118 | #endif |
| 119 | #endif | ||
| 126 | 120 | ||
| 127 | #define k_7zip_CLSID L"{23170F69-40C1-278A-1000-000100020000}" | 121 | #define k_7zip_CLSID L"{23170F69-40C1-278A-1000-000100020000}" |
| 128 | 122 | ||
| @@ -219,11 +213,11 @@ static DWORD GetFileVersion(LPCWSTR s) | |||
| 219 | return 0; | 213 | return 0; |
| 220 | } | 214 | } |
| 221 | 215 | ||
| 222 | my_GetFileVersionInfoSizeW = (Func_GetFileVersionInfoSizeW) MY_CAST_FUNC GetProcAddress(g_version_dll_hModule, | 216 | my_GetFileVersionInfoSizeW = (Func_GetFileVersionInfoSizeW) Z7_CAST_FUNC_C GetProcAddress(g_version_dll_hModule, |
| 223 | "GetFileVersionInfoSizeW"); | 217 | "GetFileVersionInfoSizeW"); |
| 224 | my_GetFileVersionInfoW = (Func_GetFileVersionInfoW) MY_CAST_FUNC GetProcAddress(g_version_dll_hModule, | 218 | my_GetFileVersionInfoW = (Func_GetFileVersionInfoW) Z7_CAST_FUNC_C GetProcAddress(g_version_dll_hModule, |
| 225 | "GetFileVersionInfoW"); | 219 | "GetFileVersionInfoW"); |
| 226 | my_VerQueryValueW = (Func_VerQueryValueW) MY_CAST_FUNC GetProcAddress(g_version_dll_hModule, | 220 | my_VerQueryValueW = (Func_VerQueryValueW) Z7_CAST_FUNC_C GetProcAddress(g_version_dll_hModule, |
| 227 | "VerQueryValueW"); | 221 | "VerQueryValueW"); |
| 228 | 222 | ||
| 229 | if (!my_GetFileVersionInfoSizeW | 223 | if (!my_GetFileVersionInfoSizeW |
| @@ -1102,7 +1096,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1102 | { | 1096 | { |
| 1103 | BOOL isWow64 = FALSE; | 1097 | BOOL isWow64 = FALSE; |
| 1104 | const Func_IsWow64Process func_IsWow64Process = (Func_IsWow64Process) | 1098 | const Func_IsWow64Process func_IsWow64Process = (Func_IsWow64Process) |
| 1105 | MY_CAST_FUNC GetProcAddress(GetModuleHandleW(L"kernel32.dll"), | 1099 | Z7_CAST_FUNC_C GetProcAddress(GetModuleHandleW(L"kernel32.dll"), |
| 1106 | "IsWow64Process"); | 1100 | "IsWow64Process"); |
| 1107 | 1101 | ||
| 1108 | if (func_IsWow64Process) | 1102 | if (func_IsWow64Process) |
| @@ -1111,7 +1105,13 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1111 | if (!isWow64) | 1105 | if (!isWow64) |
| 1112 | { | 1106 | { |
| 1113 | if (!g_SilentMode) | 1107 | if (!g_SilentMode) |
| 1114 | PrintErrorMessage("This installation requires Windows " MY_CPU_NAME, NULL); | 1108 | PrintErrorMessage("This installation requires Windows " |
| 1109 | #ifdef MY_CPU_X86_OR_AMD64 | ||
| 1110 | "x64" | ||
| 1111 | #else | ||
| 1112 | "64-bit" | ||
| 1113 | #endif | ||
| 1114 | , NULL); | ||
| 1115 | return 1; | 1115 | return 1; |
| 1116 | } | 1116 | } |
| 1117 | } | 1117 | } |
diff --git a/C/Util/7zipInstall/Precomp.h b/C/Util/7zipInstall/Precomp.h index bc8fa21..13a41ef 100644 --- a/C/Util/7zipInstall/Precomp.h +++ b/C/Util/7zipInstall/Precomp.h | |||
| @@ -1,14 +1,13 @@ | |||
| 1 | /* Precomp.h -- StdAfx | 1 | /* Precomp.h -- Precomp |
| 2 | 2023-03-04 : Igor Pavlov : Public domain */ | 2 | 2024-01-23 : Igor Pavlov : Public domain */ |
| 3 | 3 | ||
| 4 | #ifndef ZIP7_INC_PRECOMP_H | 4 | // #ifndef ZIP7_INC_PRECOMP_LOC_H |
| 5 | #define ZIP7_INC_PRECOMP_H | 5 | // #define ZIP7_INC_PRECOMP_LOC_H |
| 6 | 6 | ||
| 7 | #if defined(_MSC_VER) && _MSC_VER >= 1800 | 7 | #if defined(_MSC_VER) && _MSC_VER >= 1800 |
| 8 | #pragma warning(disable : 4464) // relative include path contains '..' | 8 | #pragma warning(disable : 4464) // relative include path contains '..' |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include "../../Compiler.h" | 11 | #include "../../Precomp.h" |
| 12 | #include "../../7zTypes.h" | ||
| 13 | 12 | ||
| 14 | #endif | 13 | // #endif |
diff --git a/C/Util/7zipInstall/makefile b/C/Util/7zipInstall/makefile index 18e2783..424bd6c 100644 --- a/C/Util/7zipInstall/makefile +++ b/C/Util/7zipInstall/makefile | |||
| @@ -19,9 +19,6 @@ C_OBJS = \ | |||
| 19 | $O\7zAlloc.obj \ | 19 | $O\7zAlloc.obj \ |
| 20 | $O\7zArcIn.obj \ | 20 | $O\7zArcIn.obj \ |
| 21 | $O\7zBuf.obj \ | 21 | $O\7zBuf.obj \ |
| 22 | $O\7zBuf2.obj \ | ||
| 23 | $O\7zCrc.obj \ | ||
| 24 | $O\7zCrcOpt.obj \ | ||
| 25 | $O\7zFile.obj \ | 22 | $O\7zFile.obj \ |
| 26 | $O\7zDec.obj \ | 23 | $O\7zDec.obj \ |
| 27 | $O\7zStream.obj \ | 24 | $O\7zStream.obj \ |
| @@ -34,11 +31,17 @@ C_OBJS = \ | |||
| 34 | OBJS = \ | 31 | OBJS = \ |
| 35 | $(MAIN_OBJS) \ | 32 | $(MAIN_OBJS) \ |
| 36 | $(C_OBJS) \ | 33 | $(C_OBJS) \ |
| 34 | $(ASM_OBJS) \ | ||
| 37 | $O\resource.res | 35 | $O\resource.res |
| 38 | 36 | ||
| 37 | !include "../../../CPP/7zip/Crc.mak" | ||
| 38 | # !include "../../../CPP/7zip/LzmaDec.mak" | ||
| 39 | |||
| 39 | !include "../../../CPP/Build.mak" | 40 | !include "../../../CPP/Build.mak" |
| 40 | 41 | ||
| 41 | $(MAIN_OBJS): $(*B).c | 42 | $(MAIN_OBJS): $(*B).c |
| 42 | $(COMPL_O1) | 43 | $(COMPL_O1) |
| 43 | $(C_OBJS): ../../$(*B).c | 44 | $(C_OBJS): ../../$(*B).c |
| 44 | $(COMPL_O1) | 45 | $(COMPL_O1) |
| 46 | |||
| 47 | !include "../../Asm_c.mak" | ||
diff --git a/C/Util/7zipInstall/resource.rc b/C/Util/7zipInstall/resource.rc index df6474e..40ed580 100644 --- a/C/Util/7zipInstall/resource.rc +++ b/C/Util/7zipInstall/resource.rc | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #include <winnt.h> | 1 | #include <windows.h> |
| 2 | #include <WinUser.h> | 2 | // #include <winnt.h> |
| 3 | // #include <WinUser.h> | ||
| 3 | #include <CommCtrl.h> | 4 | #include <CommCtrl.h> |
| 4 | 5 | ||
| 5 | #define USE_COPYRIGHT_CR | 6 | #define USE_COPYRIGHT_CR |
