Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mirrors
rufus
Rufus
提交
cb60cdc8
R
Rufus
项目概览
mirrors
/
rufus
/
Rufus
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rufus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cb60cdc8
编写于
8月 01, 2013
作者:
P
Pete Batard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[localization] more grueling translation work...
上级
9339c20b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
168 addition
and
79 deletion
+168
-79
res/localization/rufus.loc
res/localization/rufus.loc
+90
-11
src/format.c
src/format.c
+5
-10
src/iso.c
src/iso.c
+7
-8
src/rufus.c
src/rufus.c
+42
-27
src/rufus.h
src/rufus.h
+2
-0
src/stdio.c
src/stdio.c
+6
-5
src/stdlg.c
src/stdlg.c
+16
-18
未找到文件。
res/localization/rufus.loc
浏览文件 @
cb60cdc8
...
...
@@ -12,6 +12,48 @@ t MSG_004 "Rufus update policy"
t MSG_005 "Do you want to allow Rufus to check for application updates online?"
t MSG_006 "Close" # Must be the same as IDD_DIALOG:IDCANCEL (i.e. "Close" - I know it's confusing)
t MSG_007 "Cancel"
t MSG_008 "Yes"
t MSG_009 "No"
t MSG_010 "Bad blocks found"
t MSG_011 "Check completed: %u bad block(s) found\n"
" %d read error(s)\n %d write error(s)\n %d corruption error(s)\n"
# The following will contain the formatted message above as well as the name of the bad blocks logfile
t MSG_012 "%s\nA more detailed report can be found in:\n%s"
t MSG_013 "Disabled"
t MSG_014 "Daily"
t MSG_015 "Weekly"
t MSG_016 "Monthly"
t MSG_017 "Custom"
t MSG_018 "Your version: %d.%d.%d (Build %d)"
t MSG_019 "Latest version: %d.%d.%d (Build %d)"
# *Short* size names. These can be used as suffixes
t MSG_020 "bytes"
t MSG_021 "KB"
t MSG_022 "MB"
t MSG_023 "GB"
t MSG_024 "TB"
t MSG_025 "PB"
# *Long* size names, as they are displayed for the cluster size in the MS format dialog.
t MSG_026 "bytes" # Yes, this is a repeat from MSG_020
t MSG_027 "kilobytes"
t MSG_028 "megabytes"
t MSG_029 "Default"
# The following gets appended to the file system, cluster size, etc.
t MSG_030 "%s (Default)"
t MSG_031 "%s partition scheme for BIOS computer"
t MSG_032 "%s partition scheme for UEFI computer"
t MSG_033 "%s partition scheme for BIOS or UEFI computers"
# Number of bad block check passes (singular for 1 pass, plural for 2 or more passes)
t MSG_034 "%d Pass"
t MSG_035 "%d Passes"
t MSG_036 "ISO Image"
t MSG_037 "Application"
t MSG_038 "Abort"
t MSG_039 "Launch"
t MSG_040 "Download"
t MSG_041 "Operation cancelled by the user"
t MSG_042 "Error"
t MSG_043 "Error: %s"
# Status messages - these messages will appear on the status bar
t MSG_501 "Cancelling - Please wait..."
...
...
@@ -26,9 +68,9 @@ t MSG_506 "Missing %s file"
# Same message, once for singular and plural ("1 device found", "2 devices found")
t MSG_508 "%d device found"
t MSG_509 "%d devices found"
t MSG_510 "DONE"
t MSG_511 "Cancelled"
t MSG_512 "FAILED"
t MSG_510 "DONE
.
"
t MSG_511 "Cancelled
.
"
t MSG_512 "FAILED
.
"
# Used when a new update has been downloaded and lauched
t MSG_513 "Launching new application..."
t MSG_514 "Failed to launch new application"
...
...
@@ -99,8 +141,8 @@ t IDC_ABOUT "A propos..."
t IDCANCEL "Fermer"
t IDC_START "Démarrer"
t IDC_ADVANCED_GROUP "Options avancées"
t IDC_ENABLE_FIXED_DISKS "Liste les disques fixes ou non partitionés"
t IDC_EXTRA_PARTITION "Options de compatibilité
pour vieux
BIOS"
t IDC_ENABLE_FIXED_DISKS "Liste
r
les disques fixes ou non partitionés"
t IDC_EXTRA_PARTITION "Options de compatibilité
avec anciens
BIOS"
t IDC_RUFUS_MBR "Rufus MBR avec ID BIOS:"
s IDD_ABOUTBOX
...
...
@@ -124,15 +166,15 @@ t IDCANCEL "Fermer"
s IDD_UPDATE_POLICY
t IDD_UPDATE_POLICY "Paramètres de mises à jour"
t IDS_UPDATE_SETTINGS_TXT "Options"
t IDS_UPDATE_FREQUENCY_TXT "Test
er les mises à jour:
"
t IDS_UPDATE_FREQUENCY_TXT "Test
s de mise à jour
"
t IDS_INCLUDE_BETAS_TXT "Inclure les bétas:"
t IDC_CHECK_NOW "
Test
er maintenant"
t IDC_CHECK_NOW "
Cherch
er maintenant"
m IDC_CHECK_NOW -10,0
r IDC_CHECK_NOW +20,0
t IDCANCEL "Fermer"
s IDD_NEW_VERSION
t IDD_NEW_VERSION "
Test des mises à jour -
Rufus"
t IDD_NEW_VERSION "
Recherche de mise à jour
Rufus"
t IDS_NEW_VERSION_AVAIL_TXT "Une nouvelle version est disponible. Veuillez télécharger la nouvelle version !"
t IDC_WEBSITE "Cliquez ici pour aller sur le site de Rufus"
t IDS_NEW_VERSION_NOTES_TXT "Notes pour cette version"
...
...
@@ -156,6 +198,43 @@ t MSG_004 "Mises à jour"
t MSG_005 "Voulez-vous authoriser Rufus à chercher des mises à jour en ligne?"
t MSG_006 "Fermer"
t MSG_007 "Annuler"
t MSG_008 "Oui"
t MSG_009 "Non"
t MSG_010 "Blocs défectueux détectés"
t MSG_011 "Vérification complète: %u bloc(s) défectueux détecté(s)\n"
" %d erreur(s) de lecture\n %d erreur(s) d'écriture\n %d erreur(s) de corruption\n"
t MSG_012 "%s\nUn rapport plus détaillé peut être obtenu à:\n%s"
t MSG_013 "Jamais"
t MSG_014 "Quotidien"
t MSG_015 "Hebdomadaire"
t MSG_016 "Mensuel"
t MSG_017 "Personalisé"
t MSG_018 "Votre version: %d.%d.%d (Build %d)"
t MSG_019 "Dernière version: %d.%d.%d (Build %d)"
t MSG_020 "octets"
t MSG_021 "Ko"
t MSG_022 "Mo"
t MSG_023 "Go"
t MSG_024 "To"
t MSG_025 "Po"
t MSG_026 "octets"
t MSG_027 "kilo-octets"
t MSG_028 "mega-octets"
t MSG_029 "Défaut"
t MSG_030 "%s (Défaut)"
t MSG_031 "Type de partition %s pour ordinateur BIOS"
t MSG_032 "Type de partition %s pour ordinateur UEFI"
t MSG_033 "Type de partition %s pour ordinateur BIOS ou UEFI"
t MSG_034 "%d passe"
t MSG_035 "%d passes"
t MSG_036 "Image ISO"
t MSG_037 "Application"
t MSG_038 "Annuler"
t MSG_039 "Lancer"
t MSG_040 "Télécharger"
t MSG_041 "Operation annulée par l'utilisateur"
t MSG_042 "Erreur"
t MSG_043 "Erreur: %s"
# Status messages
t MSG_501 "Annulation - Veuillez patienter..."
...
...
@@ -166,9 +245,9 @@ t MSG_505 "ISO utilisée: %s"
t MSG_506 "Fichier %s manquant"
t MSG_508 "%d périphérique détecté"
t MSG_509 "%d périphériques détectés"
t MSG_510 "Opération terminée"
t MSG_511 "Opération annulée"
t MSG_512 "ECHEC"
t MSG_510 "Opération terminée
.
"
t MSG_511 "Opération annulée
.
"
t MSG_512 "ECHEC
.
"
t MSG_513 "Lancement de la nouvelle application..."
t MSG_514 "Echec de lancement de l'application"
t MSG_515 "%s ouvert"
...
...
src/format.c
浏览文件 @
cb60cdc8
...
...
@@ -1161,9 +1161,8 @@ DWORD WINAPI FormatThread(LPVOID param)
HANDLE
hPhysicalDrive
=
INVALID_HANDLE_VALUE
;
HANDLE
hLogicalVolume
=
INVALID_HANDLE_VALUE
;
SYSTEMTIME
lt
;
char
*
guid_volume
=
NULL
;
char
*
bb_msg
,
*
guid_volume
=
NULL
;
char
drive_name
[]
=
"?:
\\
"
;
char
bb_msg
[
512
];
char
logfile
[
MAX_PATH
],
*
userdir
;
char
wim_image
[]
=
"?:
\\
sources
\\
install.wim"
;
char
efi_dst
[]
=
"?:
\\
efi
\\
boot
\\
bootx64.efi"
;
...
...
@@ -1261,19 +1260,15 @@ DWORD WINAPI FormatThread(LPVOID param)
report
.
num_read_errors
,
report
.
num_write_errors
,
report
.
num_corruption_errors
);
r
=
IDOK
;
if
(
report
.
bb_count
)
{
safe_sprintf
(
bb_msg
,
sizeof
(
bb_msg
),
"Check completed: %u bad block%s found.
\n
"
" %d read errors
\n
%d write errors
\n
%d corruption errors
\n
"
,
report
.
bb_count
,
(
report
.
bb_count
==
1
)
?
""
:
"s"
,
report
.
num_read_errors
,
report
.
num_write_errors
,
bb_msg
=
lmprintf
(
MSG_011
,
report
.
num_read_errors
,
report
.
num_write_errors
,
report
.
num_corruption_errors
);
fprintf
(
log_fd
,
"%s"
,
bb_msg
);
fprintf
(
log_fd
,
bb_msg
);
GetLocalTime
(
&
lt
);
fprintf
(
log_fd
,
APPLICATION_NAME
" bad blocks check ended on: %04d.%02d.%02d %02d:%02d:%02d
\n
"
,
lt
.
wYear
,
lt
.
wMonth
,
lt
.
wDay
,
lt
.
wHour
,
lt
.
wMinute
,
lt
.
wSecond
);
fclose
(
log_fd
);
safe_sprintf
(
&
bb_msg
[
strlen
(
bb_msg
)],
sizeof
(
bb_msg
)
-
strlen
(
bb_msg
)
-
1
,
"
\n
A more detailed report can be found in:
\n
%s
\n
"
,
logfile
);
r
=
MessageBoxU
(
hMainDialog
,
bb_msg
,
"Bad blocks found"
,
MB_ABORTRETRYIGNORE
|
MB_ICONWARNING
);
r
=
MessageBoxU
(
hMainDialog
,
lmprintf
(
MSG_012
,
bb_msg
,
logfile
),
lmprintf
(
MSG_010
),
MB_ABORTRETRYIGNORE
|
MB_ICONWARNING
);
}
else
{
// We didn't get any errors => delete the log file
fclose
(
log_fd
);
...
...
src/iso.c
浏览文件 @
cb60cdc8
...
...
@@ -41,6 +41,7 @@
#include "rufus.h"
#include "msapi_utf8.h"
#include "resource.h"
#include "localization.h"
// How often should we update the progress bar (in 2K blocks) as updating
// the progress bar for every block will bring extraction to a crawl
...
...
@@ -76,16 +77,15 @@ static __inline char* size_to_hr(int64_t size)
{
int
suffix
=
0
;
static
char
str_size
[
24
];
const
char
*
sizes
[]
=
{
""
,
"KB"
,
"MB"
,
"GB"
,
"TB"
};
double
hr_size
=
(
double
)
size
;
while
((
suffix
<
ARRAYSIZE
(
sizes
)
)
&&
(
hr_size
>=
1024
.
0
))
{
while
((
suffix
<
MAX_SIZE_SUFFIXES
)
&&
(
hr_size
>=
1024
.
0
))
{
hr_size
/=
1024
.
0
;
suffix
++
;
}
if
(
suffix
==
0
)
{
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
" (%d
bytes)"
,
(
int
)
hr_size
);
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
" (%d
%s)"
,
(
int
)
hr_size
,
lmprintf
(
MSG_020
)
);
}
else
{
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
" (%0.1f %s)"
,
hr_size
,
sizes
[
suffix
]
);
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
" (%0.1f %s)"
,
hr_size
,
lmprintf
(
MSG_020
+
suffix
)
);
}
return
str_size
;
}
...
...
@@ -416,7 +416,6 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan)
LONG
progress_style
;
char
*
tmp
;
char
path
[
64
];
const
char
*
scan_text
=
"Scanning ISO image..."
;
const
char
*
basedir
[]
=
{
"i386"
,
"minint"
};
const
char
*
tmp_sif
=
".
\\
txtsetup.sif~"
;
...
...
@@ -433,14 +432,14 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan)
// String array of all isolinux/syslinux locations
StrArrayCreate
(
&
config_path
,
8
);
// Change the Window title and static text
SetWindowTextU
(
hISOProgressDlg
,
scan_text
);
SetWindowTextU
(
hISOFileName
,
scan_text
);
SetWindowTextU
(
hISOProgressDlg
,
lmprintf
(
MSG_502
)
);
SetWindowTextU
(
hISOFileName
,
lmprintf
(
MSG_502
)
);
// Change progress style to marquee for scanning
SetWindowLong
(
hISOProgressBar
,
GWL_STYLE
,
progress_style
|
PBS_MARQUEE
);
SendMessage
(
hISOProgressBar
,
PBM_SETMARQUEE
,
TRUE
,
0
);
}
else
{
uprintf
(
"Extracting files...
\n
"
);
SetWindowTextU
(
hISOProgressDlg
,
"Copying ISO files..."
);
SetWindowTextU
(
hISOProgressDlg
,
lmprintf
(
MSG_531
)
);
if
(
total_blocks
==
0
)
{
uprintf
(
"Error: ISO has not been properly scanned.
\n
"
);
FormatStatus
=
ERROR_SEVERITY_ERROR
|
FAC
(
FACILITY_STORAGE
)
|
APPERR
(
ERROR_ISO_SCAN
);
...
...
src/rufus.c
浏览文件 @
cb60cdc8
...
...
@@ -89,11 +89,6 @@ struct {
const
char
*
FileSystemLabel
[
FS_MAX
]
=
{
"FAT"
,
"FAT32"
,
"NTFS"
,
"UDF"
,
"exFAT"
};
// Number of steps for each FS for FCC_STRUCTURE_PROGRESS
const
int
nb_steps
[
FS_MAX
]
=
{
5
,
5
,
12
,
1
,
10
};
// Don't ask me - just following the MS "standard" here
// We hijack 256 as a "Default" for UDF, since we can't set clustersize there
static
const
char
*
ClusterSizeLabel
[]
=
{
"Default"
,
"512 bytes"
,
"1024 bytes"
,
"2048 bytes"
,
"4096 bytes"
,
"8192 bytes"
,
"16 kilobytes"
,
"32 kilobytes"
,
"64 kilobytes"
,
"128 kilobytes"
,
"256 kilobytes"
,
"512 kilobytes"
,
"1024 kilobytes"
,
"2048 kilobytes"
,
"4096 kilobytes"
,
"8192 kilobytes"
,
"16 megabytes"
,
"32 megabytes"
};
static
const
char
*
BiosTypeLabel
[
BT_MAX
]
=
{
"BIOS"
,
"UEFI"
};
static
const
char
*
PartitionTypeLabel
[
2
]
=
{
"MBR"
,
"GPT"
};
static
BOOL
existing_key
=
FALSE
;
// For LGP set/restore
...
...
@@ -103,6 +98,7 @@ static BOOL iso_provided = FALSE;
extern
BOOL
force_large_fat32
;
static
int
selection_default
;
static
loc_cmd
*
selected_locale
=
NULL
;
char
ClusterSizeLabel
[
MAX_CLUSTER_SIZES
][
64
];
char
msgbox
[
1024
],
msgbox_title
[
32
];
/*
...
...
@@ -150,6 +146,23 @@ static float previous_end;
#define MB 1048576LL
#define GB 1073741824LL
#define TB 1099511627776LL
/*
* Fill in the cluster size names
*/
static
void
SetClusterSizeLabels
(
void
)
{
unsigned
int
i
,
j
,
k
;
safe_sprintf
(
ClusterSizeLabel
[
0
],
64
,
lmprintf
(
MSG_029
));
for
(
i
=
512
,
j
=
1
,
k
=
MSG_026
;
j
<
MAX_CLUSTER_SIZES
;
i
<<=
1
,
j
++
)
{
if
(
i
>
8192
)
{
i
/=
1024
;
k
++
;
}
safe_sprintf
(
ClusterSizeLabel
[
j
],
64
,
"%d %s"
,
i
,
lmprintf
(
k
));
}
}
/*
* Set cluster size values according to http://support.microsoft.com/kb/140365
* this call will return FALSE if we can't find a supportable FS for the drive
...
...
@@ -159,7 +172,7 @@ static BOOL DefineClusterSizes(void)
LONGLONG
i
;
int
fs
;
BOOL
r
=
FALSE
;
char
tmp
[
64
]
=
""
;
char
tmp
[
64
]
=
""
,
*
entry
;
default_fs
=
FS_UNKNOWN
;
memset
(
&
SelectedDrive
.
ClusterSize
,
0
,
sizeof
(
SelectedDrive
.
ClusterSize
));
...
...
@@ -284,11 +297,13 @@ out:
safe_strcat
(
tmp
,
sizeof
(
tmp
),
"Large "
);
safe_strcat
(
tmp
,
sizeof
(
tmp
),
FileSystemLabel
[
fs
]);
if
(
default_fs
==
FS_UNKNOWN
)
{
safe_strcat
(
tmp
,
sizeof
(
tmp
),
" (Default)"
);
entry
=
lmprintf
(
MSG_030
,
tmp
);
default_fs
=
fs
;
}
else
{
entry
=
tmp
;
}
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFileSystem
,
ComboBox_AddStringU
(
hFileSystem
,
tmp
),
fs
));
ComboBox_AddStringU
(
hFileSystem
,
entry
),
fs
));
r
=
TRUE
;
}
}
...
...
@@ -305,7 +320,7 @@ out:
*/
static
BOOL
SetClusterSizes
(
int
FSType
)
{
char
szClustSize
[
64
]
;
char
*
szClustSize
;
int
i
,
k
,
default_index
=
0
;
ULONG
j
;
...
...
@@ -323,10 +338,11 @@ static BOOL SetClusterSizes(int FSType)
for
(
i
=
0
,
j
=
0x100
,
k
=
0
;
j
<
0x10000000
;
i
++
,
j
<<=
1
)
{
if
(
j
&
SelectedDrive
.
ClusterSize
[
FSType
].
Allowed
)
{
safe_sprintf
(
szClustSize
,
sizeof
(
szClustSize
),
"%s"
,
ClusterSizeLabel
[
i
]);
if
(
j
==
SelectedDrive
.
ClusterSize
[
FSType
].
Default
)
{
s
afe_strcat
(
szClustSize
,
sizeof
(
szClustSize
),
" (Default)"
);
s
zClustSize
=
lmprintf
(
MSG_030
,
ClusterSizeLabel
[
i
]
);
default_index
=
k
;
}
else
{
szClustSize
=
ClusterSizeLabel
[
i
];
}
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hClusterSize
,
ComboBox_AddStringU
(
hClusterSize
,
szClustSize
),
j
));
k
++
;
...
...
@@ -495,8 +511,6 @@ static void SetPartitionSchemeTooltip(void)
static
BOOL
PopulateProperties
(
int
ComboIndex
)
{
double
HumanReadableSize
;
char
capacity
[
64
];
static
char
*
suffix
[]
=
{
"B"
,
"KB"
,
"MB"
,
"GB"
,
"TB"
,
"PB"
};
char
no_label
[]
=
STR_NO_LABEL
;
int
i
,
j
,
pt
,
bt
;
...
...
@@ -516,7 +530,7 @@ static BOOL PopulateProperties(int ComboIndex)
EnableBootOptions
(
TRUE
);
HumanReadableSize
=
(
double
)
SelectedDrive
.
DiskSize
;
for
(
i
=
1
;
i
<
ARRAYSIZE
(
suffix
)
;
i
++
)
{
for
(
i
=
1
;
i
<
MAX_SIZE_SUFFIXES
;
i
++
)
{
HumanReadableSize
/=
1024
.
0
;
if
(
HumanReadableSize
<
512
.
0
)
{
for
(
j
=
0
;
j
<
3
;
j
++
)
{
...
...
@@ -526,14 +540,14 @@ static BOOL PopulateProperties(int ComboIndex)
continue
;
bt
=
(
j
==
0
)
?
BT_BIOS
:
BT_UEFI
;
pt
=
(
j
==
2
)
?
PARTITION_STYLE_GPT
:
PARTITION_STYLE_MBR
;
safe_sprintf
(
capacity
,
sizeof
(
capacity
),
"%s partition scheme for %s%s computer%s"
,
PartitionTypeLabel
[
pt
],
BiosTypeLabel
[
bt
],
(
j
==
0
)
?
" or UEFI"
:
""
,
(
j
==
0
)
?
"s"
:
""
);
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hPartitionScheme
,
ComboBox_AddStringU
(
hPartitionScheme
,
capacity
),
(
bt
<<
16
)
|
pt
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hPartitionScheme
,
ComboBox_AddStringU
(
hPartitionScheme
,
lmprintf
(
MSG_031
+
j
,
PartitionTypeLabel
[
pt
])),
(
bt
<<
16
)
|
pt
)
);
}
break
;
}
}
if
(
i
>=
ARRAYSIZE
(
suffix
)
)
if
(
i
>=
MAX_SIZE_SUFFIXES
)
uprintf
(
"Could not populate partition scheme data
\n
"
);
if
(
SelectedDrive
.
PartitionType
==
PARTITION_STYLE_GPT
)
{
j
=
2
;
...
...
@@ -554,10 +568,10 @@ static BOOL PopulateProperties(int ComboIndex)
// If we're beneath the tolerance, round proposed label to an integer, if not, show one decimal point
if
(
fabs
(
HumanReadableSize
/
ceil
(
HumanReadableSize
)
-
1
.
0
)
<
PROPOSEDLABEL_TOLERANCE
)
{
safe_sprintf
(
SelectedDrive
.
proposed_label
,
sizeof
(
SelectedDrive
.
proposed_label
),
"%0.0f%s"
,
ceil
(
HumanReadableSize
),
suffix
[
i
]
);
"%0.0f%s"
,
ceil
(
HumanReadableSize
),
lmprintf
(
MSG_020
+
i
)
);
}
else
{
safe_sprintf
(
SelectedDrive
.
proposed_label
,
sizeof
(
SelectedDrive
.
proposed_label
),
"%0.1f%s"
,
HumanReadableSize
,
suffix
[
i
]
);
"%0.1f%s"
,
HumanReadableSize
,
lmprintf
(
MSG_020
+
i
)
);
}
// If no existing label is available and no ISO is selected, propose one according to the size (eg: "256MB", "8GB")
...
...
@@ -1344,6 +1358,8 @@ void InitDialog(HWND hDlg)
// Detect the LCID
uprintf
(
"LCID: 0x%04X
\n
"
,
GetUserDefaultLCID
());
SetClusterSizeLabels
();
// Prefer FreeDOS to MS-DOS
selection_default
=
DT_FREEDOS
;
// Create the status line and initialize the taskbar icon for progress overlay
...
...
@@ -1355,15 +1371,14 @@ void InitDialog(HWND hDlg)
SendMessage
(
hProgress
,
PBM_SETRANGE
,
0
,
(
MAX_PROGRESS
<<
16
)
&
0xFFFF0000
);
// Fill up the passes
for
(
i
=
0
;
i
<
4
;
i
++
)
{
safe_sprintf
(
tmp
,
sizeof
(
tmp
),
"%d Pass%s"
,
i
+
1
,
(
i
==
0
)
?
""
:
"es"
);
IGNORE_RETVAL
(
ComboBox_AddStringU
(
hNBPasses
,
tmp
));
IGNORE_RETVAL
(
ComboBox_AddStringU
(
hNBPasses
,
lmprintf
((
i
==
0
)
?
MSG_034
:
MSG_035
,
i
+
1
)));
}
IGNORE_RETVAL
(
ComboBox_SetCurSel
(
hNBPasses
,
1
));
SetPassesTooltip
();
// Fill up the DOS type dropdown
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
"MS-DOS"
),
DT_WINME
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
"FreeDOS"
),
DT_FREEDOS
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
"ISO Image"
),
DT_ISO
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
lmprintf
(
MSG_036
)
),
DT_ISO
));
IGNORE_RETVAL
(
ComboBox_SetCurSel
(
hBootType
,
selection_default
));
// Fill up the MBR masqueraded disk IDs ("8 disks should be enough for anybody")
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hDiskID
,
ComboBox_AddStringU
(
hDiskID
,
"0x80 (default)"
),
0x80
));
...
...
@@ -1675,7 +1690,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
"MS-DOS"
),
DT_WINME
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
"FreeDOS"
),
DT_FREEDOS
));
}
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
"ISO Image"
),
DT_ISO
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
lmprintf
(
MSG_036
)
),
DT_ISO
));
// If needed (advanced mode) also append a Syslinux option
if
(
(
bt
==
BT_BIOS
)
&&
(((
fs
==
FS_FAT16
)
||
(
fs
==
FS_FAT32
))
&&
(
advanced_mode
))
)
{
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hBootType
,
ComboBox_AddStringU
(
hBootType
,
"Syslinux 4"
),
DT_SYSLINUX_V4
));
...
...
@@ -1731,7 +1746,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
iso_provided
=
FALSE
;
// One off thing...
}
else
{
safe_free
(
iso_path
);
iso_path
=
FileDialog
(
FALSE
,
NULL
,
"*.iso"
,
"iso"
,
"ISO Image"
);
iso_path
=
FileDialog
(
FALSE
,
NULL
,
"*.iso"
,
"iso"
,
lmprintf
(
MSG_036
)
);
if
(
iso_path
==
NULL
)
{
CreateTooltip
(
hSelectISO
,
"Click to select..."
,
-
1
);
break
;
...
...
@@ -1850,12 +1865,12 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
SendMessage
(
hProgress
,
PBM_SETSTATE
,
(
WPARAM
)
PBST_PAUSED
,
0
);
SetTaskbarProgressState
(
TASKBAR_PAUSED
);
PrintStatus
(
0
,
FALSE
,
lmprintf
(
MSG_511
));
Notification
(
MSG_INFO
,
NULL
,
lmprintf
(
MSG_511
),
"Operation cancelled by the user."
);
Notification
(
MSG_INFO
,
NULL
,
lmprintf
(
MSG_511
),
lmprintf
(
MSG_041
)
);
}
else
{
SendMessage
(
hProgress
,
PBM_SETSTATE
,
(
WPARAM
)
PBST_ERROR
,
0
);
SetTaskbarProgressState
(
TASKBAR_ERROR
);
PrintStatus
(
0
,
FALSE
,
lmprintf
(
MSG_512
));
Notification
(
MSG_ERROR
,
NULL
,
"Error"
,
"Error: %s"
,
StrError
(
FormatStatus
));
Notification
(
MSG_ERROR
,
NULL
,
lmprintf
(
MSG_042
),
lmprintf
(
MSG_043
)
,
StrError
(
FormatStatus
));
}
FormatStatus
=
0
;
format_op_in_progress
=
FALSE
;
...
...
src/rufus.h
浏览文件 @
cb60cdc8
...
...
@@ -43,6 +43,8 @@
#define DRIVE_INDEX_MAX 0x000000C0
#define MAX_DRIVES (DRIVE_INDEX_MAX - DRIVE_INDEX_MIN)
#define MAX_TOOLTIPS 32
#define MAX_SIZE_SUFFIXES 6 // bytes, KB, MB, GB, TB, PB
#define MAX_CLUSTER_SIZES 18
#define MAX_PROGRESS (0xFFFF-1) // leave room for 1 more for insta-progress workaround
#define MAX_LOG_SIZE 0x7FFFFFFE
#define MAX_GUID_STRING_LENGTH 40
...
...
src/stdio.c
浏览文件 @
cb60cdc8
...
...
@@ -31,6 +31,7 @@
#include "msapi_utf8.h"
#include "rufus.h"
#include "resource.h"
#include "localization.h"
/*
* Globals
...
...
@@ -179,21 +180,21 @@ char* GuidToString(const GUID* guid)
char
*
SizeToHumanReadable
(
LARGE_INTEGER
size
)
{
int
suffix
=
0
;
static
char
str_size
[
24
];
const
char
*
sizes
[]
=
{
""
,
"KB"
,
"MB"
,
"GB"
,
"TB"
};
static
char
str_size
[
32
];
double
hr_size
=
(
double
)
size
.
QuadPart
;
while
((
suffix
<
ARRAYSIZE
(
sizes
)
)
&&
(
hr_size
>=
1024
.
0
))
{
while
((
suffix
<
MAX_SIZE_SUFFIXES
)
&&
(
hr_size
>=
1024
.
0
))
{
hr_size
/=
1024
.
0
;
suffix
++
;
}
if
(
suffix
==
0
)
{
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
"%d
bytes"
,
(
int
)
hr_size
);
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
"%d
%s"
,
(
int
)
hr_size
,
lmprintf
(
MSG_020
)
);
}
else
{
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
"%0.1f %s"
,
hr_size
,
sizes
[
suffix
]
);
safe_sprintf
(
str_size
,
sizeof
(
str_size
),
"%0.1f %s"
,
hr_size
,
lmprintf
(
MSG_020
+
suffix
)
);
}
return
str_size
;
}
// TODO: all of these need to be translated
const
char
*
StrError
(
DWORD
error_code
)
{
if
(
(
!
IS_ERROR
(
error_code
))
||
(
SCODE_CODE
(
error_code
)
==
ERROR_SUCCESS
))
{
...
...
src/stdlg.c
浏览文件 @
cb60cdc8
...
...
@@ -588,7 +588,7 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP
}
// Enable/disable the buttons and set text
if
(
!
notification_is_question
)
{
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDNO
),
"Close"
);
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDNO
),
lmprintf
(
MSG_006
)
);
}
else
{
ShowWindow
(
GetDlgItem
(
hDlg
,
IDYES
),
SW_SHOW
);
}
...
...
@@ -972,10 +972,10 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
CenterDialog
(
hDlg
);
hFrequency
=
GetDlgItem
(
hDlg
,
IDC_UPDATE_FREQUENCY
);
hBeta
=
GetDlgItem
(
hDlg
,
IDC_INCLUDE_BETAS
);
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
"Disabled"
),
-
1
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
"Daily (Default)"
),
86400
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
"Weekly"
),
604800
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
"Monthly"
),
2629800
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
lmprintf
(
MSG_013
)
),
-
1
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
lmprintf
(
MSG_030
,
lmprintf
(
MSG_014
))
),
86400
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
lmprintf
(
MSG_015
)
),
604800
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
lmprintf
(
MSG_016
)
),
2629800
));
freq
=
ReadRegistryKey32
(
REGKEY_HKCU
,
REGKEY_UPDATE_INTERVAL
);
EnableWindow
(
GetDlgItem
(
hDlg
,
IDC_CHECK_NOW
),
(
freq
!=
0
));
EnableWindow
(
hBeta
,
(
freq
>=
0
));
...
...
@@ -994,12 +994,12 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
IGNORE_RETVAL
(
ComboBox_SetCurSel
(
hFrequency
,
3
));
break
;
default:
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
"Custom"
),
freq
));
IGNORE_RETVAL
(
ComboBox_SetItemData
(
hFrequency
,
ComboBox_AddStringU
(
hFrequency
,
lmprintf
(
MSG_017
)
),
freq
));
IGNORE_RETVAL
(
ComboBox_SetCurSel
(
hFrequency
,
4
));
break
;
}
IGNORE_RETVAL
(
ComboBox_AddStringU
(
hBeta
,
"Yes"
));
IGNORE_RETVAL
(
ComboBox_AddStringU
(
hBeta
,
"No"
));
IGNORE_RETVAL
(
ComboBox_AddStringU
(
hBeta
,
lmprintf
(
MSG_008
)
));
IGNORE_RETVAL
(
ComboBox_AddStringU
(
hBeta
,
lmprintf
(
MSG_009
)
));
IGNORE_RETVAL
(
ComboBox_SetCurSel
(
hBeta
,
GetRegistryKeyBool
(
REGKEY_HKCU
,
REGKEY_INCLUDE_BETAS
)
?
0
:
1
));
hPolicy
=
GetDlgItem
(
hDlg
,
IDC_POLICY
);
SendMessage
(
hPolicy
,
EM_AUTOURLDETECT
,
1
,
0
);
...
...
@@ -1148,12 +1148,10 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR
SendMessageA
(
hNotes
,
EM_SETTEXTEX
,
(
WPARAM
)
&
friggin_microsoft_unicode_amateurs
,
(
LPARAM
)
update
.
release_notes
);
SendMessage
(
hNotes
,
EM_SETSEL
,
-
1
,
-
1
);
SendMessage
(
hNotes
,
EM_SETEVENTMASK
,
0
,
ENM_LINK
);
safe_sprintf
(
tmp
,
sizeof
(
tmp
),
"Your version: %d.%d.%d (Build %d)"
,
rufus_version
[
0
],
rufus_version
[
1
],
rufus_version
[
2
],
rufus_version
[
3
]);
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_YOUR_VERSION
),
tmp
);
safe_sprintf
(
tmp
,
sizeof
(
tmp
),
"Latest version: %d.%d.%d (Build %d)"
,
update
.
version
[
0
],
update
.
version
[
1
],
update
.
version
[
2
],
update
.
version
[
3
]);
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_LATEST_VERSION
),
tmp
);
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_YOUR_VERSION
),
lmprintf
(
MSG_018
,
rufus_version
[
0
],
rufus_version
[
1
],
rufus_version
[
2
],
rufus_version
[
3
]));
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_LATEST_VERSION
),
lmprintf
(
MSG_019
,
update
.
version
[
0
],
update
.
version
[
1
],
update
.
version
[
2
],
update
.
version
[
3
]));
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_DOWNLOAD_URL
),
update
.
download_url
);
SendMessage
(
GetDlgItem
(
hDlg
,
IDC_PROGRESS
),
PBM_SETRANGE
,
0
,
(
MAX_PROGRESS
<<
16
)
&
0xFFFF0000
);
if
(
update
.
download_url
==
NULL
)
...
...
@@ -1203,7 +1201,7 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR
break
;
default:
// Download
for
(
i
=
(
int
)
safe_strlen
(
update
.
download_url
);
(
i
>
0
)
&&
(
update
.
download_url
[
i
]
!=
'/'
);
i
--
);
filepath
=
FileDialog
(
TRUE
,
app_dir
,
(
char
*
)
&
update
.
download_url
[
i
+
1
],
"exe"
,
"Application"
);
filepath
=
FileDialog
(
TRUE
,
app_dir
,
(
char
*
)
&
update
.
download_url
[
i
+
1
],
"exe"
,
lmprintf
(
MSG_037
)
);
if
(
filepath
!=
NULL
)
DownloadFileThreaded
(
update
.
download_url
,
filepath
,
hDlg
);
break
;
...
...
@@ -1214,14 +1212,14 @@ INT_PTR CALLBACK NewVersionCallback(HWND hDlg, UINT message, WPARAM wParam, LPAR
case
UM_ISO_INIT
:
FormatStatus
=
0
;
download_status
=
1
;
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_DOWNLOAD
),
"Abort"
);
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_DOWNLOAD
),
lmprintf
(
MSG_038
)
);
return
(
INT_PTR
)
TRUE
;
case
UM_ISO_EXIT
:
if
(
wParam
)
{
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_DOWNLOAD
),
"Launch"
);
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_DOWNLOAD
),
lmprintf
(
MSG_039
)
);
download_status
=
2
;
}
else
{
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_DOWNLOAD
),
"Download"
);
SetWindowTextU
(
GetDlgItem
(
hDlg
,
IDC_DOWNLOAD
),
lmprintf
(
MSG_040
)
);
download_status
=
0
;
}
return
(
INT_PTR
)
TRUE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录