diff --git a/res/localization/ChangeLog.txt b/res/localization/ChangeLog.txt index ed81f73a..c6fde322 100644 --- a/res/localization/ChangeLog.txt +++ b/res/localization/ChangeLog.txt @@ -77,9 +77,10 @@ o Version 1.0.1 (2013.10.28) o Version 1.0.0 (2013.10.20) - Initial version -[TODO] (NOTE: THIS PART IS ONLY FOR THE RUFUS DEVELOPER, NOT TRANSLATORS) +[TODO] (NOTE: THIS PART IS ONLY INTENDED FOR THE RUFUS DEVELOPER, NOT THE TRANSLATORS) - MSG_165 should be altered to say image - NEW message for wrong MSG_044 in _StrError() - NEW message for Alt-I toggle - NEW message for Alt-U toggle - - NEW message for ERROR_NOT_READY \ No newline at end of file + - NEW message for ERROR_NOT_READY + - NEW message for "This ISO is not compatible with the selected filesystem" (rufus.c ~1407) \ No newline at end of file diff --git a/src/drive.c b/src/drive.c index f86f016f..239ca66c 100644 --- a/src/drive.c +++ b/src/drive.c @@ -514,7 +514,8 @@ const struct {int (*fn)(FILE *fp); char* str;} known_mbr[] = { { is_win7_mbr, "Windows 7" }, { is_rufus_mbr, "Rufus" }, { is_syslinux_mbr, "Syslinux" }, - { is_reactos_mbr, "Reactos" }, + { is_reactos_mbr, "ReactOS" }, + { is_kolibri_mbr, "KolibriOS" }, { is_zero_mbr, "Zeroed" }, }; @@ -551,6 +552,7 @@ const struct {int (*fn)(FILE *fp); char* str;} known_pbr[] = { { entire_fat_32_nt_br_matches, "FAT32 NT" }, { entire_fat_32_fd_br_matches, "FAT32 FreeDOS" }, { entire_fat_32_ros_br_matches, "FAT32 ReactOS" }, + { entire_fat_32_kos_br_matches, "FAT32 KolibriOS" }, }; BOOL AnalyzePBR(HANDLE hLogicalVolume) diff --git a/src/format.c b/src/format.c index 27e76bb4..9acc035b 100644 --- a/src/format.c +++ b/src/format.c @@ -907,6 +907,9 @@ static BOOL WriteMBR(HANDLE hPhysicalDrive) if (bt == BT_UEFI) { uprintf(using_msg, "zeroed"); r = write_zero_mbr(&fake_fd); // Force UEFI boot only by zeroing the MBR + } else if ( (dt == DT_ISO) && (iso_report.has_kolibrios) && (fs == FS_FAT32)) { + uprintf(using_msg, "KolibriOS"); + r = write_kolibri_mbr(&fake_fd); } else if ( (dt == DT_SYSLINUX_V4) || (dt == DT_SYSLINUX_V5) || ((dt == DT_ISO) && ((fs == FS_FAT16) || (fs == FS_FAT32))) ) { uprintf(using_msg, "Syslinux"); r = write_syslinux_mbr(&fake_fd); @@ -939,7 +942,8 @@ static __inline const char* dt_to_name(int dt) { switch (dt) { case DT_FREEDOS: return "FreeDOS"; case DT_REACTOS: return "ReactOS"; - default: return "Standard"; + default: + return ((dt==DT_ISO)&&(iso_report.has_kolibrios))?"KolibriOS":"Standard"; } } static BOOL WritePBR(HANDLE hLogicalVolume) @@ -964,6 +968,8 @@ static BOOL WritePBR(HANDLE hLogicalVolume) if (!write_fat_16_fd_br(&fake_fd, 0)) break; } else if (dt == DT_REACTOS) { if (!write_fat_16_ros_br(&fake_fd, 0)) break; + } else if ((dt == DT_ISO) && (iso_report.has_kolibrios)) { + uprintf("FAT16 is not supported for KolibriOS\n"); break; } else { if (!write_fat_16_br(&fake_fd, 0)) break; } @@ -984,6 +990,8 @@ static BOOL WritePBR(HANDLE hLogicalVolume) if (!write_fat_32_fd_br(&fake_fd, 0)) break; } else if (dt == DT_REACTOS) { if (!write_fat_32_ros_br(&fake_fd, 0)) break; + } else if ((dt == DT_ISO) && (iso_report.has_kolibrios)) { + if (!write_fat_32_kos_br(&fake_fd, 0)) break; } else { if (!write_fat_32_br(&fake_fd, 0)) break; } @@ -1218,6 +1226,7 @@ DWORD WINAPI FormatThread(void* param) char logfile[MAX_PATH], *userdir; char wim_image[] = "?:\\sources\\install.wim"; char efi_dst[] = "?:\\efi\\boot\\bootx64.efi"; + char kolibri_dst[] = "?:\\MTLD_F32"; PF_TYPE_DECL(WINAPI, LANGID, GetThreadUILanguage, (void)); PF_TYPE_DECL(WINAPI, LANGID, SetThreadUILanguage, (LANGID)); @@ -1494,7 +1503,7 @@ DWORD WINAPI FormatThread(void* param) goto out; } } else if ((((dt == DT_WINME) || (dt == DT_FREEDOS) || (dt == DT_REACTOS)) && - (!use_large_fat32)) || ((dt == DT_ISO) && (fs == FS_NTFS))) { + (!use_large_fat32)) || ((dt == DT_ISO) && ((fs == FS_NTFS)||(iso_report.has_kolibrios)))) { // We still have a lock, which we need to modify the volume boot record // => no need to reacquire the lock... hLogicalVolume = GetLogicalHandle(DriveIndex, TRUE, FALSE); @@ -1550,6 +1559,14 @@ DWORD WINAPI FormatThread(void* param) FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_CANNOT_COPY; goto out; } + if (iso_report.has_kolibrios) { + kolibri_dst[0] = drive_name[0]; + uprintf("Installing: %s (KolibriOS loader)\n", kolibri_dst); + if (ExtractISOFile(iso_path, "HD_Load/USB_Boot/MTLD_F32", kolibri_dst, + FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM) == 0) { + uprintf("Warning: loader installation failed - KolibriOS will not boot!\n"); + } + } if ((bt == BT_UEFI) && (!iso_report.has_efi) && (iso_report.has_win7_efi)) { PrintStatus(0, TRUE, MSG_232); wim_image[0] = drive_name[0]; diff --git a/src/iso.c b/src/iso.c index 3ac5bc95..94faf404 100644 --- a/src/iso.c +++ b/src/iso.c @@ -67,6 +67,7 @@ static const char* isolinux_bin = &dot_isolinux_bin[2]; static const char* pe_dirname[] = { "/i386", "/minint" }; static const char* pe_file[] = { "ntdetect.com", "setupldr.bin", "txtsetup.sif" }; static const char* reactos_name = "setupldr.sys"; // TODO: freeldr.sys doesn't seem to work +static const char* kolibri_name = "kolibri.img"; static const char* autorun_name = "autorun.inf"; static const char* stupid_antivirus = " NOTE: This is usually caused by a poorly designed security solution. " "See http://rufus.akeo.ie/compatibility.\r\n This file will be skipped for now, but you should really " @@ -137,7 +138,7 @@ static BOOL check_iso_props(const char* psz_dirname, BOOL* is_syslinux_cfg, BOOL } if (scan_only) { - // Check for a "bootmgr(.efi)" file in root (psz_path = "") + // Check for various files in root (psz_dirname = "") if (*psz_dirname == 0) { if (safe_strnicmp(psz_basename, bootmgr_efi_name, safe_strlen(bootmgr_efi_name)-5) == 0) { iso_report.has_bootmgr = TRUE; @@ -145,6 +146,9 @@ static BOOL check_iso_props(const char* psz_dirname, BOOL* is_syslinux_cfg, BOOL if (safe_stricmp(psz_basename, bootmgr_efi_name) == 0) { iso_report.has_win7_efi = TRUE; } + if (safe_stricmp(psz_basename, kolibri_name) == 0) { + iso_report.has_kolibrios = TRUE; + } } // Check for ReactOS' setupldr.sys anywhere @@ -591,7 +595,7 @@ out: uprintf("Will use %s for Syslinux\n", iso_report.cfg_path); // Extract all of the isolinux.bin files we found to identify their versions for (i=0; i + @@ -49,6 +50,7 @@ + diff --git a/src/ms-sys/.msvc/ms-sys.vcxproj.filters b/src/ms-sys/.msvc/ms-sys.vcxproj.filters index fcb101ce..a96c8fa2 100644 --- a/src/ms-sys/.msvc/ms-sys.vcxproj.filters +++ b/src/ms-sys/.msvc/ms-sys.vcxproj.filters @@ -125,6 +125,12 @@ Header Files + + Header Files + + + Header Files + diff --git a/src/ms-sys/br.c b/src/ms-sys/br.c index 7f232622..a2dd2081 100644 --- a/src/ms-sys/br.c +++ b/src/ms-sys/br.c @@ -120,6 +120,16 @@ int is_reactos_mbr(FILE *fp) contains_data(fp, 0x1FE, aucRef, sizeof(aucRef)); } /* is_reactos_mbr */ +int is_kolibri_mbr(FILE *fp) +{ + #include "mbr_kolibri.h" + unsigned char aucRef[] = {0x55, 0xAA}; + + return + contains_data(fp, 0x0, mbr_kolibri_0x0, sizeof(mbr_kolibri_0x0)) && + contains_data(fp, 0x1FE, aucRef, sizeof(aucRef)); +} /* is_kolibri_mbr */ + int is_syslinux_mbr(FILE *fp) { #include "mbr_syslinux.h" @@ -210,6 +220,16 @@ int write_reactos_mbr(FILE *fp) write_data(fp, 0x1FE, aucRef, sizeof(aucRef)); } /* write_reactos_mbr */ +int write_kolibri_mbr(FILE *fp) +{ + #include "mbr_kolibri.h" + unsigned char aucRef[] = {0x55, 0xAA}; + + return + write_data(fp, 0x0, mbr_kolibri_0x0, sizeof(mbr_kolibri_0x0)) && + write_data(fp, 0x1FE, aucRef, sizeof(aucRef)); +} /* write_kolibri_mbr */ + int write_syslinux_mbr(FILE *fp) { #include "mbr_syslinux.h" diff --git a/src/ms-sys/fat32.c b/src/ms-sys/fat32.c index b2b398b0..7c4322b4 100644 --- a/src/ms-sys/fat32.c +++ b/src/ms-sys/fat32.c @@ -220,3 +220,30 @@ int write_fat_32_ros_br(FILE *fp, int bKeepLabel) write_data(fp, 0x1c00, br_fat32ros_0x1c00, sizeof(br_fat32ros_0x1c00)) ); } /* write_fat_32_ros_br */ + +int entire_fat_32_kos_br_matches(FILE *fp) +{ + #include "br_fat32_0x0.h" + #include "br_fat32kos_0x52.h" + + return + ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && + contains_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) ); +} /* entire_fat_32_kos_br_matches */ + +int write_fat_32_kos_br(FILE *fp, int bKeepLabel) +{ + #include "label_11_char.h" + #include "br_fat32_0x0.h" + #include "br_fat32kos_0x52.h" + + if(bKeepLabel) + return + ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && + write_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) ); + else + return + ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && + write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) && + write_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) ); +} /* write_fat_32_kos_br */ diff --git a/src/ms-sys/inc/br.h b/src/ms-sys/inc/br.h index fb42a2fd..1eb0babd 100644 --- a/src/ms-sys/inc/br.h +++ b/src/ms-sys/inc/br.h @@ -44,6 +44,10 @@ int is_rufus_mbr(FILE *fp); FALSE.The file position will change when this function is called! */ int is_reactos_mbr(FILE *fp); +/* returns TRUE if the file has a KolibriOS master boot record, otherwise + FALSE.The file position will change when this function is called! */ +int is_kolibri_mbr(FILE *fp); + /* returns TRUE if the file has a syslinux master boot record, otherwise FALSE.The file position will change when this function is called! */ int is_syslinux_mbr(FILE *fp); @@ -80,6 +84,10 @@ int write_rufus_mbr(FILE *fp); FALSE */ int write_reactos_mbr(FILE *fp); +/* Writes a KolibriOS master boot record to a file, returns TRUE on success, otherwise + FALSE */ +int write_kolibri_mbr(FILE *fp); + /* Writes a syslinux master boot record to a file, returns TRUE on success, otherwise FALSE */ int write_syslinux_mbr(FILE *fp); diff --git a/src/ms-sys/inc/br_fat32kos_0x52.h b/src/ms-sys/inc/br_fat32kos_0x52.h new file mode 100644 index 00000000..8c643e86 --- /dev/null +++ b/src/ms-sys/inc/br_fat32kos_0x52.h @@ -0,0 +1,38 @@ +unsigned char br_fat32kos_0x52[] = { + 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x80, 0x3C, 0x80, 0x75, + 0x09, 0x66, 0x8B, 0x44, 0x08, 0x2E, 0x66, 0xA3, 0x1C, 0x7C, 0x66, 0x31, + 0xC0, 0x8E, 0xD8, 0x8E, 0xD0, 0xBC, 0x00, 0x7C, 0x89, 0xE5, 0x88, 0x16, + 0x08, 0x7A, 0xFC, 0xFB, 0x68, 0x00, 0x08, 0x07, 0x66, 0x0F, 0xB7, 0x5E, + 0x0E, 0x66, 0x89, 0x1E, 0x00, 0x7A, 0x8A, 0x46, 0x10, 0x66, 0xF7, 0x66, + 0x24, 0x66, 0x01, 0xD8, 0x66, 0x0F, 0xB6, 0x5E, 0x0D, 0x01, 0xDB, 0x66, + 0x29, 0xD8, 0x66, 0xA3, 0x04, 0x7A, 0x66, 0x8B, 0x46, 0x2C, 0x66, 0x25, + 0xFF, 0xFF, 0xFF, 0x0F, 0x31, 0xDB, 0x89, 0xDF, 0x66, 0x50, 0xE8, 0x62, + 0x00, 0x0F, 0xB6, 0x4E, 0x0D, 0xC1, 0xE1, 0x04, 0x26, 0x80, 0x3D, 0x00, + 0x74, 0x4D, 0x51, 0x57, 0xB9, 0x0B, 0x00, 0xBE, 0xCB, 0x7D, 0xF3, 0xA6, + 0x5F, 0x59, 0x74, 0x0E, 0x83, 0xC7, 0x20, 0xE2, 0xE7, 0x66, 0x58, 0xE8, + 0x8D, 0x00, 0x73, 0x33, 0x72, 0xCE, 0x66, 0x58, 0x26, 0x8B, 0x45, 0x14, + 0x25, 0xFF, 0x0F, 0x66, 0xC1, 0xE0, 0x10, 0x26, 0x8B, 0x45, 0x1A, 0x31, + 0xDB, 0x66, 0x50, 0xE8, 0x21, 0x00, 0x8C, 0xC0, 0x0F, 0xB6, 0x4E, 0x0D, + 0xC1, 0xE1, 0x05, 0x01, 0xC8, 0x8E, 0xC0, 0x66, 0x58, 0xE8, 0x5F, 0x00, + 0x72, 0xE5, 0xEA, 0x00, 0x80, 0x00, 0x00, 0xBE, 0xBA, 0x7D, 0xE8, 0x98, + 0x00, 0xEB, 0xFE, 0x66, 0x0F, 0xB6, 0x4E, 0x0D, 0x66, 0xF7, 0xE1, 0x66, + 0x03, 0x06, 0x04, 0x7A, 0x66, 0x03, 0x46, 0x1C, 0x06, 0x66, 0x60, 0x6A, + 0x00, 0x6A, 0x00, 0x66, 0x50, 0x06, 0x53, 0x83, 0xE9, 0x7F, 0x19, 0xC0, + 0x21, 0xC8, 0x83, 0xC0, 0x7F, 0x50, 0xC1, 0xE0, 0x05, 0x8C, 0xC1, 0x01, + 0xC1, 0x8E, 0xC1, 0x6A, 0x10, 0xB8, 0x00, 0x42, 0x8A, 0x16, 0x08, 0x7A, + 0x89, 0xE6, 0xCD, 0x13, 0xBE, 0xD9, 0x7D, 0x72, 0xB9, 0x61, 0x66, 0x61, + 0x66, 0x83, 0xC0, 0x7F, 0x83, 0xE9, 0x7F, 0x77, 0xC4, 0x07, 0xC3, 0x06, + 0x1E, 0x07, 0xBB, 0x00, 0x7E, 0x66, 0x50, 0x66, 0xC1, 0xE8, 0x07, 0x66, + 0x3B, 0x06, 0xF9, 0x7D, 0x74, 0x0F, 0x66, 0xA3, 0xF9, 0x7D, 0x66, 0x03, + 0x06, 0x00, 0x7A, 0xB9, 0x01, 0x00, 0xE8, 0x9B, 0xFF, 0x66, 0x58, 0x66, + 0x83, 0xE0, 0x7F, 0x67, 0x66, 0x8B, 0x04, 0x85, 0x00, 0x7E, 0x00, 0x00, + 0x66, 0x25, 0xFF, 0xFF, 0xFF, 0x0F, 0x66, 0x3D, 0xF7, 0xFF, 0xFF, 0x0F, + 0xBE, 0xEB, 0x7D, 0x0F, 0x84, 0x67, 0xFF, 0x07, 0xC3, 0xAC, 0x84, 0xC0, + 0x74, 0x09, 0xB4, 0x0E, 0xBB, 0x07, 0x00, 0xCD, 0x10, 0xEB, 0xF2, 0xC3, + 0x43, 0x61, 0x6E, 0x6E, 0x6F, 0x74, 0x20, 0x66, 0x69, 0x6E, 0x64, 0x20, + 0x66, 0x69, 0x6C, 0x65, 0x20, 0x4D, 0x54, 0x4C, 0x44, 0x5F, 0x46, 0x33, + 0x32, 0x20, 0x20, 0x20, 0x0D, 0x0A, 0x00, 0x44, 0x69, 0x73, 0x6B, 0x20, + 0x72, 0x65, 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x0D, 0x0A, + 0x00, 0x42, 0x61, 0x64, 0x20, 0x63, 0x6C, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x0D, 0x0A, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x55, 0xAA +}; diff --git a/src/ms-sys/inc/fat32.h b/src/ms-sys/inc/fat32.h index 7738b8ba..c535cb39 100644 --- a/src/ms-sys/inc/fat32.h +++ b/src/ms-sys/inc/fat32.h @@ -47,4 +47,13 @@ int entire_fat_32_ros_br_matches(FILE *fp); FALSE */ int write_fat_32_ros_br(FILE *fp, int bKeepLabel); +/* returns TRUE if the file has an exact match of the FAT32 boot record this + program would create for KolibriOS, otherwise FALSE. + The file position will change when this function is called! */ +int entire_fat_32_kos_br_matches(FILE *fp); + +/* Writes a FAT32 KolibriOS boot record to a file, returns TRUE on success, otherwise + FALSE */ +int write_fat_32_kos_br(FILE *fp, int bKeepLabel); + #endif diff --git a/src/ms-sys/inc/mbr_kolibri.h b/src/ms-sys/inc/mbr_kolibri.h new file mode 100644 index 00000000..4ad253ac --- /dev/null +++ b/src/ms-sys/inc/mbr_kolibri.h @@ -0,0 +1,40 @@ +/* First 440 bytes of MBR from KolibriOS */ +unsigned char mbr_kolibri_0x0[] = { + 0x33, 0xC0, 0x8E, 0xD0, 0xBC, 0x00, 0x7C, 0xFB, 0x50, 0x07, 0x50, 0x1F, + 0xFC, 0xBE, 0x1B, 0x7C, 0xBF, 0x1B, 0x06, 0x50, 0x57, 0xB9, 0xE5, 0x01, + 0xF3, 0xA4, 0xCB, 0xBD, 0xBE, 0x07, 0xB1, 0x04, 0x38, 0x6E, 0x00, 0x7C, + 0x09, 0x75, 0x13, 0x83, 0xC5, 0x10, 0xE2, 0xF4, 0xCD, 0x18, 0x8B, 0xF5, + 0x83, 0xC6, 0x10, 0x49, 0x74, 0x19, 0x38, 0x2C, 0x74, 0xF6, 0xA0, 0xB5, + 0x07, 0xB4, 0x07, 0x8B, 0xF0, 0xAC, 0x3C, 0x00, 0x74, 0xFC, 0xBB, 0x07, + 0x00, 0xB4, 0x0E, 0xCD, 0x10, 0xEB, 0xF2, 0x88, 0x4E, 0x10, 0xE8, 0x46, + 0x00, 0x73, 0x2A, 0xFE, 0x46, 0x10, 0x80, 0x7E, 0x04, 0x0B, 0x74, 0x0B, + 0x80, 0x7E, 0x04, 0x0C, 0x74, 0x05, 0xA0, 0xB6, 0x07, 0x75, 0xD2, 0x80, + 0x46, 0x02, 0x06, 0x83, 0x46, 0x08, 0x06, 0x83, 0x56, 0x0A, 0x00, 0xE8, + 0x21, 0x00, 0x73, 0x05, 0xA0, 0xB6, 0x07, 0xEB, 0xBC, 0x81, 0x3E, 0xFE, + 0x7D, 0x55, 0xAA, 0x74, 0x0B, 0x80, 0x7E, 0x10, 0x00, 0x74, 0xC8, 0xA0, + 0xB7, 0x07, 0xEB, 0xA9, 0x8B, 0xFC, 0x1E, 0x57, 0x8B, 0xF5, 0xCB, 0xBF, + 0x05, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, + 0x90, 0x90, 0x90, 0x90, 0x90, 0x60, 0xBB, 0xAA, 0x55, 0xB4, 0x41, 0xCD, + 0x13, 0x72, 0x36, 0x81, 0xFB, 0x55, 0xAA, 0x75, 0x30, 0xF6, 0xC1, 0x01, + 0x74, 0x2B, 0x61, 0x60, 0x6A, 0x00, 0x6A, 0x00, 0xFF, 0x76, 0x0A, 0xFF, + 0x76, 0x08, 0x6A, 0x00, 0x68, 0x00, 0x7C, 0x6A, 0x01, 0x6A, 0x10, 0xB4, + 0x42, 0x8B, 0xF4, 0xCD, 0x13, 0x61, 0x61, 0x73, 0x0E, 0x4F, 0x74, 0x0B, + 0x32, 0xE4, 0x52, 0xCD, 0x13, 0x5A, 0x90, 0xEB, 0xD6, 0x61, 0xF9, 0xC3, + 0x49, 0x6E, 0x76, 0x61, 0x6C, 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x00, + 0x45, 0x72, 0x72, 0x6F, 0x72, 0x20, 0x6C, 0x6F, 0x61, 0x64, 0x69, 0x6E, + 0x67, 0x20, 0x6F, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67, 0x20, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x4D, 0x69, 0x73, 0x73, 0x69, + 0x6E, 0x67, 0x20, 0x6F, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67, + 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x44, 0x63 +}; diff --git a/src/rufus.c b/src/rufus.c index b41ecf41..ffb0a2d3 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -450,10 +450,10 @@ static void SetFSFromISO(void) } // Syslinux and EFI have precedence over bootmgr (unless the user selected BIOS as target type) - if ((HAS_SYSLINUX(iso_report)) || (IS_REACTOS(iso_report)) || ( (IS_EFI(iso_report)) && (bt == BT_UEFI))) { + if ((HAS_SYSLINUX(iso_report)) || (IS_REACTOS(iso_report)) || (iso_report.has_kolibrios) || ( (IS_EFI(iso_report)) && (bt == BT_UEFI))) { if (fs_mask & (1<64 chars filename: %s\r\n Has Symlinks: %s\r\n Has a >4GB file: %s\r\n" - " Uses ReactOS: %s\r\n Uses EFI: %s%s\r\n Uses Bootmgr: %s\r\n Uses WinPE: %s%s\r\n Uses isolinux: %s\r\n", + " Uses ReactOS: %s\r\n Uses KolibriOS: %s\r\n Uses EFI: %s%s\r\n Uses Bootmgr: %s\r\n Uses WinPE: %s%s\r\n Uses isolinux: %s\r\n", iso_report.label, iso_report.projected_size, iso_report.has_long_filename?"Yes":"No", iso_report.has_symlinks?"Yes":"No", - iso_report.has_4GB_file?"Yes":"No", IS_REACTOS(iso_report)?"Yes":"No", (iso_report.has_efi || iso_report.has_win7_efi)?"Yes":"No", + iso_report.has_4GB_file?"Yes":"No", IS_REACTOS(iso_report)?"Yes":"No", iso_report.has_kolibrios?"Yes":"No", (iso_report.has_efi || iso_report.has_win7_efi)?"Yes":"No", (iso_report.has_win7_efi && (!iso_report.has_efi))?" (win7_x64)":"", iso_report.has_bootmgr?"Yes":"No", IS_WINPE(iso_report.winpe)?"Yes":"No", (iso_report.uses_minint)?" (with /minint)":"", isolinux_str); if (HAS_SYSLINUX(iso_report) && (SL_MAJOR(iso_report.sl_version) < 5)) { @@ -1234,7 +1235,7 @@ DWORD WINAPI ISOScanThread(LPVOID param) } } if ( (!iso_report.has_bootmgr) && (!HAS_SYSLINUX(iso_report)) && (!IS_WINPE(iso_report.winpe)) - && (!iso_report.has_efi) && (!IS_REACTOS(iso_report) && (!iso_report.is_bootable_img)) ) { + && (!iso_report.has_efi) && (!IS_REACTOS(iso_report) && (!iso_report.has_kolibrios) && (!iso_report.is_bootable_img)) ) { MessageBoxU(hMainDialog, lmprintf(MSG_082), lmprintf(MSG_081), MB_OK|MB_ICONINFORMATION|MB_IS_RTL); safe_free(iso_path); SetMBRProps(); @@ -1401,7 +1402,12 @@ static BOOL BootCheck(void) MessageBoxU(hMainDialog, lmprintf(MSG_097), lmprintf(MSG_090), MB_OK|MB_ICONERROR|MB_IS_RTL); } return FALSE; - } else if (((fs == FS_FAT16)||(fs == FS_FAT32)) && (!HAS_SYSLINUX(iso_report)) && (!IS_REACTOS(iso_report))) { + } else if ((fs == FS_FAT16) && (iso_report.has_kolibrios)) { + // KolibriOS doesn't support FAT16 + MessageBoxU(hMainDialog, "This ISO is not compatible with the selected filesystem", lmprintf(MSG_099), MB_OK|MB_ICONERROR|MB_IS_RTL); + return FALSE; + } else if (((fs == FS_FAT16)||(fs == FS_FAT32)) && (!HAS_SYSLINUX(iso_report)) && + (!IS_REACTOS(iso_report)) && (!iso_report.has_kolibrios)) { // FAT/FAT32 can only be used for isolinux based ISO images or when the Target Type is UEFI MessageBoxU(hMainDialog, lmprintf(MSG_098), lmprintf(MSG_090), MB_OK|MB_ICONERROR|MB_IS_RTL); return FALSE; diff --git a/src/rufus.h b/src/rufus.h index a0c9910e..18898b7b 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -245,6 +245,7 @@ typedef struct { BOOL has_autorun; BOOL has_old_c32[NB_OLD_C32]; BOOL has_old_vesamenu; + BOOL has_kolibrios; BOOL uses_minint; BOOL is_bootable_img; uint16_t sl_version; // Syslinux/Isolinux version @@ -337,7 +338,7 @@ extern BOOL Notification(int type, const notification_info* more_info, char* tit extern BOOL Question(char* title, char* format, ...); extern BOOL ExtractDOS(const char* path); extern BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan); -extern int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file); +extern int64_t ExtractISOFile(const char* iso, const char* iso_file, const char* dest_file, DWORD attributes); extern BOOL InstallSyslinux(DWORD drive_index, char drive_letter); DWORD WINAPI FormatThread(void* param); extern BOOL CreateProgress(void); diff --git a/src/rufus.rc b/src/rufus.rc index 8693a13a..15a8bb6d 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 206, 329 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Rufus 1.4.8.463" +CAPTION "Rufus 1.4.8.464" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -165,7 +165,7 @@ END RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL -CAPTION "Rufus 1.4.8.463" +CAPTION "Rufus 1.4.8.464" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -427,8 +427,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,8,463 - PRODUCTVERSION 1,4,8,463 + FILEVERSION 1,4,8,464 + PRODUCTVERSION 1,4,8,464 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -445,13 +445,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.8.463" + VALUE "FileVersion", "1.4.8.464" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.4.8.463" + VALUE "ProductVersion", "1.4.8.464" END END BLOCK "VarFileInfo"