mirror of
				https://github.com/pbatard/rufus.git
				synced 2024-08-14 23:57:05 +00:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "a25af06b3c7b3fcd0b1570555938ef94cf2dea3c" and "43761aba43ec2b0279e47184bbbec67c87ba5711" have entirely different histories.
		
	
	
		
			a25af06b3c
			...
			43761aba43
		
	
		
					 12 changed files with 73 additions and 90 deletions
				
			
		
							
								
								
									
										2
									
								
								.github/workflows/coverity.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/coverity.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -52,7 +52,7 @@ jobs: | ||||||
|         cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }} |         cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }} | ||||||
| 
 | 
 | ||||||
|     - name: Publish Coverity artifacts |     - name: Publish Coverity artifacts | ||||||
|       uses: actions/upload-artifact@v3 |       uses: actions/upload-artifact@v2 | ||||||
|       with: |       with: | ||||||
|         name: cov-int |         name: cov-int | ||||||
|         path: cov-int/ |         path: cov-int/ | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								.github/workflows/lock.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/lock.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -9,7 +9,7 @@ jobs: | ||||||
|   lock: |   lock: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: dessant/lock-threads@v3 |       - uses: dessant/lock-threads@v2 | ||||||
|         with: |         with: | ||||||
|           github-token: ${{ github.token }} |           github-token: ${{ github.token }} | ||||||
|           issue-lock-inactive-days: '90' |           issue-lock-inactive-days: '90' | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								.github/workflows/mingw.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/mingw.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -88,7 +88,7 @@ jobs: | ||||||
| 
 | 
 | ||||||
|     - name: Upload artifacts |     - name: Upload artifacts | ||||||
|       if: ${{ matrix.env == 'i686' && github.event_name == 'push' }} |       if: ${{ matrix.env == 'i686' && github.event_name == 'push' }} | ||||||
|       uses: actions/upload-artifact@v3 |       uses: actions/upload-artifact@v2 | ||||||
|       with: |       with: | ||||||
|         name: MinGW |         name: MinGW | ||||||
|         path: ./*.exe |         path: ./*.exe | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								.github/workflows/vs2022.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/vs2022.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -77,7 +77,7 @@ jobs: | ||||||
|         curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe |         curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe | ||||||
| 
 | 
 | ||||||
|     - name: Upload artifacts |     - name: Upload artifacts | ||||||
|       uses: actions/upload-artifact@v3 |       uses: actions/upload-artifact@v2 | ||||||
|       if: ${{ github.event_name == 'push' }} |       if: ${{ github.event_name == 'push' }} | ||||||
|       with: |       with: | ||||||
|         name: VS2022 |         name: VS2022 | ||||||
|  |  | ||||||
|  | @ -13,7 +13,8 @@ o v3.20 (2022.??.??) | ||||||
|   - *NEW*      MSG_328 "Remove requirement for Secure Boot and TPM 2.0" |   - *NEW*      MSG_328 "Remove requirement for Secure Boot and TPM 2.0" | ||||||
|   - *NEW*      MSG_329 "Remove requirement for 4GB+ RAM and 64GB+ disk" |   - *NEW*      MSG_329 "Remove requirement for 4GB+ RAM and 64GB+ disk" | ||||||
|   - *NEW*      MSG_330 "Remove requirement for an online Microsoft account" |   - *NEW*      MSG_330 "Remove requirement for an online Microsoft account" | ||||||
|   - *NEW*      MSG_331 "Disable data collection (Skip privacy questions)" |   - *NEW*      MSG_331 "Remove \"unsupported hardware\" desktop watermark" | ||||||
|  |   - *NEW*      MSG_332 "Disable data collection (Skip privacy questions)" | ||||||
| 
 | 
 | ||||||
| o v3.14 (2021.03.31) | o v3.14 (2021.03.31) | ||||||
|   - *UPDATED*  MSG_068 "Error while partitioning drive." -> "Could not partition drive." |   - *UPDATED*  MSG_068 "Error while partitioning drive." -> "Could not partition drive." | ||||||
|  |  | ||||||
|  | @ -588,7 +588,8 @@ t MSG_327 "Customize Windows installation?" | ||||||
| t MSG_328 "Remove requirement for Secure Boot and TPM 2.0" | t MSG_328 "Remove requirement for Secure Boot and TPM 2.0" | ||||||
| t MSG_329 "Remove requirement for 4GB+ RAM and 64GB+ disk" | t MSG_329 "Remove requirement for 4GB+ RAM and 64GB+ disk" | ||||||
| t MSG_330 "Remove requirement for an online Microsoft account" | t MSG_330 "Remove requirement for an online Microsoft account" | ||||||
| t MSG_331 "Disable data collection (Skip privacy questions)" | t MSG_331 "Remove \"unsupported hardware\" desktop watermark" | ||||||
|  | t MSG_332 "Disable data collection (Skip privacy questions)" | ||||||
| 
 | 
 | ||||||
| ######################################################################### | ######################################################################### | ||||||
| l "ar-SA" "Arabic (العربية)" 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001 | l "ar-SA" "Arabic (العربية)" 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001 | ||||||
|  |  | ||||||
|  | @ -807,10 +807,8 @@ BOOL GetDevices(DWORD devnum) | ||||||
| 						continue; | 						continue; | ||||||
| 					if ((props.vid == 0x0781) && (props.pid == 0x75a0)) | 					if ((props.vid == 0x0781) && (props.pid == 0x75a0)) | ||||||
| 						continue; | 						continue; | ||||||
| 					if ((props.vid == 0x10d6) && (props.pid == 0x1101)) |  | ||||||
| 						continue; |  | ||||||
| 				} | 				} | ||||||
| 				// Also ignore USB devices that have been specifically flagged by the user
 | 				// Also ignore USB devices that have been specifically flaggged by the user
 | ||||||
| 				for (s = 0; s < ARRAYSIZE(ignore_vid_pid); s++) { | 				for (s = 0; s < ARRAYSIZE(ignore_vid_pid); s++) { | ||||||
| 					if ((props.vid == (ignore_vid_pid[s] >> 16)) && (props.pid == (ignore_vid_pid[s] & 0xffff))) { | 					if ((props.vid == (ignore_vid_pid[s] >> 16)) && (props.pid == (ignore_vid_pid[s] & 0xffff))) { | ||||||
| 						uprintf("Ignoring '%s' (%s), per user settings", buffer, str); | 						uprintf("Ignoring '%s' (%s), per user settings", buffer, str); | ||||||
|  |  | ||||||
							
								
								
									
										33
									
								
								src/format.c
									
										
									
									
									
								
							
							
						
						
									
										33
									
								
								src/format.c
									
										
									
									
									
								
							|  | @ -1250,11 +1250,11 @@ out: | ||||||
| // Returns -2 on user cancel, -1 on other error, >=0 on success.
 | // Returns -2 on user cancel, -1 on other error, >=0 on success.
 | ||||||
| int SetWinToGoIndex(void) | int SetWinToGoIndex(void) | ||||||
| { | { | ||||||
| 	char *mounted_iso, *val, mounted_image_path[128]; | 	char *mounted_iso, *build, mounted_image_path[128]; | ||||||
| 	char xml_file[MAX_PATH] = ""; | 	char xml_file[MAX_PATH] = ""; | ||||||
| 	char *install_names[MAX_WININST]; | 	char *install_names[MAX_WININST]; | ||||||
| 	StrArray version_name, version_index; | 	StrArray version_name, version_index; | ||||||
| 	int i; | 	int i, build_nr = 0; | ||||||
| 	BOOL bNonStandard = FALSE; | 	BOOL bNonStandard = FALSE; | ||||||
| 
 | 
 | ||||||
| 	// Sanity checks
 | 	// Sanity checks
 | ||||||
|  | @ -1334,34 +1334,21 @@ int SetWinToGoIndex(void) | ||||||
| 	else | 	else | ||||||
| 		wintogo_index = atoi(version_index.String[i - 1]); | 		wintogo_index = atoi(version_index.String[i - 1]); | ||||||
| 	if (i > 0) { | 	if (i > 0) { | ||||||
| 		// Get the version data from the XML index
 | 		// Get the build version
 | ||||||
| 		val = get_token_data_file_indexed("MAJOR", xml_file, i); | 		build = get_token_data_file_indexed("BUILD", xml_file, i); | ||||||
| 		img_report.win_version.major = (uint16_t)safe_atoi(val); | 		if (build != NULL) | ||||||
| 		free(val); | 			build_nr = atoi(build); | ||||||
| 		val = get_token_data_file_indexed("MINOR", xml_file, i); | 		free(build); | ||||||
| 		img_report.win_version.minor = (uint16_t)safe_atoi(val); |  | ||||||
| 		free(val); |  | ||||||
| 		val = get_token_data_file_indexed("BUILD", xml_file, i); |  | ||||||
| 		img_report.win_version.build = (uint16_t)safe_atoi(val); |  | ||||||
| 		free(val); |  | ||||||
| 		val = get_token_data_file_indexed("SPBUILD", xml_file, i); |  | ||||||
| 		img_report.win_version.revision = (uint16_t)safe_atoi(val); |  | ||||||
| 		free(val); |  | ||||||
| 		if ((img_report.win_version.major == 10) && (img_report.win_version.build > 20000)) |  | ||||||
| 			img_report.win_version.major = 11; |  | ||||||
| 		// If we couldn't obtain the major and build, we have a problem
 |  | ||||||
| 		if (img_report.win_version.major == 0 || img_report.win_version.build == 0) |  | ||||||
| 			uprintf("Warning: Could not obtain version information from XML index (Nonstandard Windows image?)"); |  | ||||||
| 		uprintf("Will use '%s' (Build: %d, Index %s) for Windows To Go", | 		uprintf("Will use '%s' (Build: %d, Index %s) for Windows To Go", | ||||||
| 			version_name.String[i - 1], img_report.win_version.build, version_index.String[i - 1]); | 			version_name.String[i - 1], build_nr, version_index.String[i - 1]); | ||||||
| 		// Need Windows 10 Creator Update or later for boot on REMOVABLE to work
 | 		// Need Windows 10 Creator Update or later for boot on REMOVABLE to work
 | ||||||
| 		if ((img_report.win_version.build < 15000) && (SelectedDrive.MediaType != FixedMedia)) { | 		if ((build_nr < 15000) && (SelectedDrive.MediaType != FixedMedia)) { | ||||||
| 			if (MessageBoxExU(hMainDialog, lmprintf(MSG_098), lmprintf(MSG_190), | 			if (MessageBoxExU(hMainDialog, lmprintf(MSG_098), lmprintf(MSG_190), | ||||||
| 				MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) | 				MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES) | ||||||
| 				wintogo_index = -2; | 				wintogo_index = -2; | ||||||
| 		} | 		} | ||||||
| 		// Display a notice about WppRecorder.sys for 1809 ISOs
 | 		// Display a notice about WppRecorder.sys for 1809 ISOs
 | ||||||
| 		if (img_report.win_version.build == 17763) { | 		if (build_nr == 17763) { | ||||||
| 			notification_info more_info; | 			notification_info more_info; | ||||||
| 			more_info.id = MORE_INFO_URL; | 			more_info.id = MORE_INFO_URL; | ||||||
| 			more_info.url = WPPRECORDER_MORE_INFO_URL; | 			more_info.url = WPPRECORDER_MORE_INFO_URL; | ||||||
|  |  | ||||||
|  | @ -115,22 +115,6 @@ static __inline int _log2(register int val) | ||||||
| 	return ret; | 	return ret; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // Remap bits from a byte according to an 8x8 bit matrix
 |  | ||||||
| static __inline uint8_t remap8(uint8_t src, uint8_t* map, const BOOL reverse) |  | ||||||
| { |  | ||||||
| 	uint8_t i, m = 1, r = 0; |  | ||||||
| 	for (i = 0, m = 1; i < 8; i++, m <<= 1) { |  | ||||||
| 		if (reverse) { |  | ||||||
| 			if (src & map[i]) |  | ||||||
| 				r |= m; |  | ||||||
| 		} else { |  | ||||||
| 			if (src & m) |  | ||||||
| 				r |= map[i]; |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| 	return r; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /* Why oh why does Microsoft have to make everybody suffer with their braindead use of Unicode? */ | /* Why oh why does Microsoft have to make everybody suffer with their braindead use of Unicode? */ | ||||||
| #define _RT_ICON			MAKEINTRESOURCEA(3) | #define _RT_ICON			MAKEINTRESOURCEA(3) | ||||||
| #define _RT_DIALOG			MAKEINTRESOURCEA(5) | #define _RT_DIALOG			MAKEINTRESOURCEA(5) | ||||||
|  |  | ||||||
							
								
								
									
										77
									
								
								src/rufus.c
									
										
									
									
									
								
							
							
						
						
									
										77
									
								
								src/rufus.c
									
										
									
									
									
								
							|  | @ -63,11 +63,12 @@ enum bootcheck_return { | ||||||
| #define UNATTEND_SECUREBOOT_TPM_MASK        0x01 | #define UNATTEND_SECUREBOOT_TPM_MASK        0x01 | ||||||
| #define UNATTEND_MINRAM_MINDISK_MASK        0x02 | #define UNATTEND_MINRAM_MINDISK_MASK        0x02 | ||||||
| #define UNATTEND_NO_ONLINE_ACCOUNT_MASK     0x04 | #define UNATTEND_NO_ONLINE_ACCOUNT_MASK     0x04 | ||||||
| #define UNATTEND_NO_DATA_COLLECTION_MASK    0x08 | #define UNATTEND_REMOVE_WATERMARK_MASK      0x08 | ||||||
|  | #define UNATTEND_NO_DATA_COLLECTION_MASK    0x10 | ||||||
| 
 | 
 | ||||||
| #define UNATTEND_WINPE_SETUP_MASK           (UNATTEND_SECUREBOOT_TPM_MASK | UNATTEND_MINRAM_MINDISK_MASK) | #define UNATTEND_WINPE_SETUP_MASK           (UNATTEND_SECUREBOOT_TPM_MASK | UNATTEND_MINRAM_MINDISK_MASK) | ||||||
| #define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT_MASK) | #define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT_MASK | UNATTEND_REMOVE_WATERMARK_MASK) | ||||||
| #define UNATTEND_OOBE_SHELL_SETUP           (UNATTEND_NO_DATA_COLLECTION_MASK) | #define UNATTEND_OOBE_SHELL_SETUP           (UNATTEND_REMOVE_WATERMARK_MASK | UNATTEND_NO_DATA_COLLECTION_MASK) | ||||||
| 
 | 
 | ||||||
| static const char* cmdline_hogger = "rufus.com"; | static const char* cmdline_hogger = "rufus.com"; | ||||||
| static const char* ep_reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"; | static const char* ep_reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"; | ||||||
|  | @ -88,7 +89,8 @@ static BOOL allowed_filesystem[FS_MAX] = { 0 }; | ||||||
| static int64_t last_iso_blocking_status; | static int64_t last_iso_blocking_status; | ||||||
| static int selected_pt = -1, selected_fs = FS_UNKNOWN, preselected_fs = FS_UNKNOWN; | static int selected_pt = -1, selected_fs = FS_UNKNOWN, preselected_fs = FS_UNKNOWN; | ||||||
| static int image_index = 0, select_index = 0; | static int image_index = 0, select_index = 0; | ||||||
| static int unattend_xml_mask = (UNATTEND_SECUREBOOT_TPM_MASK | UNATTEND_NO_ONLINE_ACCOUNT_MASK); | static int unattend_xml_mask = (UNATTEND_SECUREBOOT_TPM_MASK | UNATTEND_NO_ONLINE_ACCOUNT_MASK | | ||||||
|  | 	UNATTEND_REMOVE_WATERMARK_MASK); | ||||||
| static RECT relaunch_rc = { -65536, -65536, 0, 0}; | static RECT relaunch_rc = { -65536, -65536, 0, 0}; | ||||||
| static UINT uMBRChecked = BST_UNCHECKED; | static UINT uMBRChecked = BST_UNCHECKED; | ||||||
| static HANDLE format_thread = NULL; | static HANDLE format_thread = NULL; | ||||||
|  | @ -1264,6 +1266,7 @@ static char* CreateUnattendXml(int arch, int mask) | ||||||
| 	static char path[MAX_PATH]; | 	static char path[MAX_PATH]; | ||||||
| 	FILE* fd; | 	FILE* fd; | ||||||
| 	int i, order; | 	int i, order; | ||||||
|  | 	// I don't believe there's a version of Windows 11 for ARM32 but whatever...
 | ||||||
| 	const char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" }; | 	const char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" }; | ||||||
| 	const char* bypass_name[4] = { "BypassTPMCheck", "BypassSecureBootCheck", "BypassRAMCheck", "BypassStorageCheck" }; | 	const char* bypass_name[4] = { "BypassTPMCheck", "BypassSecureBootCheck", "BypassRAMCheck", "BypassStorageCheck" }; | ||||||
| 	if (arch < ARCH_X86_32 || arch >= ARCH_ARM_64 || mask == 0) | 	if (arch < ARCH_X86_32 || arch >= ARCH_ARM_64 || mask == 0) | ||||||
|  | @ -1308,6 +1311,7 @@ static char* CreateUnattendXml(int arch, int mask) | ||||||
| 		fprintf(fd, "  </settings>\n"); | 		fprintf(fd, "  </settings>\n"); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	// This part and some of OOBE was picked from https://github.com/AveYo/MediaCreationTool.bat/blob/main/bypass11/AutoUnattend.xml
 | ||||||
| 	if (mask & UNATTEND_SPECIALIZE_DEPLOYMENT_MASK) { | 	if (mask & UNATTEND_SPECIALIZE_DEPLOYMENT_MASK) { | ||||||
| 		order = 1; | 		order = 1; | ||||||
| 		fprintf(fd, "  <settings pass=\"specialize\">\n"); | 		fprintf(fd, "  <settings pass=\"specialize\">\n"); | ||||||
|  | @ -1315,13 +1319,22 @@ static char* CreateUnattendXml(int arch, int mask) | ||||||
| 			"xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " | 			"xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " | ||||||
| 			"publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); | 			"publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); | ||||||
| 		fprintf(fd, "      <RunSynchronous>\n"); | 		fprintf(fd, "      <RunSynchronous>\n"); | ||||||
| 		// This part was picked from https://github.com/AveYo/MediaCreationTool.bat/blob/main/bypass11/AutoUnattend.xml
 |  | ||||||
| 		if (mask & UNATTEND_NO_ONLINE_ACCOUNT_MASK) { | 		if (mask & UNATTEND_NO_ONLINE_ACCOUNT_MASK) { | ||||||
| 			fprintf(fd, "        <RunSynchronousCommand wcm:action=\"add\">\n"); | 			fprintf(fd, "        <RunSynchronousCommand wcm:action=\"add\">\n"); | ||||||
| 			fprintf(fd, "          <Order>%d</Order>\n", order++); | 			fprintf(fd, "          <Order>%d</Order>\n", order++); | ||||||
| 			fprintf(fd, "          <Path>reg add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE /v BypassNRO /t REG_DWORD /d 1 /f</Path>\n"); | 			fprintf(fd, "          <Path>reg add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE /v BypassNRO /t REG_DWORD /d 1 /f</Path>\n"); | ||||||
| 			fprintf(fd, "        </RunSynchronousCommand>\n"); | 			fprintf(fd, "        </RunSynchronousCommand>\n"); | ||||||
| 		} | 		} | ||||||
|  | 		if (mask & UNATTEND_SPECIALIZE_DEPLOYMENT_MASK) { | ||||||
|  | 			fprintf(fd, "        <RunSynchronousCommand wcm:action=\"add\">\n"); | ||||||
|  | 			fprintf(fd, "          <Order>%d</Order>\n", order++); | ||||||
|  | 			fprintf(fd, "          <Path>reg add HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate /v TargetReleaseVersion /t REG_DWORD /d 1 /f</Path>\n"); | ||||||
|  | 			fprintf(fd, "        </RunSynchronousCommand>\n"); | ||||||
|  | 			fprintf(fd, "        <RunSynchronousCommand wcm:action=\"add\">\n"); | ||||||
|  | 			fprintf(fd, "          <Order>%d</Order>\n", order++); | ||||||
|  | 			fprintf(fd, "          <Path>reg add HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate /v TargetReleaseVersionInfo /t REG_SZ /d 25H1 /f</Path>\n"); | ||||||
|  | 			fprintf(fd, "        </RunSynchronousCommand>\n"); | ||||||
|  | 		} | ||||||
| 		fprintf(fd, "      </RunSynchronous>\n"); | 		fprintf(fd, "      </RunSynchronous>\n"); | ||||||
| 		fprintf(fd, "    </component>\n"); | 		fprintf(fd, "    </component>\n"); | ||||||
| 		fprintf(fd, "  </settings>\n"); | 		fprintf(fd, "  </settings>\n"); | ||||||
|  | @ -1333,6 +1346,18 @@ static char* CreateUnattendXml(int arch, int mask) | ||||||
| 		fprintf(fd, "    <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " | 		fprintf(fd, "    <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"%s\" language=\"neutral\" " | ||||||
| 			"xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " | 			"xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " | ||||||
| 			"publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); | 			"publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]); | ||||||
|  | 		if (mask & UNATTEND_REMOVE_WATERMARK_MASK) { | ||||||
|  | 			fprintf(fd, "      <FirstLogonCommands>\n"); | ||||||
|  | 			fprintf(fd, "        <SynchronousCommand wcm:action=\"add\">\n"); | ||||||
|  | 			fprintf(fd, "          <Order>%d</Order>\n", order++); | ||||||
|  | 			fprintf(fd, "          <CommandLine>reg add \"HKCU\\Control Panel\\UnsupportedHardwareNotificationCache\" /v SV1 /t REG_DWORD /d 0 /f</CommandLine>\n"); | ||||||
|  | 			fprintf(fd, "        </SynchronousCommand>\n"); | ||||||
|  | 			fprintf(fd, "        <SynchronousCommand wcm:action=\"add\">\n"); | ||||||
|  | 			fprintf(fd, "          <Order>%d</Order>\n", order++); | ||||||
|  | 			fprintf(fd, "          <CommandLine>reg add \"HKCU\\Control Panel\\UnsupportedHardwareNotificationCache\" /v SV2 /t REG_DWORD /d 0 /f</CommandLine>\n"); | ||||||
|  | 			fprintf(fd, "        </SynchronousCommand>\n"); | ||||||
|  | 			fprintf(fd, "      </FirstLogonCommands>\n"); | ||||||
|  | 		} | ||||||
| 		// https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-oobe-protectyourpc
 | 		// https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-oobe-protectyourpc
 | ||||||
| 		// It is really super insidous of Microsoft to call this option "ProtectYourPC", when it's really only about
 | 		// It is really super insidous of Microsoft to call this option "ProtectYourPC", when it's really only about
 | ||||||
| 		// data collection. But of course, if it was called "AllowDataCollection", everyone would turn it off...
 | 		// data collection. But of course, if it was called "AllowDataCollection", everyone would turn it off...
 | ||||||
|  | @ -1500,8 +1525,6 @@ out: | ||||||
| 	ExitThread(0); | 	ExitThread(0); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #define MAP_BIT(bit) do { map[_log2(bit)] = b; b <<= 1; } while(0) |  | ||||||
| 
 |  | ||||||
| // Likewise, boot check will block message processing => use a thread
 | // Likewise, boot check will block message processing => use a thread
 | ||||||
| static DWORD WINAPI BootCheckThread(LPVOID param) | static DWORD WINAPI BootCheckThread(LPVOID param) | ||||||
| { | { | ||||||
|  | @ -1598,29 +1621,20 @@ static DWORD WINAPI BootCheckThread(LPVOID param) | ||||||
| 			default: | 			default: | ||||||
| 				break; | 				break; | ||||||
| 			} | 			} | ||||||
| 			if ((nWindowsVersion >= WINDOWS_8) && IS_WINDOWS_11(img_report)) { | 			if ((nWindowsVersion >= WINDOWS_8) && IS_WINDOWS_11(img_report) && (img_report.win_version.build >= 22500)) { | ||||||
| 				StrArray options; | 				StrArray options; | ||||||
| 				int arch = _log2(img_report.has_efi >> 1); | 				int arch = _log2(img_report.has_efi >> 1); | ||||||
| 				uint8_t map[8] = { 0 }, b = 1; | 				StrArrayCreate(&options, 4); | ||||||
| 				StrArrayCreate(&options, 2); |  | ||||||
| 				if (img_report.win_version.build >= 22500) { |  | ||||||
| 				StrArrayAdd(&options, lmprintf(MSG_330), TRUE); | 				StrArrayAdd(&options, lmprintf(MSG_330), TRUE); | ||||||
| 					MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT_MASK); |  | ||||||
| 				} |  | ||||||
| 				StrArrayAdd(&options, lmprintf(MSG_331), TRUE); | 				StrArrayAdd(&options, lmprintf(MSG_331), TRUE); | ||||||
| 				MAP_BIT(UNATTEND_NO_DATA_COLLECTION_MASK); | 				StrArrayAdd(&options, lmprintf(MSG_332), TRUE); | ||||||
| 				i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327), | 				i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327), options.String, options.Index, unattend_xml_mask >> 2); | ||||||
| 					options.String, options.Index, remap8(unattend_xml_mask, map, FALSE)); |  | ||||||
| 				StrArrayDestroy(&options); | 				StrArrayDestroy(&options); | ||||||
| 				if (i < 0) | 				if (i < 0) | ||||||
| 					goto out; | 					goto out; | ||||||
| 				// Remap i to the correct bit positions before calling CreateUnattendXml()
 | 				i <<= 2; | ||||||
| 				i = remap8(i, map, TRUE); |  | ||||||
| 				unattend_xml_path = CreateUnattendXml(arch, i); | 				unattend_xml_path = CreateUnattendXml(arch, i); | ||||||
| 				// Keep the bits we didn't process
 | 				unattend_xml_mask = (unattend_xml_mask & 0x03) | (i & (~0x03)); | ||||||
| 				unattend_xml_mask &= ~(remap8(0xff, map, TRUE)); |  | ||||||
| 				// And add back the bits we did process
 |  | ||||||
| 				unattend_xml_mask |= i; |  | ||||||
| 			} | 			} | ||||||
| 		} else if (target_type == TT_UEFI) { | 		} else if (target_type == TT_UEFI) { | ||||||
| 			if (!IS_EFI_BOOTABLE(img_report)) { | 			if (!IS_EFI_BOOTABLE(img_report)) { | ||||||
|  | @ -1637,29 +1651,24 @@ static DWORD WINAPI BootCheckThread(LPVOID param) | ||||||
| 			if ((nWindowsVersion >= WINDOWS_8) && IS_WINDOWS_11(img_report)) { | 			if ((nWindowsVersion >= WINDOWS_8) && IS_WINDOWS_11(img_report)) { | ||||||
| 				StrArray options; | 				StrArray options; | ||||||
| 				int arch = _log2(img_report.has_efi >> 1); | 				int arch = _log2(img_report.has_efi >> 1); | ||||||
| 				uint8_t map[8] = { 0 }, b = 1; | 				StrArrayCreate(&options, 5); | ||||||
| 				StrArrayCreate(&options, 4); |  | ||||||
| 				StrArrayAdd(&options, lmprintf(MSG_328), TRUE); | 				StrArrayAdd(&options, lmprintf(MSG_328), TRUE); | ||||||
| 				MAP_BIT(UNATTEND_SECUREBOOT_TPM_MASK); |  | ||||||
| 				StrArrayAdd(&options, lmprintf(MSG_329), TRUE); | 				StrArrayAdd(&options, lmprintf(MSG_329), TRUE); | ||||||
| 				MAP_BIT(UNATTEND_MINRAM_MINDISK_MASK); |  | ||||||
| 				if (img_report.win_version.build >= 22500) { | 				if (img_report.win_version.build >= 22500) { | ||||||
| 					StrArrayAdd(&options, lmprintf(MSG_330), TRUE); | 					StrArrayAdd(&options, lmprintf(MSG_330), TRUE); | ||||||
| 					MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT_MASK); |  | ||||||
| 				} |  | ||||||
| 					StrArrayAdd(&options, lmprintf(MSG_331), TRUE); | 					StrArrayAdd(&options, lmprintf(MSG_331), TRUE); | ||||||
| 				MAP_BIT(UNATTEND_NO_DATA_COLLECTION_MASK); | 				} | ||||||
| 				i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327), | 				StrArrayAdd(&options, lmprintf(MSG_332), TRUE); | ||||||
| 					options.String, options.Index, remap8(unattend_xml_mask, map, FALSE)); | 				i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327), options.String, options.Index, unattend_xml_mask); | ||||||
| 				StrArrayDestroy(&options); | 				StrArrayDestroy(&options); | ||||||
| 				if (i < 0) | 				if (i < 0) | ||||||
| 					goto out; | 					goto out; | ||||||
| 				i = remap8(i, map, TRUE); |  | ||||||
| 				unattend_xml_path = CreateUnattendXml(arch, i); | 				unattend_xml_path = CreateUnattendXml(arch, i); | ||||||
| 				// Remember the user preferences for the current session.
 | 				// Remember the user preferences for the current session.
 | ||||||
| 				// TODO: Do we want to save the current mask as a permanent setting?
 | 				// TODO: Do we want to save the current mask as a permanent setting?
 | ||||||
| 				unattend_xml_mask &= ~(remap8(0xff, map, TRUE)); | 				unattend_xml_mask = (unattend_xml_mask & (~0x3)) | (i & 0x03); | ||||||
| 				unattend_xml_mask |= i; | 				if (img_report.win_version.build >= 22500) | ||||||
|  | 					unattend_xml_mask = (unattend_xml_mask & 0x03) | (i & (~0x3)); | ||||||
| 			} | 			} | ||||||
| 		} else if ( ((fs_type == FS_NTFS) && !HAS_WINDOWS(img_report) && !HAS_GRUB(img_report) &&  | 		} else if ( ((fs_type == FS_NTFS) && !HAS_WINDOWS(img_report) && !HAS_GRUB(img_report) &&  | ||||||
| 					 (!HAS_SYSLINUX(img_report) || (SL_MAJOR(img_report.sl_version) <= 5))) | 					 (!HAS_SYSLINUX(img_report) || (SL_MAJOR(img_report.sl_version) <= 5))) | ||||||
|  |  | ||||||
|  | @ -85,7 +85,11 @@ | ||||||
| #define STATUS_MSG_TIMEOUT          3500		// How long should cheat mode messages appear for on the status bar
 | #define STATUS_MSG_TIMEOUT          3500		// How long should cheat mode messages appear for on the status bar
 | ||||||
| #define WRITE_RETRIES               4 | #define WRITE_RETRIES               4 | ||||||
| #define WRITE_TIMEOUT               5000		// How long we should wait between write retries (in ms)
 | #define WRITE_TIMEOUT               5000		// How long we should wait between write retries (in ms)
 | ||||||
|  | #if defined(_DEBUG) | ||||||
|  | #define SEARCH_PROCESS_TIMEOUT      60000 | ||||||
|  | #else | ||||||
| #define SEARCH_PROCESS_TIMEOUT      10000		// How long we should search for conflicting processes before giving up (in ms)
 | #define SEARCH_PROCESS_TIMEOUT      10000		// How long we should search for conflicting processes before giving up (in ms)
 | ||||||
|  | #endif | ||||||
| #define NET_SESSION_TIMEOUT         3500		// How long we should wait to connect, send or receive internet data
 | #define NET_SESSION_TIMEOUT         3500		// How long we should wait to connect, send or receive internet data
 | ||||||
| #define MARQUEE_TIMER_REFRESH       10			// Time between progress bar marquee refreshes, in ms
 | #define MARQUEE_TIMER_REFRESH       10			// Time between progress bar marquee refreshes, in ms
 | ||||||
| #define FS_DEFAULT                  FS_FAT32 | #define FS_DEFAULT                  FS_FAT32 | ||||||
|  | @ -157,7 +161,6 @@ | ||||||
| #define safe_release_dc(hDlg, hDC) do {if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) {ReleaseDC(hDlg, hDC); hDC = NULL;}} while(0) | #define safe_release_dc(hDlg, hDC) do {if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) {ReleaseDC(hDlg, hDC); hDC = NULL;}} while(0) | ||||||
| #define safe_sprintf(dst, count, ...) do {_snprintf(dst, count, __VA_ARGS__); (dst)[(count)-1] = 0; } while(0) | #define safe_sprintf(dst, count, ...) do {_snprintf(dst, count, __VA_ARGS__); (dst)[(count)-1] = 0; } while(0) | ||||||
| #define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__) | #define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__) | ||||||
| #define safe_atoi(str) ((((char*)(str))==NULL)?0:atoi(str)) |  | ||||||
| #define safe_strlen(str) ((((char*)(str))==NULL)?0:strlen(str)) | #define safe_strlen(str) ((((char*)(str))==NULL)?0:strlen(str)) | ||||||
| #define safe_strdup _strdup | #define safe_strdup _strdup | ||||||
| #define to_windows_path(str) do { size_t __i; for (__i = 0; __i < safe_strlen(str); __i++) if (str[__i] == '/') str[__i] = '\\'; } while(0) | #define to_windows_path(str) do { size_t __i; for (__i = 0; __i < safe_strlen(str); __i++) if (str[__i] == '/') str[__i] = '\\'; } while(0) | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								src/rufus.rc
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								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.19.1904" | CAPTION "Rufus 3.19.1901" | ||||||
| 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 | ||||||
|  | @ -159,7 +159,7 @@ BEGIN | ||||||
|     DEFPUSHBUTTON   "OK",IDOK,196,53,50,12 |     DEFPUSHBUTTON   "OK",IDOK,196,53,50,12 | ||||||
|     PUSHBUTTON      "Cancel",IDCANCEL,254,53,50,12 |     PUSHBUTTON      "Cancel",IDCANCEL,254,53,50,12 | ||||||
|     CONTROL         "Choice 1",IDC_SELECTION_CHOICE1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,35,18,269,10,WS_EX_TRANSPARENT |     CONTROL         "Choice 1",IDC_SELECTION_CHOICE1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,35,18,269,10,WS_EX_TRANSPARENT | ||||||
|     CONTROL         "Choice 2",IDC_SELECTION_CHOICE2,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,31,269,10,WS_EX_TRANSPARENT |     CONTROL         "Choice 2",IDC_SELECTION_CHOICE2,"Button",BS_AUTORADIOBUTTON,35,31,269,10,WS_EX_TRANSPARENT | ||||||
|     CONTROL         "Choice 3",IDC_SELECTION_CHOICE3,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,44,269,10,WS_EX_TRANSPARENT |     CONTROL         "Choice 3",IDC_SELECTION_CHOICE3,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,44,269,10,WS_EX_TRANSPARENT | ||||||
|     CONTROL         "Choice 4",IDC_SELECTION_CHOICE4,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,57,269,10,WS_EX_TRANSPARENT |     CONTROL         "Choice 4",IDC_SELECTION_CHOICE4,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,57,269,10,WS_EX_TRANSPARENT | ||||||
|     CONTROL         "Choice 5",IDC_SELECTION_CHOICE5,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,70,269,10,WS_EX_TRANSPARENT |     CONTROL         "Choice 5",IDC_SELECTION_CHOICE5,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,70,269,10,WS_EX_TRANSPARENT | ||||||
|  | @ -395,8 +395,8 @@ END | ||||||
| // | // | ||||||
| 
 | 
 | ||||||
| VS_VERSION_INFO VERSIONINFO | VS_VERSION_INFO VERSIONINFO | ||||||
|  FILEVERSION 3,19,1904,0 |  FILEVERSION 3,19,1901,0 | ||||||
|  PRODUCTVERSION 3,19,1904,0 |  PRODUCTVERSION 3,19,1901,0 | ||||||
|  FILEFLAGSMASK 0x3fL |  FILEFLAGSMASK 0x3fL | ||||||
| #ifdef _DEBUG | #ifdef _DEBUG | ||||||
|  FILEFLAGS 0x1L |  FILEFLAGS 0x1L | ||||||
|  | @ -414,13 +414,13 @@ BEGIN | ||||||
|             VALUE "Comments", "https://rufus.ie" |             VALUE "Comments", "https://rufus.ie" | ||||||
|             VALUE "CompanyName", "Akeo Consulting" |             VALUE "CompanyName", "Akeo Consulting" | ||||||
|             VALUE "FileDescription", "Rufus" |             VALUE "FileDescription", "Rufus" | ||||||
|             VALUE "FileVersion", "3.19.1904" |             VALUE "FileVersion", "3.19.1901" | ||||||
|             VALUE "InternalName", "Rufus" |             VALUE "InternalName", "Rufus" | ||||||
|             VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)" |             VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)" | ||||||
|             VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" |             VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" | ||||||
|             VALUE "OriginalFilename", "rufus-3.19.exe" |             VALUE "OriginalFilename", "rufus-3.19.exe" | ||||||
|             VALUE "ProductName", "Rufus" |             VALUE "ProductName", "Rufus" | ||||||
|             VALUE "ProductVersion", "3.19.1904" |             VALUE "ProductVersion", "3.19.1901" | ||||||
|         END |         END | ||||||
|     END |     END | ||||||
|     BLOCK "VarFileInfo" |     BLOCK "VarFileInfo" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue