Skip to content

Commit c25e5b5

Browse files
committed
Judge Windows install paths as Windows paths on any system, and syntax-check the updater in CI
The check for an all-users Windows install used the host's path rules, so its test failed on the Linux build machine. It now uses Windows path rules directly, and CI parses the updater files along with the rest.
1 parent bdb1328 commit c25e5b5

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/setup-node@v4
1616
with: { node-version: 24 }
1717
- name: Every script parses
18-
run: for f in main.js preload.js renderer.js providerInfo.js recordings.js ui-store.js build/*.js news/*.js; do node --check "$f"; done
18+
run: for f in main.js preload.js renderer.js providerInfo.js recordings.js ui-store.js build/*.js news/*.js updater/*.js; do node --check "$f"; done
1919
- name: Tests
2020
run: npm test
2121
- name: Styles follow DESIGN.md

‎updater/apply.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ function capability({ platform = process.platform, packaged, execPath = process.
4848
// A per-user install lives under the user's own folders; an all-users one under Program Files and
4949
// needs a permission prompt to change.
5050
function needsElevation(execPath, env) {
51-
const p = path.resolve(execPath).toLowerCase();
51+
// Windows paths, judged as Windows paths whatever system this runs on.
52+
const p = path.win32.resolve(execPath).toLowerCase();
5253
return [env.ProgramFiles, env['ProgramFiles(x86)'], env.ProgramW6432]
5354
.filter(Boolean)
54-
.some((root) => p.startsWith(path.resolve(root).toLowerCase() + path.sep));
55+
.some((root) => p.startsWith(path.win32.resolve(root).toLowerCase() + path.win32.sep));
5556
}
5657

5758
function bundleProblem(bundle) {

0 commit comments

Comments
 (0)