mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 19:38:26 -06:00
Window: add menu entry for launching VeraCryptExpander
This commit is contained in:
@@ -1055,6 +1055,28 @@ static void LaunchVolCreationWizard (HWND hwndDlg, const char *arg)
|
||||
}
|
||||
}
|
||||
|
||||
static void LaunchVolExpander (HWND hwndDlg)
|
||||
{
|
||||
char t[TC_MAX_PATH] = {'"',0};
|
||||
char *tmp;
|
||||
|
||||
GetModuleFileName (NULL, t+1, sizeof(t)-1);
|
||||
|
||||
tmp = strrchr (t, '\\');
|
||||
if (tmp)
|
||||
{
|
||||
*tmp = 0;
|
||||
StringCbCatA (t, sizeof(t), "\\VeraCryptExpander.exe\"");
|
||||
|
||||
if (!FileExists(t))
|
||||
Error ("VOL_EXPANDER_NOT_FOUND", hwndDlg); // Display a user-friendly error message and advise what to do
|
||||
else if (((int)ShellExecuteA (NULL, (!IsAdmin() && IsUacSupported()) ? "runas" : "open", t, NULL, NULL, SW_SHOW)) <= 32)
|
||||
{
|
||||
handleWin32Error (hwndDlg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Fills drive list
|
||||
// drive>0 = update only the corresponding drive subitems
|
||||
@@ -6433,6 +6455,12 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (lw == IDM_VOLUME_EXPANDER)
|
||||
{
|
||||
LaunchVolExpander (hwndDlg);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (lw == IDM_ADD_REMOVE_VOL_KEYFILES)
|
||||
{
|
||||
if (!VolumeSelected(hwndDlg))
|
||||
|
||||
Reference in New Issue
Block a user