윈도우 앱 재설치 없이 업데이트

This commit is contained in:
Macbook
2026-06-15 16:33:44 +09:00
parent 63a40c9c75
commit 02799cc8f8
2 changed files with 29 additions and 2 deletions
+9 -1
View File
@@ -47,6 +47,11 @@
"infoPlist": "Info.plist",
"signingIdentity": "-",
"entitlements": "./Entitlements.plist"
},
"windows": {
"nsis": {
"installMode": "currentUser"
}
}
},
"plugins": {
@@ -54,7 +59,10 @@
"endpoints": [
"https://exdev.co.kr/desktop/updates/latest.json"
],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDg3MUJCMjIyRkIyNzdFMUUKUldRZWZpZjdJckliaDlMS3pvRHpmQ2lnSFNjaDQrT1pEZTdDZEJ5S2RhOXV5aU1QY3JObEEwaFUK"
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDg3MUJCMjIyRkIyNzdFMUUKUldRZWZpZjdJckliaDlMS3pvRHpmQ2lnSFNjaDQrT1pEZTdDZEJ5S2RhOXV5aU1QY3JObEEwaFUK",
"windows": {
"installMode": "passive"
}
}
}
}
+20 -1
View File
@@ -48,6 +48,15 @@ function cmpSemver(a, b) {
/** @type {Record<string, { url: string; signature: string; bundleVersion: string }>} */
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) {
const bundlePath = path.join(dir, bundleName);
if (!fs.existsSync(bundlePath)) return;
@@ -62,7 +71,17 @@ function addPlatform(platformKey, bundleName) {
const bundleVersion = versionFromName(bundleName);
const effectiveVersion = bundleVersion === '0.0.0' ? version : bundleVersion;
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] = {
url: `${baseUrl}/${encodeURIComponent(bundleName)}`,
signature,