mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-28 04:19:01 +00:00
This commit is contained in:
parent
7531c3136e
commit
bbd51ad988
@ -16,6 +16,7 @@
|
|||||||
- [[app-version]](#app-version)
|
- [[app-version]](#app-version)
|
||||||
- [[build-version]](#build-version)
|
- [[build-version]](#build-version)
|
||||||
- [[electron-version]](#electron-version)
|
- [[electron-version]](#electron-version)
|
||||||
|
- [[widevine]](#widevine)
|
||||||
- [[no-overwrite]](#no-overwrite)
|
- [[no-overwrite]](#no-overwrite)
|
||||||
- [[conceal]](#conceal)
|
- [[conceal]](#conceal)
|
||||||
- [[icon]](#icon)
|
- [[icon]](#icon)
|
||||||
@ -171,6 +172,14 @@ The build version of the application. Maps to the `FileVersion` metadata propert
|
|||||||
|
|
||||||
Electron version without the `v`, see https://github.com/atom/electron/releases.
|
Electron version without the `v`, see https://github.com/atom/electron/releases.
|
||||||
|
|
||||||
|
#### [widevine]
|
||||||
|
|
||||||
|
```
|
||||||
|
--widevine
|
||||||
|
```
|
||||||
|
|
||||||
|
Use a Widevine-enabled version of Electron for DRM playback, see https://github.com/castlabs/electron-releases.
|
||||||
|
|
||||||
#### [no-overwrite]
|
#### [no-overwrite]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -118,6 +118,10 @@ if (require.main === module) {
|
|||||||
'-e, --electron-version <value>',
|
'-e, --electron-version <value>',
|
||||||
"electron version to package, without the 'v', see https://github.com/electron/electron/releases",
|
"electron version to package, without the 'v', see https://github.com/electron/electron/releases",
|
||||||
)
|
)
|
||||||
|
.option(
|
||||||
|
'--widevine',
|
||||||
|
"use a Widevine-enabled version of Electron for DRM playback (use at your own risk, it's unofficial, provided by CastLabs)",
|
||||||
|
)
|
||||||
.option(
|
.option(
|
||||||
'--no-overwrite',
|
'--no-overwrite',
|
||||||
'do not override output directory if it already exists; defaults to false',
|
'do not override output directory if it already exists; defaults to false',
|
||||||
|
@ -39,7 +39,7 @@ export function getTempDir(prefix: string, mode?: number): string {
|
|||||||
export async function copyFileOrDir(
|
export async function copyFileOrDir(
|
||||||
sourceFileOrDir: string,
|
sourceFileOrDir: string,
|
||||||
dest: string,
|
dest: string,
|
||||||
): Promise<any> {
|
): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
ncp(sourceFileOrDir, dest, (error: any) => {
|
ncp(sourceFileOrDir, dest, (error: any) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
|
||||||
|
import axios from 'axios';
|
||||||
import * as log from 'loglevel';
|
import * as log from 'loglevel';
|
||||||
|
|
||||||
// package.json is `require`d to let tsc strip the `src` folder by determining
|
// package.json is `require`d to let tsc strip the `src` folder by determining
|
||||||
@ -130,6 +131,26 @@ export async function getOptions(rawOptions: any): Promise<AppOptions> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rawOptions.widevine) {
|
||||||
|
const widevineElectronVersion = `${options.packager.electronVersion}-wvvmp`;
|
||||||
|
try {
|
||||||
|
await axios.get(
|
||||||
|
`https://github.com/castlabs/electron-releases/releases/tag/v${widevineElectronVersion}`,
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
throw `\nERROR: castLabs Electron version "${widevineElectronVersion}" does not exist. \nVerify versions at https://github.com/castlabs/electron-releases/releases. \nAborting.`;
|
||||||
|
}
|
||||||
|
|
||||||
|
options.packager.electronVersion = widevineElectronVersion;
|
||||||
|
process.env.ELECTRON_MIRROR =
|
||||||
|
'https://github.com/castlabs/electron-releases/releases/download/';
|
||||||
|
log.warn(
|
||||||
|
`\nATTENTION: Using the **unofficial** Electron from castLabs`,
|
||||||
|
"\nIt implements Google's Widevine Content Decryption Module (CDM) for DRM-enabled playback.",
|
||||||
|
`\nSimply abort & re-run without passing the widevine flag to default to ${DEFAULT_ELECTRON_VERSION}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (options.nativefier.flashPluginDir) {
|
if (options.nativefier.flashPluginDir) {
|
||||||
options.nativefier.insecure = true;
|
options.nativefier.insecure = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user