mirror of
https://github.com/amiayweb/Hytale-F2P.git
synced 2026-02-26 13:51:46 -03:00
- Introduced CLEAR-UPDATE-CACHE.md to guide users on clearing the electron-updater cache across macOS, Windows, and Linux. - Added programmatic method for cache clearing in JavaScript. - Enhanced update handling in main.js and preload.js to support new update events. - Updated GUI styles for download buttons and progress indicators in update.js and style.css.
1.9 KiB
1.9 KiB
Clearing Electron-Updater Cache
To force electron-updater to re-download an update file, you need to clear the cached download.
Quick Method (Terminal)
macOS
# Remove the entire cache directory
rm -rf ~/Library/Caches/hytale-f2p-launcher
# Or just remove pending downloads
rm -rf ~/Library/Caches/hytale-f2p-launcher/pending
Windows
# Remove the entire cache directory
rmdir /s "%LOCALAPPDATA%\hytale-f2p-launcher-updater"
# Or just remove pending downloads
rmdir /s "%LOCALAPPDATA%\hytale-f2p-launcher-updater\pending"
Linux
# Remove the entire cache directory
rm -rf ~/.cache/hytale-f2p-launcher-updater
# Or just remove pending downloads
rm -rf ~/.cache/hytale-f2p-launcher-updater/pending
Cache Locations
electron-updater stores downloaded updates in:
- macOS:
~/Library/Caches/hytale-f2p-launcher/ - Windows:
%LOCALAPPDATA%\hytale-f2p-launcher-updater\ - Linux:
~/.cache/hytale-f2p-launcher-updater/
The cache typically contains:
pending/- Downloaded update files waiting to be installed- Metadata files about available updates
After Clearing
After clearing the cache:
- Restart the launcher
- It will check for updates again
- The update will be re-downloaded from scratch
Programmatic Method
You can also clear the cache programmatically by adding this to your code:
const { autoUpdater } = require('electron-updater');
const path = require('path');
const fs = require('fs');
const os = require('os');
function clearUpdateCache() {
const cacheDir = path.join(
os.homedir(),
process.platform === 'win32'
? 'AppData/Local/hytale-f2p-launcher-updater'
: process.platform === 'darwin'
? 'Library/Caches/hytale-f2p-launcher'
: '.cache/hytale-f2p-launcher-updater'
);
if (fs.existsSync(cacheDir)) {
fs.rmSync(cacheDir, { recursive: true, force: true });
console.log('Update cache cleared');
}
}