From 302dc37fb9baa45c5864af533664c4139e209590 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 9 Feb 2022 22:37:22 +0100 Subject: Windows: Make Travel Disk contains 32-bit and arm64 binaries when VeraCrypt installed using MSI --- src/COMReg/COMReg.cpp | 30 ++++++++++ src/COMReg/COMReg.rc | 100 ++++++++++++++++++++++++++++++++ src/COMReg/COMReg.vcxproj | 119 ++++++++++++++++++++++++++++++++++++++ src/COMReg/COMReg.vcxproj.filters | 49 ++++++++++++++++ src/COMReg/COMReg.vcxproj.user | 7 +++ src/COMReg/Resource.h | 18 ++++++ 6 files changed, 323 insertions(+) create mode 100644 src/COMReg/COMReg.cpp create mode 100644 src/COMReg/COMReg.rc create mode 100644 src/COMReg/COMReg.vcxproj create mode 100644 src/COMReg/COMReg.vcxproj.filters create mode 100644 src/COMReg/COMReg.vcxproj.user create mode 100644 src/COMReg/Resource.h (limited to 'src/COMReg') diff --git a/src/COMReg/COMReg.cpp b/src/COMReg/COMReg.cpp new file mode 100644 index 00000000..d1f97492 --- /dev/null +++ b/src/COMReg/COMReg.cpp @@ -0,0 +1,30 @@ +#include "Tcdefs.h" +#include +#include "SelfExtract.h" + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + wchar_t SetupFilesDir[TC_MAX_PATH]; + wchar_t *s; + UNREFERENCED_PARAMETER(hInstance); + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(nCmdShow); + + if (lpCmdLine[0] == L'/' && lpCmdLine[1] == L'p') + { + MessageBox(NULL, L"",L"",0); + SelfExtractStartupInit(); + GetModuleFileName (NULL, SetupFilesDir, ARRAYSIZE (SetupFilesDir)); + s = wcsrchr (SetupFilesDir, L'\\'); + if (s) + s[1] = 0; + + /* Create self-extracting package */ + MakeSelfExtractingPackage (NULL, SetupFilesDir, TRUE); + } + + return 0; +} diff --git a/src/COMReg/COMReg.rc b/src/COMReg/COMReg.rc new file mode 100644 index 00000000..0fd3f44d --- /dev/null +++ b/src/COMReg/COMReg.rc @@ -0,0 +1,100 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,25,8,1 + PRODUCTVERSION 1,25,8,1 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "IDRIX" + VALUE "FileDescription", "VeraCrypt COMReg" + VALUE "FileVersion", "1.25" + VALUE "LegalTrademarks", "VeraCrypt" + VALUE "OriginalFilename", "VeraCrypt COMReg.exe" + VALUE "ProductName", "VeraCrypt" + VALUE "ProductVersion", "1.25" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_COMREG REGISTRY "..\Setup\ComSetup.rgs" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_COMREG ICON "..\Setup\Setup.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "#include ""..\\\\common\\\\resource.h""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// diff --git a/src/COMReg/COMReg.vcxproj b/src/COMReg/COMReg.vcxproj new file mode 100644 index 00000000..91a440e1 --- /dev/null +++ b/src/COMReg/COMReg.vcxproj @@ -0,0 +1,119 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {C8914211-32AC-4F48-ACD9-8212E8DE53F3} + Win32Proj + COMReg + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + VeraCryptCOMRegBase + Debug\ + Debug\ + + + false + VeraCryptCOMRegBase + Release\ + Release\ + + + + NotUsing + Level3 + Disabled + WIN32;VC_COMREG;_DEBUG;_WINDOWS;HAVE_CONFIG_H;ZIP_STATIC;%(PreprocessorDefinitions) + MultiThreadedDebug + ..\Setup;..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories) + + + Windows + true + ..\Common\Debug\Zip.lib;..\Crypto\Debug\crypto.lib;..\Common\Debug\lzma.lib;%(AdditionalDependencies) + + + copy Debug\VeraCryptCOMRegBase.exe "..\Debug\Setup Files\VeraCryptCOMRegBase.exe" + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;VC_COMREG;NDEBUG;_WINDOWS;HAVE_CONFIG_H;ZIP_STATIC;%(PreprocessorDefinitions) + MultiThreaded + ..\Setup;..\Common;..\Crypto;..\;..\PKCS11;..\Common\zlib;..\Common\libzip;..\Common\lzma;%(AdditionalIncludeDirectories) + + + Windows + false + true + true + ..\Common\Release\Zip.lib;..\Crypto\Release\crypto.lib;..\Common\Release\lzma.lib;%(AdditionalDependencies) + + + copy Release\VeraCryptCOMRegBase.exe "..\Release\Setup Files\VeraCryptCOMRegBase.exe" + + + + + + CompileAsCpp + CompileAsCpp + + + Default + + + + + + + + + + + + + + {b896fe1f-6bf3-4f75-9148-f841829073d9} + + + + + + \ No newline at end of file diff --git a/src/COMReg/COMReg.vcxproj.filters b/src/COMReg/COMReg.vcxproj.filters new file mode 100644 index 00000000..cc5c60a3 --- /dev/null +++ b/src/COMReg/COMReg.vcxproj.filters @@ -0,0 +1,49 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {453a6bf1-2afd-4016-8b8f-e3821a6c8ab5} + + + {efcd999c-3973-4bd6-af14-0583669e6722} + + + + + Source Files + + + Source Files + + + Source Files\Common + + + Source Files\Common + + + + + Resource Files + + + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/src/COMReg/COMReg.vcxproj.user b/src/COMReg/COMReg.vcxproj.user new file mode 100644 index 00000000..deea718b --- /dev/null +++ b/src/COMReg/COMReg.vcxproj.user @@ -0,0 +1,7 @@ + + + + $(TargetPath) + WindowsLocalDebugger + + \ No newline at end of file diff --git a/src/COMReg/Resource.h b/src/COMReg/Resource.h new file mode 100644 index 00000000..14901ce6 --- /dev/null +++ b/src/COMReg/Resource.h @@ -0,0 +1,18 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by COMReg.rc +// +#define IDR_COMREG 10 +#define IDI_COMREG 11 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 12 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif -- cgit v1.2.3