VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Setup
AgeCommit message (Collapse)AuthorFilesLines
2016-02-20Windows: Correctly remove driver file veracrypt.sys during uninstall on ↵Mounir IDRASSI1-15/+33
Windows 64-bit. Implement deleting locked files after machine reboot.
2016-02-14MacOSX: increment installer version to 1.17.Mounir IDRASSI1-2/+2
2016-02-14Increment version to 1.17. Update user guide PDF file.Mounir IDRASSI1-4/+4
2016-02-07Windows:Fix various issues and warnings reported by static code analysis ↵Mounir IDRASSI2-6/+16
tool Coverity.
2016-01-31Windows: Fix link issue in Debug configuration for Setup project.Mounir IDRASSI1-1/+1
2016-01-27Windows/Linux: Implement exFAT support.Mounir IDRASSI1-1/+3
2016-01-20Copyright: update dates to include 2016.Mounir IDRASSI11-11/+11
2016-01-10Windows: Don't show disconnected network drives in the list of available ↵Mounir IDRASSI1-3/+4
drives. Add option to make them available for mounting if needed.
2016-01-04Windows: Enhance fix for dll hijacking vulnerability affecting installer ↵Mounir IDRASSI1-0/+2
(CVE-2016-1281)
2016-01-03Windows: Fix Dll hijacking vulnerability affecting installer that allows ↵Mounir IDRASSI2-10/+23
arbitrary code execution with elevation of privilege (CVE-2016-1281)
2015-12-06MacOSX: Customize dmg file using VeraCrypt new logoMounir IDRASSI1-0/+0
2015-12-05Windows: use new icons an graphics contributed by Andreas Becker ↵Mounir IDRASSI2-0/+0
(https://github.com/veracrypt/VeraCrypt/issues/9#issuecomment-118353850)
2015-11-26Windows: solve crash caused by system function FormatMessage failure on rare ↵Mounir IDRASSI1-4/+13
cases.
2015-11-26Windows: Full UNICODE rewrite and implement support for UNICODE passwords.Mounir IDRASSI10-688/+632
2015-10-27Windows: workaround to solve false positive detection by some anti-virus ↵Mounir IDRASSI1-1/+3
software.
2015-10-07Increment version to 1.16. Update user guide PDF file.VeraCrypt_1.16Mounir IDRASSI2-6/+6
2015-09-26Increment version to 1.15. Update user guide PDF file.VeraCrypt_1.15Mounir IDRASSI2-6/+6
2015-09-26Windows Installer: check newly added files if they are used before resuming ↵Mounir IDRASSI1-1/+8
installation. Avoid using driver handle to check if we are using system encryption.
2015-09-16Increment version to 1.14. Update user guide PDF file.VeraCrypt_1.14Mounir IDRASSI2-6/+6
2015-09-10Windows: Don't offer creating a restore point if it is disabled in Windows.Mounir IDRASSI1-5/+43
2015-09-06Windows: Installer and Traveler Disk Setup both always copy 32-bit and ↵Mounir IDRASSI2-0/+36
64-bit executable binaries.
2015-09-06Windows Installer: better handling for updating system favorite service from ↵Mounir IDRASSI1-24/+91
1.0f-2 (solve Windows 10 issue) . Remove extra VeraCrypt files that may remain after uninstalling it.
2015-08-09Increment version to 1.13VeraCrypt_1.13Mounir IDRASSI2-6/+6
2015-08-06Linux: Correct formating of license displayed in the installerMounir IDRASSI1-24/+24
2015-08-06Increment version to 1.12. Update user guide PDF file.Mounir IDRASSI2-6/+6
2015-08-06Update license information to reflect the use of a dual license Apache 2.0 ↵Mounir IDRASSI11-69/+291
and TrueCrypt 3.0.
2015-07-13Windows: on 64-bit Windows, more System favorite service from SysWoW64 to ↵Mounir IDRASSI1-1/+40
System32 since now all binaries are native 64-bit on 64-bit machines.
2015-07-06Windows: Display source location of errors in order to help diagnose issues ↵Mounir IDRASSI2-15/+19
reported by users
2015-07-03Windows: Explicitly use internal PKCS#11 headers for buildingMounir IDRASSI1-2/+2
2015-06-12Windows installer: solve Windows XP 32-bit incompatibility issue introduced ↵Mounir IDRASSI1-3/+21
previously.
2015-06-10Windows: solve installer issue on Windows 10 caused by failure to overwrite ↵Mounir IDRASSI3-21/+32
VeraCrypt driver file.
2015-05-22Windows Setup: Integrate 64-bit builds of exe files into the installer. Only ↵Mounir IDRASSI2-5/+26
install 64-bit exe files on Windows 64-bit. This gives a boot in performance for encryption/decryption of partitions/drives on Windows 64-bit.
2015-05-22Windows: remove crash dump analysis functionality. It didn't always work and ↵Mounir IDRASSI1-1/+3
it required external debugging tools.
2015-05-03Windows: Modify custom window class names to less generic value in order to ↵Mounir IDRASSI1-2/+2
avoid collision with existing class names.
2015-04-19Linux installer: Add support for kdesudo and correct usage of konsole ↵Mounir IDRASSI1-2/+3
external call.
2015-04-06MacOSX: Set properly the version in the bundle and the installation package. ↵VeraCrypt_1.0f-2Mounir IDRASSI1-1/+3
Allow downgrading using older installers.
2015-04-06Increment VeraCrypt version to 1.0f-2Mounir IDRASSI2-5/+5
2015-04-05Windows Setup: Avoid potential issues by correctly initializing variables ↵Mounir IDRASSI1-13/+13
and checking memory allocation.
2015-03-17Windows Setup: When clicking uninstall link, launch Windows Add/Remove ↵Mounir IDRASSI1-6/+15
program instead of uninstall directly in order to avoid being flagged as legacy application by the Windows Program Compatibility Assistant (see number 5 in Microsoft UI Design Standard https://msdn.microsoft.com/en-us/library/ms954377.aspx)
2015-03-16Windows Setup: remove other VeraCrypt references for registry.Mounir IDRASSI1-0/+6
2015-03-15Windows Setup: implement removal of special LEGACY_VERACRYPT registry keys.Mounir IDRASSI1-60/+258
2015-03-13Windows: VeraCrypt reference from various registry locations. Uninstall old ↵Mounir IDRASSI2-2/+123
VeraCrypt COM interfaces that were left after upgrading.
2015-02-16Windows Installer: don't add link to VeraCryptExpander in the desktop.Mounir IDRASSI1-8/+0
2015-02-13Windows: Add VeraCryptExpander.exe to the Windows installer.Mounir IDRASSI2-0/+17
2015-02-11Linux: modify installer script to make it run when the "less" command ↵Mounir IDRASSI1-3/+23
doesn't support the -X argument (Busybox case)
2015-02-10Linux: Add graphical installer support when xterm is not available (Linux ↵Mounir IDRASSI1-4/+36
Mint case)
2015-02-09Static Code Analysis: check return of remove function and display message ↵Mounir IDRASSI1-22/+45
when it fails.
2015-02-09Static Code Analysis: Avoid over-flaw in arithmetic operations by adding ↵Mounir IDRASSI2-25/+27
more checks. Add extra checks. Solve various issues.
2015-02-08Windows Setup: implement removal of non-empty directories to avoid errors ↵Mounir IDRASSI1-1/+19
during uninstall.
2015-01-04Increment version to 1.0f-1 and update language files and PDF with ↵Mounir IDRASSI2-5/+5
information about TrueCrypt 6.0 support.
lass="kt">char *LanguageFileBuffer = NULL; static HANDLE LanguageFileFindHandle = INVALID_HANDLE_VALUE; static char PreferredLangId[6] = {0}; static char *LanguageResource = NULL; static DWORD LanguageResourceSize = 0; static char *HeaderResource[2] = {NULL, NULL}; static DWORD HeaderResourceSize[2] = {0, 0}; static char ActiveLangPackVersion[6] = {0}; static char *MapFirstLanguageFile () { if (LanguageFileFindHandle != INVALID_HANDLE_VALUE) { FindClose (LanguageFileFindHandle); LanguageFileFindHandle = INVALID_HANDLE_VALUE; } if (LanguageFileBuffer != NULL) { free (LanguageFileBuffer); LanguageFileBuffer = NULL; } if (LanguageResource == NULL) { DWORD size; LanguageResource = MapResource (L"Xml", IDR_LANGUAGE, &size); if (LanguageResource) LanguageResourceSize = size; } if (LanguageResource) { LanguageFileBuffer = malloc(LanguageResourceSize + 1); if (LanguageFileBuffer) { memcpy (LanguageFileBuffer, LanguageResource, LanguageResourceSize); LanguageFileBuffer[LanguageResourceSize] = 0; } } return LanguageFileBuffer; } static char *MapNextLanguageFile () { wchar_t f[TC_MAX_PATH*2], *t; WIN32_FIND_DATAW find; HANDLE file; DWORD read; BOOL bStatus; /* free memory here to avoid leaks */ if (LanguageFileBuffer != NULL) { free (LanguageFileBuffer); LanguageFileBuffer = NULL; } if (LanguageFileFindHandle == INVALID_HANDLE_VALUE) { GetModuleFileNameW (NULL, f, sizeof (f) / sizeof (f[0])); t = wcsrchr (f, L'\\'); if (t == NULL) return NULL; *t = 0; StringCbCatW (f, sizeof(f), L"\\Language*.xml"); LanguageFileFindHandle = FindFirstFileW (f, &find); } else if (!FindNextFileW (LanguageFileFindHandle, &find)) { FindClose (LanguageFileFindHandle); LanguageFileFindHandle = INVALID_HANDLE_VALUE; return NULL; } if (LanguageFileFindHandle == INVALID_HANDLE_VALUE) return NULL; if (find.nFileSizeHigh != 0) return NULL; LanguageFileBuffer = malloc(find.nFileSizeLow + 1); if (LanguageFileBuffer == NULL) return NULL; GetModuleFileNameW (NULL, f, sizeof (f) / sizeof(f[0])); t = wcsrchr (f, L'\\'); if (t == NULL) { free(LanguageFileBuffer); LanguageFileBuffer = NULL; return NULL; } t[1] = 0; StringCbCatW (f, sizeof(f),find.cFileName); file = CreateFileW (f, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); if (file == INVALID_HANDLE_VALUE) { free(LanguageFileBuffer); LanguageFileBuffer = NULL; return NULL; } bStatus = ReadFile (file, LanguageFileBuffer, find.nFileSizeLow, &read, NULL); CloseHandle (file); if (!bStatus || (read != find.nFileSizeLow)) { free(LanguageFileBuffer); LanguageFileBuffer = NULL; return NULL; } LanguageFileBuffer [find.nFileSizeLow] = 0; // we have allocated (find.nFileSizeLow + 1) bytes return LanguageFileBuffer; } BOOL LoadLanguageFile () { DWORD size; BYTE *res; char *xml, *header, *headerPtr; char langId[6] = "en", attr[32768], key[128]; BOOL defaultLangParsed = FALSE, langFound = FALSE; WCHAR wattr[32768]; int i, intKey, len; char *xmlElements[] = {"control", "string", 0}; #ifdef TCMOUNT int headers[] = { IDR_COMMON_RSRC_HEADER, IDR_MOUNT_RSRC_HEADER, 0 }; #endif #ifdef VOLFORMAT int headers[] = { IDR_COMMON_RSRC_HEADER, IDR_FORMAT_RSRC_HEADER, 0 }; #endif #ifdef SETUP int headers[] = { IDR_COMMON_RSRC_HEADER, IDR_SETUP_RSRC_HEADER, 0 }; #endif LocalizationActive = FALSE; ActiveLangPackVersion[0] = 0; ClearDictionaryPool (); if (PreferredLangId[0] != 0) StringCbCopyA (langId, sizeof(langId), PreferredLangId); // Parse all available language files until preferred language is found for (res = MapFirstLanguageFile (); res != NULL; res = MapNextLanguageFile ()) { xml = (char *) res; xml = XmlFindElement (xml, "localization"); if (!xml) continue; // Required TrueCrypt version XmlGetAttributeText (xml, "prog-version", attr, sizeof (attr)); // Check version of external language file if (defaultLangParsed && strcmp (attr, VERSION_STRING) && strcmp (attr, "DEBUG")) { wchar_t m[2048]; StringCbPrintfW (m, sizeof(m), L"The installed language pack is incompatible with this version of VeraCrypt (the language pack is for VeraCrypt %hs). A newer version may be available at www.idrix.fr.\n\nTo prevent this message from being displayed, do any of the following:\n\n- Select 'Settings' > 'Language'; then select 'English' and click 'OK'.\n\n- Remove or replace the language pack with a compatible version (the language pack may reside e.g. in 'C:\\Program Files\\VeraCrypt' or '%%LOCALAPPDATA%%\\VirtualStore\\Program Files\\VeraCrypt', etc.)", attr); MessageBoxW (NULL, m, L"VeraCrypt", MB_ICONERROR); continue; } // Search language id in language file if (defaultLangParsed) { while (xml = XmlFindElement (xml, "language")) { XmlGetAttributeText (xml, "langid", attr, sizeof (attr)); if (strcmp (attr, langId) == 0) { XmlGetAttributeText (xml++, "version", ActiveLangPackVersion, sizeof (ActiveLangPackVersion)); langFound = TRUE; break; } xml++; } if (!langFound) continue; } // Create font dictionary xml = (char *) res; while (xml = XmlFindElement (xml, "font")) { XmlGetAttributeText (xml, "lang", attr, sizeof (attr)); if (!defaultLangParsed || strcmp (attr, langId) == 0) { Font font; memset (&font, 0, sizeof (font)); XmlGetAttributeText (xml, "face", attr, sizeof (attr)); len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0])); font.FaceName = AddPoolData ((void *) wattr, len * 2); XmlGetAttributeText (xml, "size", attr, sizeof (attr)); sscanf (attr, "%d", &font.Size); StringCbCopyA (attr, sizeof(attr), "font_"); XmlGetAttributeText (xml, "class", attr + 5, sizeof (attr) - 5); AddDictionaryEntry ( AddPoolData ((void *) attr, strlen (attr) + 1), 0, AddPoolData ((void *) &font, sizeof(font))); } xml++; } // Create string and control dictionaries for (i = 0; xmlElements[i] != 0; i++) { xml = (char *) res; while (xml = XmlFindElement (xml, xmlElements[i])) { void *key; void *text; XmlGetAttributeText (xml, "lang", attr, sizeof (attr)); if (!defaultLangParsed || strcmp (attr, langId) == 0) { if (XmlGetAttributeText (xml, "key", attr, sizeof (attr))) { key = AddPoolData (attr, strlen (attr) + 1); if (key == NULL) return FALSE; XmlGetNodeText (xml, attr, sizeof (attr)); // Parse \ escape sequences { char *in = attr, *out = attr; while (*in) { if (*in == '\\') { in++; switch (*in++) { case '\\': *out++ = '\\'; break; case 't': *out++ = '\t'; break; case 'n': *out++ = 13; *out++ = 10; break; default: MessageBoxA (0, key, "VeraCrypt: Unknown '\\' escape sequence in string", MB_ICONERROR); return FALSE; } } else *out++ = *in++; } *out = 0; } // UTF8 => wide char len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0])); if (len == 0) { MessageBoxA (0, key, "VeraCrypt: Error while decoding UTF-8 string", MB_ICONERROR); return FALSE; } // Add to dictionary text = AddPoolData ((void *) wattr, len * 2); if (text == NULL) return FALSE; AddDictionaryEntry ((char *) key, 0, text); } } xml++; } } if (langFound) break; if (!defaultLangParsed) { defaultLangParsed = TRUE; if (langId[0] == 0 || strcmp (langId, "en") == 0) break; } } LocalizationActive = langFound && strcmp (langId, "en") != 0; LocalizationSerialNo++; // Create control ID dictionary // Default controls AddDictionaryEntry (NULL, 1, GetString ("IDOK")); AddDictionaryEntry (NULL, 2, GetString ("IDCANCEL")); AddDictionaryEntry (NULL, 8, GetString ("IDCLOSE")); AddDictionaryEntry (NULL, 9, GetString ("IDHELP")); for (i = 0; headers[i] != 0; i++) { if (HeaderResource[i] == NULL) { HeaderResource[i] = MapResource (L"Header", headers[i], &size); if (HeaderResource[i]) HeaderResourceSize[i] = size; } headerPtr = NULL; if (HeaderResource[i]) { headerPtr = (char*) malloc (HeaderResourceSize[i] + 1); if (headerPtr) { memcpy (headerPtr, HeaderResource[i], HeaderResourceSize[i]); headerPtr [HeaderResourceSize[i]] = 0; } } header = headerPtr; if (header == NULL) return FALSE; header--; do { header++; if (sscanf (header, "#define %127s %d", key, &intKey) == 2) { WCHAR *str = GetString (key); if (str != UnknownString) AddDictionaryEntry (NULL, intKey, str); } } while ((header = strchr (header, '\n')) != NULL); free (headerPtr); } return TRUE; } // lParam = 1: auto mode BOOL CALLBACK LanguageDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { WORD lw = LOWORD (wParam); WORD hw = HIWORD (wParam); switch (msg) { case WM_INITDIALOG: { char *xml; char attr[2048], lastLangId[10]; WCHAR wattr[2048]; int len; int langCount = 0; BOOL defaultLangFound = FALSE; LocalizeDialog (hwndDlg, "IDD_LANGUAGE"); ToHyperlink (hwndDlg, IDC_GET_LANG_PACKS); for (xml = MapFirstLanguageFile (); xml != NULL; xml = MapNextLanguageFile ()) { while (xml = XmlFindElement (xml, "language")) { XmlGetAttributeText (xml, "name", attr, sizeof (attr)); len = MultiByteToWideChar (CP_UTF8, 0, attr, -1, wattr, sizeof (wattr) / sizeof(wattr[0])); if (len != 0 && (!defaultLangFound || wcscmp (wattr, L"English") != 0)) { int i = (int) SendDlgItemMessageW (hwndDlg, IDC_LANGLIST, LB_ADDSTRING, 0, (LPARAM)wattr); if (i >= 0) { int id; // Encode language id in LPARAM XmlGetAttributeText (xml, "langid", attr, sizeof (attr)); switch (strlen (attr)) { case 2: id = attr[0] | attr[1] << 8; break; case 5: id = attr[0] | attr[1] << 8 | attr[3] << 16 | attr[4] << 24; break; default: continue; } if (!defaultLangFound) defaultLangFound = TRUE; SendDlgItemMessage (hwndDlg, IDC_LANGLIST, LB_SETITEMDATA, i, (LPARAM) id); if (strcmp (attr, PreferredLangId) == 0) { char credits [10000]; WCHAR wcredits [10000]; WCHAR wversion [20]; wchar_t szVers [200]; int nLen; SendDlgItemMessage (hwndDlg, IDC_LANGLIST, LB_SETCURSEL, i, 0); // Language pack version if (!ActiveLangPackVersion[0] || memcmp (ActiveLangPackVersion, "0.0.0", 5) == 0) { StringCbPrintfW (szVers, sizeof(szVers), GetString("LANG_PACK_VERSION"), L"--"); } else { nLen = MultiByteToWideChar (CP_UTF8, 0, ActiveLangPackVersion, -1, wversion, sizeof (wversion) / sizeof(wversion[0])); if (nLen != 0) StringCbPrintfW (szVers, sizeof(szVers),GetString("LANG_PACK_VERSION"), wversion); } SetWindowTextW (GetDlgItem (hwndDlg, IDC_LANGPACK_VERSION), szVers); // Translator credits XmlGetAttributeText (xml, "translators", credits, sizeof (credits)); nLen = MultiByteToWideChar (CP_UTF8, 0, credits, -1, wcredits, sizeof (wcredits) / sizeof(wcredits[0])); if (nLen != 0) { SetWindowTextW (GetDlgItem (hwndDlg, IDC_LANGPACK_CREDITS), wcredits); } } StringCbCopyA (lastLangId, sizeof(lastLangId),attr); langCount++; } } xml++; } } if (lParam == 1) { // Auto mode if (langCount < 2) EndDialog (hwndDlg, IDCANCEL); if (langCount == 2) StringCbCopyA (PreferredLangId, sizeof(PreferredLangId), lastLangId); EndDialog (hwndDlg, IDOK); } return 1; } case WM_COMMAND: if (lw == IDOK || hw == LBN_DBLCLK) { int i = (int) SendDlgItemMessage (hwndDlg, IDC_LANGLIST, LB_GETCURSEL, 0, 0); if (i >= 0) { int id = (int) SendDlgItemMessage (hwndDlg, IDC_LANGLIST, LB_GETITEMDATA, i, 0); if (id != LB_ERR) { char l[6]; // Decode language id from LPARAM l[0] = (char) id; l[1] = (char) (id >> 8); l[2] = 0; if ((id & 0xffff0000) != 0) { l[2] = '-'; l[3] = (char) (id >> 16); l[4] = id >> 24; l[5] = 0; } if (SendDlgItemMessage (hwndDlg, IDC_LANGLIST, LB_GETCOUNT, 0, 0) > 1) StringCbCopyA (PreferredLangId, sizeof(PreferredLangId), l); } } EndDialog (hwndDlg, IDOK); return 1; } if (lw == IDCANCEL) { EndDialog (hwndDlg, lw); return 1; } if (lw == IDC_GET_LANG_PACKS) { char tmpstr [256]; if (strlen (ActiveLangPackVersion) > 0 && strlen (GetPreferredLangId()) > 0) StringCbPrintfA (tmpstr, sizeof(tmpstr), "&langpackversion=%s&lang=%s", ActiveLangPackVersion, GetPreferredLangId()); else tmpstr[0] = 0; Applink ("localizations", TRUE, tmpstr); return 1; } return 0; } return 0; } char *GetPreferredLangId () { return PreferredLangId; } void SetPreferredLangId (char *langId) { StringCbCopyA (PreferredLangId, sizeof(PreferredLangId), langId); } char *GetActiveLangPackVersion () { return ActiveLangPackVersion; } wchar_t *GetString (const char *stringId) { WCHAR *str = (WCHAR *) GetDictionaryValue (stringId); if (str != NULL) return str; StringCbPrintfW (UnknownString, sizeof(UnknownString), UNKNOWN_STRING_ID L"%hs" UNKNOWN_STRING_ID, stringId); return UnknownString; } Font *GetFont (char *fontType) { return (Font *) GetDictionaryValue (fontType); }