mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: Fix failure to create Traveler Disk when VeraCrypt is installed using MSI
This commit is contained in:
@@ -4791,7 +4791,76 @@ BOOL CALLBACK TravelerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
|||||||
{
|
{
|
||||||
int fileNo = 0;
|
int fileNo = 0;
|
||||||
// get file from the Setup binary after checking its signature and its version
|
// get file from the Setup binary after checking its signature and its version
|
||||||
StringCbPrintfW (srcPath, sizeof(srcPath), L"%s\\VeraCrypt Setup.exe", appDir);
|
StringCbPrintfW (srcPath, sizeof(srcPath), L"%s\\VeraCrypt COMReg.exe", appDir); // MSI installation case
|
||||||
|
if (FileExists(srcPath))
|
||||||
|
{
|
||||||
|
// we copy only our binaries since we don't have those of the other platforms
|
||||||
|
|
||||||
|
// Main app
|
||||||
|
StringCbPrintfW (srcPath, sizeof(srcPath), L"%s\\VeraCrypt.exe", appDir);
|
||||||
|
StringCbPrintfW (dstPath, sizeof(dstPath), L"%s\\VeraCrypt\\VeraCrypt.exe", dstDir);
|
||||||
|
if (!VerifyModuleSignature (srcPath))
|
||||||
|
{
|
||||||
|
Error ("DIST_PACKAGE_CORRUPTED", hwndDlg);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
else if (!TCCopyFile (srcPath, dstPath))
|
||||||
|
{
|
||||||
|
handleWin32Error (hwndDlg, SRC_POS);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wizard
|
||||||
|
if (copyWizard)
|
||||||
|
{
|
||||||
|
StringCbPrintfW (srcPath, sizeof(srcPath), L"%s\\VeraCrypt Format.exe", appDir);
|
||||||
|
StringCbPrintfW (dstPath, sizeof(dstPath), L"%s\\VeraCrypt\\VeraCrypt Format.exe", dstDir);
|
||||||
|
if (!VerifyModuleSignature (srcPath))
|
||||||
|
{
|
||||||
|
Error ("DIST_PACKAGE_CORRUPTED", hwndDlg);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
else if (!TCCopyFile (srcPath, dstPath))
|
||||||
|
{
|
||||||
|
handleWin32Error (hwndDlg, SRC_POS);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expander
|
||||||
|
if (copyExpander)
|
||||||
|
{
|
||||||
|
StringCbPrintfW (srcPath, sizeof(srcPath), L"%s\\VeraCryptExpander.exe", appDir);
|
||||||
|
StringCbPrintfW (dstPath, sizeof(dstPath), L"%s\\VeraCrypt\\VeraCryptExpander.exe", dstDir);
|
||||||
|
if (!VerifyModuleSignature (srcPath))
|
||||||
|
{
|
||||||
|
Error ("DIST_PACKAGE_CORRUPTED", hwndDlg);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
else if (!TCCopyFile (srcPath, dstPath))
|
||||||
|
{
|
||||||
|
handleWin32Error (hwndDlg, SRC_POS);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Driver
|
||||||
|
StringCbPrintfW (srcPath, sizeof(srcPath), L"%s\\veracrypt.sys", appDir);
|
||||||
|
StringCbPrintfW (dstPath, sizeof(dstPath), L"%s\\VeraCrypt\\veracrypt.sys", dstDir);
|
||||||
|
if (!VerifyModuleSignature (srcPath))
|
||||||
|
{
|
||||||
|
Error ("DIST_PACKAGE_CORRUPTED", hwndDlg);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
else if (!TCCopyFile (srcPath, dstPath))
|
||||||
|
{
|
||||||
|
handleWin32Error (hwndDlg, SRC_POS);
|
||||||
|
goto stop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StringCbPrintfW (srcPath, sizeof(srcPath), L"%s\\VeraCrypt Setup.exe", appDir); // EXE installation case
|
||||||
|
|
||||||
FreeAllFileBuffers ();
|
FreeAllFileBuffers ();
|
||||||
|
|
||||||
@@ -4873,6 +4942,7 @@ BOOL CALLBACK TravelerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp (GetPreferredLangId (), "en") != 0)
|
if (strcmp (GetPreferredLangId (), "en") != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2743,6 +2743,13 @@ EXTERN_C UINT STDAPICALLTYPE VC_CustomAction_PostInstall(MSIHANDLE hInstaller)
|
|||||||
HANDLE h;
|
HANDLE h;
|
||||||
wchar_t szTmp[TC_MAX_PATH];
|
wchar_t szTmp[TC_MAX_PATH];
|
||||||
|
|
||||||
|
// delete "VeraCrypt Setup.exe" if it exists
|
||||||
|
StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szInstallDir.c_str(), L"VeraCrypt Setup.exe");
|
||||||
|
if (FileExists(szTmp))
|
||||||
|
{
|
||||||
|
ForceDeleteFile(szTmp);
|
||||||
|
}
|
||||||
|
|
||||||
StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szInstallDir.c_str(), L"VeraCrypt.exe");
|
StringCbPrintfW (szTmp, sizeof(szTmp), L"%s%s", szInstallDir.c_str(), L"VeraCrypt.exe");
|
||||||
|
|
||||||
if (Is64BitOs ())
|
if (Is64BitOs ())
|
||||||
|
|||||||
Reference in New Issue
Block a user