윈도우 앱 재설치 없이 업데이트
This commit is contained in:
@@ -47,6 +47,11 @@
|
|||||||
"infoPlist": "Info.plist",
|
"infoPlist": "Info.plist",
|
||||||
"signingIdentity": "-",
|
"signingIdentity": "-",
|
||||||
"entitlements": "./Entitlements.plist"
|
"entitlements": "./Entitlements.plist"
|
||||||
|
},
|
||||||
|
"windows": {
|
||||||
|
"nsis": {
|
||||||
|
"installMode": "currentUser"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
@@ -54,7 +59,10 @@
|
|||||||
"endpoints": [
|
"endpoints": [
|
||||||
"https://exdev.co.kr/desktop/updates/latest.json"
|
"https://exdev.co.kr/desktop/updates/latest.json"
|
||||||
],
|
],
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDg3MUJCMjIyRkIyNzdFMUUKUldRZWZpZjdJckliaDlMS3pvRHpmQ2lnSFNjaDQrT1pEZTdDZEJ5S2RhOXV5aU1QY3JObEEwaFUK"
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDg3MUJCMjIyRkIyNzdFMUUKUldRZWZpZjdJckliaDlMS3pvRHpmQ2lnSFNjaDQrT1pEZTdDZEJ5S2RhOXV5aU1QY3JObEEwaFUK",
|
||||||
|
"windows": {
|
||||||
|
"installMode": "passive"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,15 @@ function cmpSemver(a, b) {
|
|||||||
/** @type {Record<string, { url: string; signature: string; bundleVersion: string }>} */
|
/** @type {Record<string, { url: string; signature: string; bundleVersion: string }>} */
|
||||||
const platforms = {};
|
const platforms = {};
|
||||||
|
|
||||||
|
/** Windows updater bundle 우선순위 (낮을수록 preferred) — setup.exe 수동 설치용은 제외 */
|
||||||
|
function windowsBundlePriority(name) {
|
||||||
|
const lower = name.toLowerCase();
|
||||||
|
if (lower.endsWith('.nsis.zip')) return 0;
|
||||||
|
if (lower.endsWith('.msi.zip')) return 1;
|
||||||
|
if (lower.endsWith('-setup.exe') || (lower.includes('setup') && lower.endsWith('.exe'))) return 9;
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
function addPlatform(platformKey, bundleName) {
|
function addPlatform(platformKey, bundleName) {
|
||||||
const bundlePath = path.join(dir, bundleName);
|
const bundlePath = path.join(dir, bundleName);
|
||||||
if (!fs.existsSync(bundlePath)) return;
|
if (!fs.existsSync(bundlePath)) return;
|
||||||
@@ -62,7 +71,17 @@ function addPlatform(platformKey, bundleName) {
|
|||||||
const bundleVersion = versionFromName(bundleName);
|
const bundleVersion = versionFromName(bundleName);
|
||||||
const effectiveVersion = bundleVersion === '0.0.0' ? version : bundleVersion;
|
const effectiveVersion = bundleVersion === '0.0.0' ? version : bundleVersion;
|
||||||
const existing = platforms[platformKey];
|
const existing = platforms[platformKey];
|
||||||
if (existing && cmpSemver(effectiveVersion, existing.bundleVersion) <= 0) return;
|
if (existing) {
|
||||||
|
const cmp = cmpSemver(effectiveVersion, existing.bundleVersion);
|
||||||
|
if (cmp < 0) return;
|
||||||
|
if (cmp === 0 && platformKey === 'windows-x86_64') {
|
||||||
|
const prevPri = windowsBundlePriority(path.basename(existing.url.split('/').pop() ?? ''));
|
||||||
|
const nextPri = windowsBundlePriority(bundleName);
|
||||||
|
if (nextPri > prevPri) return;
|
||||||
|
} else if (cmp === 0 && platformKey !== 'windows-x86_64') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
platforms[platformKey] = {
|
platforms[platformKey] = {
|
||||||
url: `${baseUrl}/${encodeURIComponent(bundleName)}`,
|
url: `${baseUrl}/${encodeURIComponent(bundleName)}`,
|
||||||
signature,
|
signature,
|
||||||
|
|||||||
Reference in New Issue
Block a user