mirror of
https://github.com/pbatard/rufus.git
synced 2026-10-22 14:24:28 +00:00
Compare commits
3 commits
2368e49a82
...
b4a62a4e01
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4a62a4e01 |
||
|
|
482cdb53e7 |
||
|
|
a4c37ac34a |
6 changed files with 28 additions and 14 deletions
|
|
@ -420,9 +420,9 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save)
|
|||
/* For debugging user reports of HDDs vs UFDs */
|
||||
//#define FORCED_DEVICE
|
||||
#ifdef FORCED_DEVICE
|
||||
#define FORCED_VID 0x0781
|
||||
#define FORCED_PID 0x55A9
|
||||
#define FORCED_NAME " USB SanDisk 3.2Gen1 UAS Device"
|
||||
#define FORCED_VID 0x1058
|
||||
#define FORCED_PID 0x0702
|
||||
#define FORCED_NAME "WD 1200BEVExternal USB Device"
|
||||
#endif
|
||||
|
||||
void ClearDrives(void)
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ static str_score_t str_score[] = {
|
|||
};
|
||||
|
||||
static str_score_t str_adjust[] = {
|
||||
{ "SSK Port able", -20 },
|
||||
{ "Gadget", -10 },
|
||||
{ "Flash", -10 },
|
||||
{ "SD-CARD", -10 },
|
||||
|
|
@ -95,7 +96,7 @@ static str_score_t str_adjust[] = {
|
|||
{ "HDD", +20 },
|
||||
{ "SATA", +20 },
|
||||
{ "SCSI", +20 },
|
||||
{ "SSD", +20 }
|
||||
{ "SSD", +20 },
|
||||
};
|
||||
|
||||
/* The lists belows set a score according to VID & VID:PID
|
||||
|
|
@ -209,6 +210,7 @@ static vidpid_score_t vidpid_score[] = {
|
|||
{ 0x0c0b, 0xb159, 10 }, // Dura Micro 509
|
||||
// Meh
|
||||
{ 0x0e21, 0x0510, 5 }, // Cowon iAudio X5
|
||||
{ 0x1058, 0x0702, 5 }, // WD 1200BEVExternal HDD
|
||||
{ 0x11b0, 0x6298, 10 }, // Enclosure from Kingston SSDNow notebook upgrade kit
|
||||
// NOT in VID list as plenty of UFDs
|
||||
{ 0x125f, 0xa93a, 10 }, // A-DATA SH93
|
||||
|
|
|
|||
13
src/net.c
13
src/net.c
|
|
@ -173,7 +173,7 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char*
|
|||
const char* accept_types[] = {"*/*\0", NULL};
|
||||
const char* short_name;
|
||||
unsigned char buf[DOWNLOAD_BUFFER_SIZE];
|
||||
char hostname[64], urlpath[128], strsize[32];
|
||||
char hostname[64], urlpath[128], strsize[32], *bak_file = NULL;
|
||||
BOOL r = FALSE;
|
||||
DWORD dwSize, dwWritten, dwDownloaded;
|
||||
HANDLE hFile = INVALID_HANDLE_VALUE;
|
||||
|
|
@ -198,6 +198,13 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char*
|
|||
uprintf("Downloading %s", url);
|
||||
}
|
||||
|
||||
// If an old file with the same name exists, rename it so we can restore it in case of failure
|
||||
if (file != NULL && PathFileExistsU((char*)file) && (bak_file = calloc(1, strlen(file) + 6)) != NULL) {
|
||||
strcpy(bak_file, file);
|
||||
strcat(bak_file, ".bak");
|
||||
MoveFileU(file, bak_file);
|
||||
}
|
||||
|
||||
if ( (!InternetCrackUrlA(url, (DWORD)safe_strlen(url), 0, &UrlParts))
|
||||
|| (UrlParts.lpszHostName == NULL) || (UrlParts.lpszUrlPath == NULL)) {
|
||||
uprintf("Unable to decode URL: %s", WindowsErrorString());
|
||||
|
|
@ -327,8 +334,12 @@ out:
|
|||
if (!r) {
|
||||
if (file != NULL)
|
||||
DeleteFileU(file);
|
||||
if (bak_file != NULL)
|
||||
MoveFileU(bak_file, file);
|
||||
if (buffer != NULL)
|
||||
safe_free(*buffer);
|
||||
} else if (bak_file != NULL) {
|
||||
DeleteFileU(bak_file);
|
||||
}
|
||||
if (hRequest)
|
||||
InternetCloseHandle(hRequest);
|
||||
|
|
|
|||
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 4.15.2400"
|
||||
CAPTION "Rufus 4.15.2403"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||
|
|
@ -409,8 +409,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 4,15,2400,0
|
||||
PRODUCTVERSION 4,15,2400,0
|
||||
FILEVERSION 4,15,2403,0
|
||||
PRODUCTVERSION 4,15,2403,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
|
@ -428,13 +428,13 @@ BEGIN
|
|||
VALUE "Comments", "https://rufus.ie"
|
||||
VALUE "CompanyName", "Akeo Consulting"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "4.15.2400"
|
||||
VALUE "FileVersion", "4.15.2403"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2026 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||
VALUE "OriginalFilename", "rufus-4.15.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "4.15.2400"
|
||||
VALUE "ProductVersion", "4.15.2403"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
|||
|
|
@ -1080,8 +1080,8 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam
|
|||
} else switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
// Produce a big scary warning if the silent install option was selected
|
||||
if (selection_data[s].options->edition_index > 0 &&
|
||||
Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1))) {
|
||||
hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1);
|
||||
if (selection_data[s].options->edition_index > 0 && IsWindowVisible(hCtrl) && Button_GetCheck(hCtrl)) {
|
||||
selection_dialog_options_t selection = { 0 };
|
||||
selection.style = BS_AUTOCHECKBOX;
|
||||
selection.flags = SELECTION_NEEDS_ALL_TO_PROCEED | SELECTION_USE_WARNING_ICON;
|
||||
|
|
@ -1095,7 +1095,8 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam
|
|||
break;
|
||||
}
|
||||
for (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1)
|
||||
if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED)
|
||||
if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED &&
|
||||
IsWindowVisible(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)))
|
||||
r += m;
|
||||
if (selection_data[s].options->username_index > 0) {
|
||||
GetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), unattend_username, MAX_USERNAME_LENGTH);
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ char* CreateUnattendXml(int arch, int flags)
|
|||
fprintf(fd, " </ProductKey>\n");
|
||||
fprintf(fd, " </UserData>\n");
|
||||
if (flags & UNATTEND_SILENT_INSTALL) {
|
||||
uprintf("• Silent Install");
|
||||
uprintf("• ⚠Silent Install⚠");
|
||||
// Automatically partition the disk and set the installation target
|
||||
fprintf(fd, " <DiskConfiguration>\n");
|
||||
fprintf(fd, " <WillShowUI>OnError</WillShowUI>\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue