1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

Merge branch 'master' into localization

Conflicts:
	src/rufus.c
This commit is contained in:
Pete Batard 2013-07-21 21:33:02 +01:00
commit c7c297994d
6 changed files with 85 additions and 37 deletions

View file

@ -2,7 +2,7 @@ o Version 1.3.4 (2013.07.15)
Syslinux v5 support (NEW) Syslinux v5 support (NEW)
UDF formatting support (NEW - Vista and later only) UDF formatting support (NEW - Vista and later only)
More drive handling improvements, to avoid "Could not open media" errors More drive handling improvements, to avoid "Could not open media" errors
Fixed support for ISOs with files larger than 4GB files Fixed support for ISOs containing files larger than 4GB
Fixed elevation request for unprivileged users Fixed elevation request for unprivileged users
Fixed download of c32 files into the application directory Fixed download of c32 files into the application directory
Better compression algorithm for the executable Better compression algorithm for the executable

View file

@ -29,23 +29,23 @@
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
@ -85,6 +85,8 @@
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -95,6 +97,7 @@
</Link> </Link>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture />
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -108,6 +111,8 @@
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -118,6 +123,7 @@
</Link> </Link>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture />
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -127,6 +133,8 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -137,6 +145,7 @@
</Link> </Link>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture />
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -149,6 +158,8 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>setupapi.lib;comctl32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -159,6 +170,7 @@
</Link> </Link>
<ResourceCompile> <ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture />
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>

View file

@ -159,46 +159,59 @@ static const char* fd_kb4[] = {
typedef struct { typedef struct {
const char* name; const char* name;
ULONG default_cp;
} kb_default;
static kb_default kbdrv_data[] = {
{ "keyboard.sys", 437 },
{ "keybrd2.sys", 850 },
{ "keybrd3.sys", 850 },
{ "keybrd4.sys", 853 }
};
typedef struct {
size_t size; size_t size;
const char** list; const char** list;
} kb_list; } kb_list;
static kb_list ms_kb_list[] = { static kb_list ms_kb_list[] = {
{"keyboard.sys", ARRAYSIZE(ms_kb1), ms_kb1}, { ARRAYSIZE(ms_kb1), ms_kb1 },
{"kbrd2.sys", ARRAYSIZE(ms_kb2), ms_kb2}, { ARRAYSIZE(ms_kb2), ms_kb2 },
{"kbrd3.sys", ARRAYSIZE(ms_kb3), ms_kb3}, { ARRAYSIZE(ms_kb3), ms_kb3 },
{"kbrd3.sys", ARRAYSIZE(ms_kb4), ms_kb4} }; { ARRAYSIZE(ms_kb4), ms_kb4 }
};
static kb_list fd_kb_list[] = { static kb_list fd_kb_list[] = {
{"keyboard.sys", ARRAYSIZE(fd_kb1), fd_kb1}, { ARRAYSIZE(fd_kb1), fd_kb1 },
{"kbrd2.sys", ARRAYSIZE(fd_kb2), fd_kb2}, { ARRAYSIZE(fd_kb2), fd_kb2 },
{"kbrd3.sys", ARRAYSIZE(fd_kb3), fd_kb3}, { ARRAYSIZE(fd_kb3), fd_kb3 },
{"kbrd3.sys", ARRAYSIZE(fd_kb4), fd_kb4} }; { ARRAYSIZE(fd_kb4), fd_kb4 }
};
static const char* ms_get_kbdrv(const char* kb) static int ms_get_kbdrv(const char* kb)
{ {
unsigned int i, j; unsigned int i, j;
for (i=0; i<ARRAYSIZE(ms_kb_list); i++) { for (i=0; i<ARRAYSIZE(ms_kb_list); i++) {
for (j=0; j<ms_kb_list[i].size; j++) { for (j=0; j<ms_kb_list[i].size; j++) {
if (safe_strcmp(ms_kb_list[i].list[j], kb) == 0) { if (safe_strcmp(ms_kb_list[i].list[j], kb) == 0) {
return ms_kb_list[i].name; return i;
} }
} }
} }
return NULL; return -1;
} }
static const char* fd_get_kbdrv(const char* kb) static int fd_get_kbdrv(const char* kb)
{ {
unsigned int i, j; unsigned int i, j;
for (i=0; i<ARRAYSIZE(fd_kb_list); i++) { for (i=0; i<ARRAYSIZE(fd_kb_list); i++) {
for (j=0; j<fd_kb_list[i].size; j++) { for (j=0; j<fd_kb_list[i].size; j++) {
if (safe_strcmp(fd_kb_list[i].list[j], kb) == 0) { if (safe_strcmp(fd_kb_list[i].list[j], kb) == 0) {
return fd_kb_list[i].name; return i;
} }
} }
} }
return NULL; return -1;
} }
/* /*
@ -206,7 +219,7 @@ static const char* fd_get_kbdrv(const char* kb)
* As real estate might be limited, keep it short * As real estate might be limited, keep it short
*/ */
static const char* kb_hr_list[][2] = { static const char* kb_hr_list[][2] = {
{"ar", "Arabic"}, {"ar", "Arabic"}, // Left enabled, but doesn't seem to work in FreeDOS
{"bg", "Bulgarian"}, {"bg", "Bulgarian"},
{"ch", "Chinese"}, {"ch", "Chinese"},
{"cz", "Czech"}, {"cz", "Czech"},
@ -332,6 +345,16 @@ static cp_list cp_hr_list[] = {
{ 1119, "Cyr-Russian (Alt)"}, { 1119, "Cyr-Russian (Alt)"},
{ 1125, "Cyr-Ukrainian"}, { 1125, "Cyr-Ukrainian"},
{ 1131, "Cyr-Belarusian"}, { 1131, "Cyr-Belarusian"},
{ 1250, "Central European"},
{ 1251, "Cyrillic"},
{ 1252, "Western European"},
{ 1253, "Greek"},
{ 1254, "Turkish"},
{ 1255, "Hebrew"},
{ 1256, "Arabic"},
{ 1257, "Baltic"},
{ 1258, "Vietnamese"},
{ 1361, "Korean"},
{ 3012, "Cyr-Latvian"}, { 3012, "Cyr-Latvian"},
{ 3021, "Cyr-Bulgarian"}, { 3021, "Cyr-Bulgarian"},
{ 3845, "Hungarian"}, { 3845, "Hungarian"},
@ -931,14 +954,14 @@ BOOL SetDOSLocale(const char* path, BOOL bFreeDOS)
char filename[MAX_PATH]; char filename[MAX_PATH];
ULONG cp; ULONG cp;
const char *kb; const char *kb;
const char* kbdrv; int kbdrv;
const char* egadrv; const char* egadrv;
// First handle the codepage // First handle the codepage
kb = get_kb(); kb = get_kb();
// We have a keyboard ID, but that doesn't mean it's supported // We have a keyboard ID, but that doesn't mean it's supported
kbdrv = bFreeDOS?fd_get_kbdrv(kb):ms_get_kbdrv(kb); kbdrv = bFreeDOS?fd_get_kbdrv(kb):ms_get_kbdrv(kb);
if (kbdrv == NULL) { if (kbdrv < 0) {
uprintf("Keyboard id '%s' is not supported - falling back to 'us'\n", kb); uprintf("Keyboard id '%s' is not supported - falling back to 'us'\n", kb);
kb = "us"; kb = "us";
kbdrv = bFreeDOS?fd_get_kbdrv(kb):ms_get_kbdrv(kb); // Always succeeds kbdrv = bFreeDOS?fd_get_kbdrv(kb):ms_get_kbdrv(kb); // Always succeeds
@ -949,9 +972,10 @@ BOOL SetDOSLocale(const char* path, BOOL bFreeDOS)
cp = GetOEMCP(); cp = GetOEMCP();
egadrv = bFreeDOS?fd_get_ega(cp):ms_get_ega(cp); egadrv = bFreeDOS?fd_get_ega(cp):ms_get_ega(cp);
if (egadrv == NULL) { if (egadrv == NULL) {
uprintf("Unable to find EGA for codepage %d - falling back to 437\n"); // We need to use the fallback CP from the keyboard we got above, as 437 is not always available
cp = 437; uprintf("Unable to find an EGA file with codepage %d [%s]\n", cp, cp_to_hr(cp));
egadrv = bFreeDOS?"eag.cpx":"ega.cpi"; cp = kbdrv_data[kbdrv].default_cp;
egadrv = bFreeDOS?"ega.cpx":"ega.cpi";
} else if (bFreeDOS) { } else if (bFreeDOS) {
cp = fd_upgrade_cp(cp); cp = fd_upgrade_cp(cp);
} }
@ -1015,7 +1039,7 @@ BOOL SetDOSLocale(const char* path, BOOL bFreeDOS)
fprintf(fd, ":1\n"); fprintf(fd, ":1\n");
fprintf(fd, "mode con codepage prepare=((%d) \\locale\\%s) > NUL\n", (int)cp, egadrv); fprintf(fd, "mode con codepage prepare=((%d) \\locale\\%s) > NUL\n", (int)cp, egadrv);
fprintf(fd, "mode con codepage select=%d > NUL\n", (int)cp); fprintf(fd, "mode con codepage select=%d > NUL\n", (int)cp);
fprintf(fd, "keyb %s,,\\locale\\%s\n", kb, kbdrv); fprintf(fd, "keyb %s,,\\locale\\%s\n", kb, kbdrv_data[kbdrv].name);
fprintf(fd, ":2\n"); fprintf(fd, ":2\n");
fclose(fd); fclose(fd);
uprintf("Successfully wrote 'AUTOEXEC.BAT'\n"); uprintf("Successfully wrote 'AUTOEXEC.BAT'\n");

View file

@ -29,15 +29,30 @@
/* Define to 1 if you have the <fcntl.h> header file. */ /* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1 #define HAVE_FCNTL_H 1
/* Define to 1 if you have the `lseek64' function. */
#define HAVE_LSEEK64 1
/* The equivalent of lseek64 on MSVC is _lseeki64 */
#define lseek64 _lseeki64
/* Define to 1 if you have the `fseeko' function. */ /* Define to 1 if you have the `fseeko' function. */
/* #undef HAVE_FSEEKO */ /* #undef HAVE_FSEEKO */
/* Define to 1 if you have the `fseeko64' function. */ /* Define to 1 if you have the `fseeko64' function. */
#define HAVE_FSEEKO64 1 #define HAVE_FSEEKO64 1
/* The equivalent of fseeko64 for MSVC is _fseeki64 */
#if defined(_MSC_VER) #if defined(_MSC_VER)
/* The equivalent of fseeko64 for MSVC is _fseeki64, however this */
/* is not available on XP when build with WDK (but _lseeki64 is) */
#if defined(DDKBUILD)
#include <windows.h>
#include <stdio.h>
#include <io.h>
static __inline int fseeko64(FILE *stream, __int64 offset, int origin) {
return (lseek64(_fileno(stream), offset, origin) == -1L)?-1:0;
}
#else
#define fseeko64 _fseeki64 #define fseeko64 _fseeki64
#endif #endif
#endif
/* Define to 1 if you have the `ftruncate' function. */ /* Define to 1 if you have the `ftruncate' function. */
/* #undef HAVE_FTRUNCATE */ /* #undef HAVE_FTRUNCATE */
@ -58,11 +73,6 @@
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1 #define HAVE_LIMITS_H 1
/* Define to 1 if you have the `lseek64' function. */
#define HAVE_LSEEK64 1
/* The equivalent of lseek64 on MSVC is _lseeki64 */
#define lseek64 _lseeki64
/* Define to 1 if you have the `lstat' function. */ /* Define to 1 if you have the `lstat' function. */
/* #undef HAVE_LSTAT */ /* #undef HAVE_LSTAT */

View file

@ -30,7 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329 IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.3.4.270" CAPTION "Rufus v1.3.4.275"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -278,8 +278,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,4,270 FILEVERSION 1,3,4,275
PRODUCTVERSION 1,3,4,270 PRODUCTVERSION 1,3,4,275
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -296,13 +296,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.3.4.270" VALUE "FileVersion", "1.3.4.275"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.3.4.270" VALUE "ProductVersion", "1.3.4.275"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -98,6 +98,8 @@ libfat_open(int (*readfunc) (intptr_t, void *, size_t, libfat_sector_t),
if (minfatsize > fatsize) if (minfatsize > fatsize)
goto barf; /* The FATs don't fit */ goto barf; /* The FATs don't fit */
#else
(void)(minfatsize); /* silence an unused warning in MinGW */
#endif #endif
if (fs->fat_type == FAT28) if (fs->fat_type == FAT28)