Compare commits
2 Commits
c462f6bef5
...
6945b42886
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6945b42886 | ||
|
|
f00dc36a41 |
@ -52,6 +52,34 @@ class ConfigStore {
|
|||||||
? app.getPath('userData')
|
? app.getPath('userData')
|
||||||
: path.join(__dirname, '..');
|
: path.join(__dirname, '..');
|
||||||
this.filePath = path.join(dir, 'electron-config.json');
|
this.filePath = path.join(dir, 'electron-config.json');
|
||||||
|
|
||||||
|
// Migrate config from old location if current doesn't exist
|
||||||
|
if (!fs.existsSync(this.filePath) && app && app.isPackaged) {
|
||||||
|
this._migrateFromOldPath(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_migrateFromOldPath(app) {
|
||||||
|
try {
|
||||||
|
const appDataDir = path.dirname(app.getPath('userData'));
|
||||||
|
// Check alternate folder names that may have been used
|
||||||
|
const candidates = ['multi-hoster-uploader', 'Multi-Hoster-Upload'];
|
||||||
|
for (const name of candidates) {
|
||||||
|
const oldPath = path.join(appDataDir, name, 'electron-config.json');
|
||||||
|
if (oldPath !== this.filePath && fs.existsSync(oldPath)) {
|
||||||
|
fs.mkdirSync(path.dirname(this.filePath), { recursive: true });
|
||||||
|
fs.copyFileSync(oldPath, this.filePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Also check next to the executable (portable mode previous location)
|
||||||
|
const exeDir = path.dirname(app.getPath('exe'));
|
||||||
|
const portablePath = path.join(exeDir, 'electron-config.json');
|
||||||
|
if (portablePath !== this.filePath && fs.existsSync(portablePath)) {
|
||||||
|
fs.mkdirSync(path.dirname(this.filePath), { recursive: true });
|
||||||
|
fs.copyFileSync(portablePath, this.filePath);
|
||||||
|
}
|
||||||
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
load() {
|
load() {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "1.6.6",
|
"version": "1.6.7",
|
||||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user