[core] move downloads from <app_location>\rufus_files\ to %LOCALAPPDATA%\Rufus\

* While this is intended to solve the issue of saving GRUB/Syslinux files for the
  App Store version, we apply this change globally, as it allows the user to move
  the Rufus executable around while preserving access to existing downloads.
* Closes #1744
This commit is contained in:
Pete Batard 2021-05-31 16:54:11 +01:00
parent aeae66e971
commit 9d7e96e293
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
10 changed files with 47 additions and 28 deletions

View file

@ -1,7 +1,7 @@
/*
* Rufus: The Reliable USB Formatting Utility
* ISO file extraction
* Copyright © 2011-2020 Pete Batard <pete@akeo.ie>
* Copyright © 2011-2021 Pete Batard <pete@akeo.ie>
* Based on libcdio's iso & udf samples:
* Copyright © 2003-2014 Rocky Bernstein <rocky@gnu.org>
*
@ -512,7 +512,7 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha
continue;
}
print_extracted_file(psz_fullpath, file_length);
for (i=0; i<NB_OLD_C32; i++) {
for (i = 0; i < NB_OLD_C32; i++) {
if (props.is_old_c32[i] && use_own_c32[i]) {
static_sprintf(tmp, "%s/syslinux-%s/%s", FILES_DIR, embedded_sl_version_str[0], old_c32_name[i]);
if (CopyFileU(tmp, psz_fullpath, FALSE)) {
@ -869,7 +869,7 @@ BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan)
PrintInfo(0, MSG_202);
} else {
uprintf("Extracting files...\n");
IGNORE_RETVAL(_chdirU(app_dir));
IGNORE_RETVAL(_chdirU(app_data_dir));
if (total_blocks == 0) {
uprintf("Error: ISO has not been properly scanned.\n");
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_ISO_SCAN);