@bobfrankston/msger 0.1.325 → 0.1.326
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/msger-native/builder/postinstall.js +14 -0
- package/package.json +1 -1
- package/shower.js +6 -1
|
@@ -76,6 +76,20 @@ if (fs.existsSync(srcBinary)) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
// Step 2b: Create/update a stable-name hardlink so the launcher always uses
|
|
80
|
+
// the same path. Taskbar pins and AUMID grouping depend on a fixed exe path.
|
|
81
|
+
// Hardlink shares inode with the timestamped copy — deleting the old link
|
|
82
|
+
// doesn't affect a running process (it holds its own file handle).
|
|
83
|
+
const stableLink = path.join(userBinDir, `${baseName}${ext}`);
|
|
84
|
+
try {
|
|
85
|
+
// Remove old link (may point to previous version)
|
|
86
|
+
try { fs.unlinkSync(stableLink); } catch { /* didn't exist */ }
|
|
87
|
+
fs.linkSync(versionedBinary, stableLink);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
// Hardlink failed (cross-device, locked, etc.) — copy as fallback
|
|
90
|
+
try { fs.copyFileSync(versionedBinary, stableLink); } catch { /* */ }
|
|
91
|
+
}
|
|
92
|
+
|
|
79
93
|
// Step 3a: Clean up old timestamped copies in the user bin dir (keep the one
|
|
80
94
|
// we just created). Locked copies are silently skipped — they get cleaned up
|
|
81
95
|
// on the next install once their owning process has exited.
|
package/package.json
CHANGED
package/shower.js
CHANGED
|
@@ -86,8 +86,13 @@ function resolveBinaryPath() {
|
|
|
86
86
|
baseName = 'msgernative';
|
|
87
87
|
ext = '';
|
|
88
88
|
}
|
|
89
|
+
// Prefer the stable-name hardlink in the user dir — same path every time,
|
|
90
|
+
// so taskbar pins and AUMID grouping don't break on updates.
|
|
91
|
+
const stableLink = path.join(userBinDir, `${baseName}${ext}`);
|
|
92
|
+
if (fs.existsSync(stableLink))
|
|
93
|
+
return stableLink;
|
|
89
94
|
const pattern = new RegExp(`^${baseName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}-(\\d+)${ext.replace('.', '\\.')}$`);
|
|
90
|
-
//
|
|
95
|
+
// Fallback: per-user timestamped copy (pre-hardlink installs)
|
|
91
96
|
try {
|
|
92
97
|
const matches = fs.readdirSync(userBinDir)
|
|
93
98
|
.filter(f => pattern.test(f))
|