mirror of
https://github.com/pbatard/rufus.git
synced 2025-06-05 09:13:47 -04:00
[loc] add support for Locale registry setting
* Closes #246 * Also bump version
This commit is contained in:
parent
1f5fc8ab33
commit
7c35343da7
5 changed files with 29 additions and 18 deletions
20
configure
vendored
20
configure
vendored
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.68 for rufus 1.4.1.
|
# Generated by GNU Autoconf 2.68 for rufus 1.4.2.
|
||||||
#
|
#
|
||||||
# Report bugs to <https://github.com/pbatard/rufus/issues>.
|
# Report bugs to <https://github.com/pbatard/rufus/issues>.
|
||||||
#
|
#
|
||||||
|
@ -560,8 +560,8 @@ MAKEFLAGS=
|
||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='rufus'
|
PACKAGE_NAME='rufus'
|
||||||
PACKAGE_TARNAME='rufus'
|
PACKAGE_TARNAME='rufus'
|
||||||
PACKAGE_VERSION='1.4.1'
|
PACKAGE_VERSION='1.4.2'
|
||||||
PACKAGE_STRING='rufus 1.4.1'
|
PACKAGE_STRING='rufus 1.4.2'
|
||||||
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
|
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
|
||||||
PACKAGE_URL='http://rufus.akeo.ie'
|
PACKAGE_URL='http://rufus.akeo.ie'
|
||||||
|
|
||||||
|
@ -1203,7 +1203,7 @@ if test "$ac_init_help" = "long"; then
|
||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures rufus 1.4.1 to adapt to many kinds of systems.
|
\`configure' configures rufus 1.4.2 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
|
@ -1269,7 +1269,7 @@ fi
|
||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of rufus 1.4.1:";;
|
short | recursive ) echo "Configuration of rufus 1.4.2:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
|
@ -1357,7 +1357,7 @@ fi
|
||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
rufus configure 1.4.1
|
rufus configure 1.4.2
|
||||||
generated by GNU Autoconf 2.68
|
generated by GNU Autoconf 2.68
|
||||||
|
|
||||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||||
|
@ -1412,7 +1412,7 @@ cat >config.log <<_ACEOF
|
||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by rufus $as_me 1.4.1, which was
|
It was created by rufus $as_me 1.4.2, which was
|
||||||
generated by GNU Autoconf 2.68. Invocation command line was
|
generated by GNU Autoconf 2.68. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
|
@ -2227,7 +2227,7 @@ fi
|
||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='rufus'
|
PACKAGE='rufus'
|
||||||
VERSION='1.4.1'
|
VERSION='1.4.2'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
@ -4140,7 +4140,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by rufus $as_me 1.4.1, which was
|
This file was extended by rufus $as_me 1.4.2, which was
|
||||||
generated by GNU Autoconf 2.68. Invocation command line was
|
generated by GNU Autoconf 2.68. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
|
@ -4194,7 +4194,7 @@ _ACEOF
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
rufus config.status 1.4.1
|
rufus config.status 1.4.2
|
||||||
configured by $0, generated by GNU Autoconf 2.68,
|
configured by $0, generated by GNU Autoconf 2.68,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
AC_INIT([rufus], [1.4.1], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
|
AC_INIT([rufus], [1.4.2], [https://github.com/pbatard/rufus/issues], [rufus], [http://rufus.akeo.ie])
|
||||||
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
|
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
|
||||||
AC_CONFIG_SRCDIR([src/rufus.c])
|
AC_CONFIG_SRCDIR([src/rufus.c])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
|
@ -38,6 +38,7 @@ extern "C" {
|
||||||
#define REGKEY_UPDATE_INTERVAL "UpdateCheckInterval"
|
#define REGKEY_UPDATE_INTERVAL "UpdateCheckInterval"
|
||||||
#define REGKEY_INCLUDE_BETAS "CheckForBetas"
|
#define REGKEY_INCLUDE_BETAS "CheckForBetas"
|
||||||
#define REGKEY_COMM_CHECK "CommCheck"
|
#define REGKEY_COMM_CHECK "CommCheck"
|
||||||
|
#define REGKEY_LOCALE "Locale"
|
||||||
|
|
||||||
/* Delete a registry key from <key_root>\Software and all its values
|
/* Delete a registry key from <key_root>\Software and all its values
|
||||||
If the key has subkeys, this call will fail. */
|
If the key has subkeys, this call will fail. */
|
||||||
|
@ -168,6 +169,7 @@ static __inline BOOL WriteRegistryKey32(HKEY root, const char* key, int32_t val)
|
||||||
// Use a static buffer - don't allocate
|
// Use a static buffer - don't allocate
|
||||||
static __inline char* ReadRegistryKeyStr(HKEY root, const char* key) {
|
static __inline char* ReadRegistryKeyStr(HKEY root, const char* key) {
|
||||||
static char str[512];
|
static char str[512];
|
||||||
|
str[0] = 0;
|
||||||
_GetRegistryKey(root, key, REG_SZ, (LPBYTE)str, (DWORD)sizeof(str)-1);
|
_GetRegistryKey(root, key, REG_SZ, (LPBYTE)str, (DWORD)sizeof(str)-1);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
13
src/rufus.c
13
src/rufus.c
|
@ -2001,7 +2001,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
BOOL attached_console = FALSE, external_loc_file = FALSE;
|
BOOL attached_console = FALSE, external_loc_file = FALSE;
|
||||||
BYTE* loc_data;
|
BYTE* loc_data;
|
||||||
DWORD loc_size, Size;
|
DWORD loc_size, Size;
|
||||||
char tmp_path[MAX_PATH], loc_file[MAX_PATH] = "", *locale_name = NULL;
|
char tmp_path[MAX_PATH], loc_file[MAX_PATH] = "", *tmp, *locale_name = NULL;
|
||||||
char** argv = NULL;
|
char** argv = NULL;
|
||||||
wchar_t **wenv, **wargv;
|
wchar_t **wenv, **wargv;
|
||||||
PF_DECL(__wgetmainargs);
|
PF_DECL(__wgetmainargs);
|
||||||
|
@ -2028,6 +2028,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use the Locale specified in the registry, if any
|
||||||
|
tmp = ReadRegistryKeyStr(REGKEY_HKCU, REGKEY_LOCALE);
|
||||||
|
if (tmp[0] != 0) {
|
||||||
|
locale_name = safe_strdup(tmp);
|
||||||
|
uprintf("found registry locale '%s'", locale_name);
|
||||||
|
}
|
||||||
|
|
||||||
// We have to process the arguments before we acquire the lock and process the locale
|
// We have to process the arguments before we acquire the lock and process the locale
|
||||||
PF_INIT(__wgetmainargs, msvcrt);
|
PF_INIT(__wgetmainargs, msvcrt);
|
||||||
if (pf__wgetmainargs != NULL) {
|
if (pf__wgetmainargs != NULL) {
|
||||||
|
@ -2057,7 +2064,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
if (isdigitU(optarg[0])) {
|
if (isdigitU(optarg[0])) {
|
||||||
lcid = (int)strtol(optarg, NULL, 0);
|
lcid = (int)strtol(optarg, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
locale_name = optarg;
|
safe_free(locale_name);
|
||||||
|
locale_name =safe_strdup(optarg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
|
@ -2252,6 +2260,7 @@ out:
|
||||||
DestroyAllTooltips();
|
DestroyAllTooltips();
|
||||||
exit_localization();
|
exit_localization();
|
||||||
safe_free(iso_path);
|
safe_free(iso_path);
|
||||||
|
safe_free(locale_name);
|
||||||
safe_free(update.download_url);
|
safe_free(update.download_url);
|
||||||
safe_free(update.release_notes);
|
safe_free(update.release_notes);
|
||||||
if (argv != NULL) {
|
if (argv != NULL) {
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,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.4.1.354"
|
CAPTION "Rufus v1.4.2.355"
|
||||||
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
|
||||||
|
@ -288,8 +288,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,4,1,354
|
FILEVERSION 1,4,2,355
|
||||||
PRODUCTVERSION 1,4,1,354
|
PRODUCTVERSION 1,4,2,355
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -306,13 +306,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.4.1.354"
|
VALUE "FileVersion", "1.4.2.355"
|
||||||
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.4.1.354"
|
VALUE "ProductVersion", "1.4.2.355"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue