forked from rancher-sandbox/rancher-desktop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwix.ts
30 lines (24 loc) · 816 Bytes
/
wix.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// This script builds the wix installer, assuming the zip file has already been
// built (and dist/win-unpacked is populated).
// This is only used during development.
import fs from 'fs';
import path from 'path';
import buildInstaller from './lib/installer-win32';
async function run() {
const distDir = path.join(process.cwd(), 'dist');
const appDir = path.join(distDir, 'win-unpacked');
try {
await fs.promises.access(path.join(appDir, 'resources', 'app.asar'), fs.constants.R_OK);
} catch (ex) {
if ((ex as NodeJS.ErrnoException).code !== 'ENOENT') {
throw ex;
}
console.error(`Could not find ${ appDir }, please run \`yarn build\` first.`);
process.exit(1);
}
await buildInstaller(distDir, appDir);
}
run().catch((ex) => {
console.error(ex);
process.exit(1);
});