mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[loc] improve fatal error handling on application launch
* Remove last ditch effort on systems that are clearly broken for localization and always report an explicit error to the user. * Also update GitHub Actions actions/checkout (Closes #2036).
This commit is contained in:
parent
07d1fdcc2f
commit
4d6c8b72d8
5 changed files with 16 additions and 11 deletions
2
.github/workflows/coverity.yml
vendored
2
.github/workflows/coverity.yml
vendored
|
@ -27,7 +27,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
|
2
.github/workflows/mingw.yml
vendored
2
.github/workflows/mingw.yml
vendored
|
@ -53,7 +53,7 @@ jobs:
|
|||
upx
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
|
2
.github/workflows/vs2022.yml
vendored
2
.github/workflows/vs2022.yml
vendored
|
@ -39,7 +39,7 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
|
11
src/rufus.c
11
src/rufus.c
|
@ -3581,15 +3581,20 @@ skip_args_processing:
|
|||
|
||||
loc_data = (BYTE*)GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_LC_RUFUS_LOC), _RT_RCDATA, "embedded.loc", &loc_size, FALSE);
|
||||
if ( (GetTempFileNameU(temp_dir, APPLICATION_NAME, 0, loc_file) == 0) || (loc_file[0] == 0) ) {
|
||||
// Last ditch effort to get a loc file - just extract it to the current directory
|
||||
static_strcpy(loc_file, rufus_loc);
|
||||
// If we don't have a working temp API, forget it
|
||||
uprintf("FATAL: Unable to create temp loc file: %s", WindowsErrorString());
|
||||
MessageBoxA(NULL, "Unable to create temporary localization file. This application will now exit.",
|
||||
"Fatal error", MB_ICONSTOP | MB_SYSTEMMODAL);
|
||||
goto out;
|
||||
}
|
||||
|
||||
hFile = CreateFileU(loc_file, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ,
|
||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if ((hFile == INVALID_HANDLE_VALUE) || (!WriteFileWithRetry(hFile, loc_data, loc_size, &size, WRITE_RETRIES))) {
|
||||
uprintf("localization: unable to extract '%s': %s", loc_file, WindowsErrorString());
|
||||
uprintf("FATAL: Unable to extract loc file '%s': %s", loc_file, WindowsErrorString());
|
||||
safe_closehandle(hFile);
|
||||
MessageBoxA(NULL, "Unable to extract localization file. This application will now exit.",
|
||||
"Fatal error", MB_ICONSTOP | MB_SYSTEMMODAL);
|
||||
goto out;
|
||||
}
|
||||
uprintf("localization: extracted data to '%s'", loc_file);
|
||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_ACCEPTFILES
|
||||
CAPTION "Rufus 3.21.1935"
|
||||
CAPTION "Rufus 3.21.1936"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||
|
@ -395,8 +395,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 3,21,1935,0
|
||||
PRODUCTVERSION 3,21,1935,0
|
||||
FILEVERSION 3,21,1936,0
|
||||
PRODUCTVERSION 3,21,1936,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -414,13 +414,13 @@ BEGIN
|
|||
VALUE "Comments", "https://rufus.ie"
|
||||
VALUE "CompanyName", "Akeo Consulting"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "3.21.1935"
|
||||
VALUE "FileVersion", "3.21.1936"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||
VALUE "OriginalFilename", "rufus-3.21.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "3.21.1935"
|
||||
VALUE "ProductVersion", "3.21.1936"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
Loading…
Reference in a new issue