Skip to content

Commit aeb951c

Browse files
[PSerban93][PSerban93]
authored andcommitted
Chagelog:
- Fix the issue when first notification is not displayed. - Fix the issue with Start in Tray not working properly. - Swap the max_progress and progress on ach_cache syntax. - Fix Manual Configs creation added wrong appid on save path. - GOG and Tenoke UE games support. - Add Notifications Sound Volume on Settings. - Add Notifications Duration on Settings and adjusting presets to support it. - Add Close to Tray option on Settings. - Add Per Game Notification progress on/off. - Extend the language option in dropdown. [If schema contain it] - Add High DPI adjustments and a new Tray menu. - Schema generated with API now contains the hidden description on multiple languages.
1 parent 5695b37 commit aeb951c

39 files changed

+1981
-372
lines changed

build/afterPack.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
const path = require("path");
2+
const fs = require("fs");
3+
4+
module.exports = async (context) => {
5+
if (context.electronPlatformName !== "win32") return;
6+
7+
const appOutDir = context.appOutDir;
8+
if (!appOutDir) {
9+
throw new Error("afterPack: appOutDir is missing");
10+
}
11+
12+
const exeName = context.packager?.appInfo?.productFilename
13+
? `${context.packager.appInfo.productFilename}.exe`
14+
: null;
15+
let exePath = exeName ? path.join(appOutDir, exeName) : null;
16+
if (!exePath || !fs.existsSync(exePath)) {
17+
const exeCandidates = fs
18+
.readdirSync(appOutDir)
19+
.filter((name) => name.toLowerCase().endsWith(".exe"));
20+
if (!exeCandidates.length) {
21+
throw new Error(`afterPack: no exe found in ${appOutDir}`);
22+
}
23+
exePath = path.join(appOutDir, exeCandidates[0]);
24+
}
25+
26+
const projectDir = context.projectDir || process.cwd();
27+
const manifestPath = path.join(projectDir, "build", "app.manifest");
28+
if (!fs.existsSync(manifestPath)) {
29+
throw new Error(`afterPack: manifest missing at ${manifestPath}`);
30+
}
31+
32+
const mod = await import("rcedit");
33+
const rceditFn = mod?.rcedit || mod?.default;
34+
if (typeof rceditFn !== "function") {
35+
throw new Error("afterPack: rcedit export is not a function");
36+
}
37+
38+
const appInfo = context.packager?.appInfo;
39+
const productName = appInfo?.productName || "Achievements";
40+
const companyName = appInfo?.companyName || "";
41+
const copyright = appInfo?.copyright || "";
42+
const rawVersion =
43+
appInfo?.version ||
44+
appInfo?.buildVersion ||
45+
appInfo?.shortVersion ||
46+
"1.0.0";
47+
const versionParts = String(rawVersion)
48+
.split(".")
49+
.filter(Boolean);
50+
while (versionParts.length < 4) versionParts.push("0");
51+
const fileVersion = versionParts.slice(0, 4).join(".");
52+
53+
const requestedExecutionLevel =
54+
context.packager?.platformSpecificBuildOptions?.requestedExecutionLevel ||
55+
null;
56+
const relIcon =
57+
context.packager?.platformSpecificBuildOptions?.icon || "icon.ico";
58+
const iconPath = path.isAbsolute(relIcon)
59+
? relIcon
60+
: path.join(projectDir, relIcon);
61+
const hasIcon = iconPath && fs.existsSync(iconPath);
62+
63+
const versionStrings = {
64+
FileDescription: productName,
65+
ProductName: productName,
66+
InternalName: productName,
67+
OriginalFilename: path.basename(exePath),
68+
};
69+
if (companyName) versionStrings.CompanyName = companyName;
70+
if (copyright) versionStrings.LegalCopyright = copyright;
71+
72+
await rceditFn(exePath, {
73+
"application-manifest": manifestPath,
74+
"version-string": versionStrings,
75+
"file-version": fileVersion,
76+
"product-version": fileVersion,
77+
...(requestedExecutionLevel
78+
? { "requested-execution-level": requestedExecutionLevel }
79+
: {}),
80+
...(hasIcon ? { icon: iconPath } : {}),
81+
});
82+
};

build/app.manifest

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
2+
<application xmlns="urn:schemas-microsoft-com:asm.v3">
3+
<windowsSettings>
4+
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">PerMonitorV2</dpiAware>
5+
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
6+
</windowsSettings>
7+
</application>
8+
</assembly>

0 commit comments

Comments
 (0)