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

[misc] use application dir for storage in portable mode

* Also improve path reporting in the log.
* Also fix MinGW warnings
This commit is contained in:
Pete Batard 2021-10-11 20:08:04 +01:00
parent 9cd7adaaaa
commit 56a99e6394
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
5 changed files with 19 additions and 16 deletions

View file

@ -11,7 +11,7 @@
<Identity
Name="19453.net.Rufus"
Publisher="CN=7AC86D13-3E5A-491A-ADD5-80095C212740"
Version="3.16.1834.0" />
Version="3.16.1835.0" />
<Properties>
<DisplayName>Rufus</DisplayName>

View file

@ -1517,8 +1517,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
fd = fopen(tmp, "rb");
if (fd != NULL) {
// If a file already exists in the current directory, use that one
uprintf("Will reuse '%s' from './" FILES_DIR "/%s-%s/' for Grub 2.x installation",
core_img, grub, img_report.grub2_version);
uprintf("Will reuse '%s' from '%s\\%s\\%s-%s\\' for Grub 2.x installation",
core_img, app_data_dir, FILES_DIR, grub, img_report.grub2_version);
fseek(fd, 0, SEEK_END);
grub2_len = ftell(fd);
fseek(fd, 0, SEEK_SET);
@ -1590,7 +1590,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
fd = fopen(tmp, "rb");
if (fd != NULL) {
// If a file already exists in the current directory, use that one
uprintf("Will replace obsolete '%s' from ISO with the one found in './" FILES_DIR "/%s'", old_c32_name[i], tmp);
uprintf("Will replace obsolete '%s' from ISO with the one found in '%s\\%s\\%s'",
old_c32_name[i], app_data_dir, FILES_DIR, tmp);
fclose(fd);
use_own_c32[i] = TRUE;
} else {
@ -1629,8 +1630,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
}
}
if ((syslinux_ldlinux_len[0] != 0) && (syslinux_ldlinux_len[1] != 0)) {
uprintf("Will reuse '%s.%s' and '%s.%s' from './" FILES_DIR "/%s/%s-%s%s/' for Syslinux installation",
ldlinux, ldlinux_ext[0], ldlinux, ldlinux_ext[1], FILES_DIR, syslinux,
uprintf("Will reuse '%s.%s' and '%s.%s' from '%s\\%s\\%s-%s%s\\' for Syslinux installation",
ldlinux, ldlinux_ext[0], ldlinux, ldlinux_ext[1], app_data_dir, FILES_DIR, syslinux,
img_report.sl_version_str, img_report.sl_version_ext);
} else {
r = MessageBoxExU(hMainDialog, lmprintf(MSG_114, img_report.sl_version_str, img_report.sl_version_ext,
@ -1686,7 +1687,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
static_sprintf(tmp, "%s-%s/%s.%s", syslinux, embedded_sl_version_str[1], ldlinux, ldlinux_ext[2]);
fd = fopenU(tmp, "rb");
if (fd != NULL) {
uprintf("Will reuse './%s/%s' for Syslinux installation", FILES_DIR, tmp);
uprintf("Will reuse '%s\\%s\\%s' for Syslinux installation", app_data_dir, FILES_DIR, tmp);
fclose(fd);
} else {
static_sprintf(tmp, "%s.%s", ldlinux, ldlinux_ext[2]);
@ -1719,7 +1720,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
static_sprintf(tmp, "grub4dos-%s/grldr", GRUB4DOS_VERSION);
fd = fopenU(tmp, "rb");
if (fd != NULL) {
uprintf("Will reuse './%s/%s' for Grub4DOS installation", FILES_DIR, tmp);
uprintf("Will reuse '%s\\%s\\%s' for Grub4DOS installation", app_data_dir, FILES_DIR, tmp);
fclose(fd);
} else {
static_sprintf(tmp, "grldr");
@ -3410,6 +3411,8 @@ skip_args_processing:
vc |= (safe_strcmp(tmp, cert_name[0]) == 0);
if (fd != NULL) {
ini_file = ini_path;
// In portable mode, use the app directory for all local storage
static_strcpy(app_data_dir, app_dir);
fclose(fd);
}
uprintf("Will use settings from %s", (ini_file != NULL)?"INI file":"registry");

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.16.1834"
CAPTION "Rufus 3.16.1835"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -395,8 +395,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,16,1834,0
PRODUCTVERSION 3,16,1834,0
FILEVERSION 3,16,1835,0
PRODUCTVERSION 3,16,1835,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.16.1834"
VALUE "FileVersion", "3.16.1835"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.16.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.16.1834"
VALUE "ProductVersion", "3.16.1835"
END
END
BLOCK "VarFileInfo"

View file

@ -179,7 +179,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
uprintf("Could not read %s", path);
goto out;
}
uprintf("Using existing './%s' %s", path,
uprintf("Using existing '%s\\%s' %s", app_data_dir, path,
IsBufferInDB(syslinux_ldlinux[i], (size_t)syslinux_ldlinux_len[i])?"":"");
}
} else {

View file

@ -160,7 +160,7 @@ static uint64_t progress_offset = 0, progress_total = 100;
static wchar_t wmount_path[MAX_PATH] = { 0 }, wmount_track[MAX_PATH] = { 0 };
static char sevenzip_path[MAX_PATH];
static const char conectix_str[] = VHD_FOOTER_COOKIE;
static BOOL count_files, use_msg_progress = FALSE;
static BOOL count_files;
// Apply/Mount image functionality
static const char *_image, *_dst;
static int _index, progress_op = OP_FILE_COPY, progress_msg = MSG_267;
@ -506,7 +506,7 @@ uint8_t WimExtractCheck(BOOL bSilent)
// So, yeah, this is both very slow and wasteful of space.
//
// NB: You can see mounted WIMs, along with their mountpoint, by checking:
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WIMMount\Mounted Images\
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WIMMount\Mounted Images
// You can also mount/unmount images from an elevated prompt with something like:
// dism /mount-image [/readonly] /imagefile:F:\sources\boot.wim /index:2 /mountdir:C:\test\offline
// dism /unmount-image /discard /mountdir:C:\test\offline