mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	[ui] fix fs selection and remove prompt for GRUB/Syslinux downloads in GPT mode
* FS selection might default to NTFS instead of FAT32 after having selected a Linux ISO if no drive was plugged in when the ISO was selected and then a drive was plugged using NTFS. * Also display Fido's exist code * Closes #1255
This commit is contained in:
		
							parent
							
								
									38d906deed
								
							
						
					
					
						commit
						25a4666911
					
				
					 3 changed files with 19 additions and 14 deletions
				
			
		|  | @ -877,7 +877,7 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) | ||||||
| 	char *url = NULL, sig_url[128]; | 	char *url = NULL, sig_url[128]; | ||||||
| 	BYTE *sig = NULL; | 	BYTE *sig = NULL; | ||||||
| 	HANDLE hFile, hPipe; | 	HANDLE hFile, hPipe; | ||||||
| 	DWORD dwSize, dwAvail, dwPipeSize = 4096; | 	DWORD dwExitCode, dwSize, dwAvail, dwPipeSize = 4096; | ||||||
| 	GUID guid; | 	GUID guid; | ||||||
| 
 | 
 | ||||||
| 	IGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)); | 	IGNORE_RETVAL(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)); | ||||||
|  | @ -956,9 +956,10 @@ static DWORD WINAPI DownloadISOThread(LPVOID param) | ||||||
| 		powershell_path, script_path, &pipe[9], locale_str, icon_path, lmprintf(MSG_149)); | 		powershell_path, script_path, &pipe[9], locale_str, icon_path, lmprintf(MSG_149)); | ||||||
| 	// Signal our Windows alert hook that it should close the IE cookie prompts from Fido
 | 	// Signal our Windows alert hook that it should close the IE cookie prompts from Fido
 | ||||||
| 	close_fido_cookie_prompts = TRUE; | 	close_fido_cookie_prompts = TRUE; | ||||||
| 	FormatStatus = RunCommand(cmdline, app_dir, TRUE); | 	dwExitCode = RunCommand(cmdline, app_dir, TRUE); | ||||||
|  | 	uprintf("Exited download script with code: %d", dwExitCode); | ||||||
| 	close_fido_cookie_prompts = FALSE; | 	close_fido_cookie_prompts = FALSE; | ||||||
| 	if ((FormatStatus == 0) && PeekNamedPipe(hPipe, NULL, dwPipeSize, NULL, &dwAvail, NULL) && (dwAvail != 0)) { | 	if ((dwExitCode == 0) && PeekNamedPipe(hPipe, NULL, dwPipeSize, NULL, &dwAvail, NULL) && (dwAvail != 0)) { | ||||||
| 		url = malloc(dwAvail + 1); | 		url = malloc(dwAvail + 1); | ||||||
| 		if ((url != NULL) && ReadFile(hPipe, url, dwAvail, &dwSize, NULL) && (dwSize > 4)) { | 		if ((url != NULL) && ReadFile(hPipe, url, dwAvail, &dwSize, NULL) && (dwSize > 4)) { | ||||||
| #else | #else | ||||||
|  | @ -1007,7 +1008,7 @@ out: | ||||||
| #endif | #endif | ||||||
| 	free(url); | 	free(url); | ||||||
| 	SendMessage(hMainDialog, UM_ENABLE_CONTROLS, 0, 0); | 	SendMessage(hMainDialog, UM_ENABLE_CONTROLS, 0, 0); | ||||||
| 	ExitThread(FormatStatus); | 	ExitThread(dwExitCode); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| BOOL DownloadISO() | BOOL DownloadISO() | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								src/rufus.c
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								src/rufus.c
									
										
									
									
									
								
							|  | @ -552,7 +552,7 @@ static BOOL SetFileSystemAndClusterSize(char* fs_type) | ||||||
| static void SetFSFromISO(void) | static void SetFSFromISO(void) | ||||||
| { | { | ||||||
| 	int i, fs_tmp, preferred_fs = FS_UNKNOWN; | 	int i, fs_tmp, preferred_fs = FS_UNKNOWN; | ||||||
| 	uint32_t fs_mask = 0; | 	uint32_t fs_mask = FS_FAT32 | FS_NTFS; | ||||||
| 	BOOL windows_to_go = (image_options & IMOP_WINTOGO) && (bt == BT_IMAGE) && HAS_WINTOGO(img_report) && | 	BOOL windows_to_go = (image_options & IMOP_WINTOGO) && (bt == BT_IMAGE) && HAS_WINTOGO(img_report) && | ||||||
| 		(ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1); | 		(ComboBox_GetCurSel(GetDlgItem(hMainDialog, IDC_IMAGE_OPTION)) == 1); | ||||||
| 
 | 
 | ||||||
|  | @ -596,9 +596,13 @@ static void SetFSFromISO(void) | ||||||
| 	// Try to select the FS
 | 	// Try to select the FS
 | ||||||
| 	for (i = 0; i < ComboBox_GetCount(hFileSystem); i++) { | 	for (i = 0; i < ComboBox_GetCount(hFileSystem); i++) { | ||||||
| 		fs_tmp = (int)ComboBox_GetItemData(hFileSystem, i); | 		fs_tmp = (int)ComboBox_GetItemData(hFileSystem, i); | ||||||
| 		if (fs_tmp == preferred_fs) | 		if (fs_tmp == preferred_fs) { | ||||||
| 			IGNORE_RETVAL(ComboBox_SetCurSel(hFileSystem, i)); | 			IGNORE_RETVAL(ComboBox_SetCurSel(hFileSystem, i)); | ||||||
|  | 			break; | ||||||
| 		} | 		} | ||||||
|  | 	} | ||||||
|  | 	if (selected_fs == FS_UNKNOWN) | ||||||
|  | 		selected_fs = preferred_fs; | ||||||
| 
 | 
 | ||||||
| 	SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE_INTERNAL<<16) | IDC_FILE_SYSTEM, | 	SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE_INTERNAL<<16) | IDC_FILE_SYSTEM, | ||||||
| 		ComboBox_GetCurSel(hFileSystem)); | 		ComboBox_GetCurSel(hFileSystem)); | ||||||
|  | @ -1225,7 +1229,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) | ||||||
| 		if (tt != TT_BIOS) | 		if (tt != TT_BIOS) | ||||||
| 			goto uefi_target; | 			goto uefi_target; | ||||||
| 
 | 
 | ||||||
| 		if ((img_report.has_grub2) && (img_report.grub2_version[0] != 0) && | 		if ((pt == PARTITION_STYLE_MBR) && (img_report.has_grub2) && (img_report.grub2_version[0] != 0) && | ||||||
| 			(strcmp(img_report.grub2_version, GRUB2_PACKAGE_VERSION) != 0)) { | 			(strcmp(img_report.grub2_version, GRUB2_PACKAGE_VERSION) != 0)) { | ||||||
| 			// We may have to download a different Grub2 version if we can find one
 | 			// We may have to download a different Grub2 version if we can find one
 | ||||||
| 			IGNORE_RETVAL(_chdirU(app_dir)); | 			IGNORE_RETVAL(_chdirU(app_dir)); | ||||||
|  | @ -1289,7 +1293,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (HAS_SYSLINUX(img_report)) { | 		if ((pt == PARTITION_STYLE_MBR) && HAS_SYSLINUX(img_report)) { | ||||||
| 			if (SL_MAJOR(img_report.sl_version) < 5) { | 			if (SL_MAJOR(img_report.sl_version) < 5) { | ||||||
| 				IGNORE_RETVAL(_chdirU(app_dir)); | 				IGNORE_RETVAL(_chdirU(app_dir)); | ||||||
| 				for (i=0; i<NB_OLD_C32; i++) { | 				for (i=0; i<NB_OLD_C32; i++) { | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/rufus.rc
									
										
									
									
									
								
							|  | @ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL | ||||||
| IDD_DIALOG DIALOGEX 12, 12, 232, 326 | IDD_DIALOG DIALOGEX 12, 12, 232, 326 | ||||||
| STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||||||
| EXSTYLE WS_EX_ACCEPTFILES | EXSTYLE WS_EX_ACCEPTFILES | ||||||
| CAPTION "Rufus 3.5.1465" | CAPTION "Rufus 3.5.1466" | ||||||
| FONT 9, "Segoe UI Symbol", 400, 0, 0x0 | FONT 9, "Segoe UI Symbol", 400, 0, 0x0 | ||||||
| BEGIN | BEGIN | ||||||
|     LTEXT           "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP |     LTEXT           "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP | ||||||
|  | @ -394,8 +394,8 @@ END | ||||||
| // | // | ||||||
| 
 | 
 | ||||||
| VS_VERSION_INFO VERSIONINFO | VS_VERSION_INFO VERSIONINFO | ||||||
|  FILEVERSION 3,5,1465,0 |  FILEVERSION 3,5,1466,0 | ||||||
|  PRODUCTVERSION 3,5,1465,0 |  PRODUCTVERSION 3,5,1466,0 | ||||||
|  FILEFLAGSMASK 0x3fL |  FILEFLAGSMASK 0x3fL | ||||||
| #ifdef _DEBUG | #ifdef _DEBUG | ||||||
|  FILEFLAGS 0x1L |  FILEFLAGS 0x1L | ||||||
|  | @ -413,13 +413,13 @@ BEGIN | ||||||
|             VALUE "Comments", "https://akeo.ie" |             VALUE "Comments", "https://akeo.ie" | ||||||
|             VALUE "CompanyName", "Akeo Consulting" |             VALUE "CompanyName", "Akeo Consulting" | ||||||
|             VALUE "FileDescription", "Rufus" |             VALUE "FileDescription", "Rufus" | ||||||
|             VALUE "FileVersion", "3.5.1465" |             VALUE "FileVersion", "3.5.1466" | ||||||
|             VALUE "InternalName", "Rufus" |             VALUE "InternalName", "Rufus" | ||||||
|             VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" |             VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" | ||||||
|             VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html" |             VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html" | ||||||
|             VALUE "OriginalFilename", "rufus-3.5.exe" |             VALUE "OriginalFilename", "rufus-3.5.exe" | ||||||
|             VALUE "ProductName", "Rufus" |             VALUE "ProductName", "Rufus" | ||||||
|             VALUE "ProductVersion", "3.5.1465" |             VALUE "ProductVersion", "3.5.1466" | ||||||
|         END |         END | ||||||
|     END |     END | ||||||
|     BLOCK "VarFileInfo" |     BLOCK "VarFileInfo" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue