-
Notifications
You must be signed in to change notification settings - Fork 502
/
Copy pathpackager.js
50 lines (44 loc) · 1.3 KB
/
packager.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var packager = require('electron-packager');
var osType = require('os').type();
var argv = require('yargs').argv;
var platform = null;
if (osType == "Darwin" || osType == "Linux") {
platform = osType.toLowerCase();
} else if (osType == "Windows_NT") {
platform = "win32"
}
var NAME = "hifi-screenshare";
var options = {
dir: __dirname,
name: NAME,
version: "0.1.0",
overwrite: true,
prune: true,
arch: "x64",
platform: platform,
ignore: "electron-packager|README.md|CMakeLists.txt|packager.js|.gitignore"
};
// setup per OS options
if (osType == "Darwin") {
options["app-bundle-id"] = "com.highfidelity.hifi-screenshare";
} else if (osType == "Windows_NT") {
options["version-string"] = {
CompanyName: "High Fidelity, Inc.",
FileDescription: "High Fidelity Screenshare",
ProductName: NAME,
OriginalFilename: NAME + ".exe"
}
}
// check if we were passed a custom out directory, pass it along if so
if (argv.out) {
options.out = argv.out
}
// call the packager to produce the executable
packager(options)
.then(appPath => {
console.log("Wrote new app to " + appPath);
})
.catch(error => {
console.error("There was an error writing the packaged console: " + error.message);
process.exit(1);
});