summaryrefslogtreecommitdiff
path: root/node_modules/electron-packager/src/win32.js
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/electron-packager/src/win32.js
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/electron-packager/src/win32.js')
-rw-r--r--node_modules/electron-packager/src/win32.js113
1 files changed, 0 insertions, 113 deletions
diff --git a/node_modules/electron-packager/src/win32.js b/node_modules/electron-packager/src/win32.js
deleted file mode 100644
index 9416617..0000000
--- a/node_modules/electron-packager/src/win32.js
+++ /dev/null
@@ -1,113 +0,0 @@
-'use strict'
-
-const debug = require('debug')('electron-packager')
-const path = require('path')
-const { WrapperError } = require('cross-spawn-windows-exe')
-
-const App = require('./platform')
-const common = require('./common')
-
-function updateWineMissingException (err) {
- if (err instanceof WrapperError) {
- err.message += '\n\n' +
- 'Wine is required to use the appCopyright, appVersion, buildVersion, icon, and \n' +
- 'win32metadata parameters for Windows targets.\n\n' +
- 'See https://github.com/electron/electron-packager#building-windows-apps-from-non-windows-platforms for details.'
- }
-
- return err
-}
-
-class WindowsApp extends App {
- get originalElectronName () {
- return 'electron.exe'
- }
-
- get newElectronName () {
- return `${common.sanitizeAppName(this.executableName)}.exe`
- }
-
- get electronBinaryPath () {
- return path.join(this.stagingPath, this.newElectronName)
- }
-
- generateRceditOptionsSansIcon () {
- const win32metadata = {
- FileDescription: this.opts.name,
- InternalName: this.opts.name,
- OriginalFilename: this.newElectronName,
- ProductName: this.opts.name,
- ...this.opts.win32metadata
- }
-
- const rcOpts = { 'version-string': win32metadata }
-
- if (this.opts.appVersion) {
- rcOpts['product-version'] = rcOpts['file-version'] = this.opts.appVersion
- }
-
- if (this.opts.buildVersion) {
- rcOpts['file-version'] = this.opts.buildVersion
- }
-
- if (this.opts.appCopyright) {
- rcOpts['version-string'].LegalCopyright = this.opts.appCopyright
- }
-
- const manifestProperties = ['application-manifest', 'requested-execution-level']
- for (const manifestProperty of manifestProperties) {
- if (win32metadata[manifestProperty]) {
- rcOpts[manifestProperty] = win32metadata[manifestProperty]
- }
- }
-
- return rcOpts
- }
-
- async getIconPath () {
- if (!this.opts.icon) {
- return Promise.resolve()
- }
-
- return this.normalizeIconExtension('.ico')
- }
-
- needsRcedit () {
- return this.opts.icon || this.opts.win32metadata || this.opts.appCopyright || this.opts.appVersion || this.opts.buildVersion
- }
-
- async runRcedit () {
- /* istanbul ignore if */
- if (!this.needsRcedit()) {
- return Promise.resolve()
- }
-
- const rcOpts = this.generateRceditOptionsSansIcon()
-
- // Icon might be omitted or only exist in one OS's format, so skip it if normalizeExt reports an error
- const icon = await this.getIconPath()
- if (icon) {
- rcOpts.icon = icon
- }
-
- debug(`Running rcedit with the options ${JSON.stringify(rcOpts)}`)
- try {
- await require('rcedit')(this.electronBinaryPath, rcOpts)
- } catch (err) {
- throw updateWineMissingException(err)
- }
- }
-
- async create () {
- await this.initialize()
- await this.renameElectron()
- await this.copyExtraResources()
- await this.runRcedit()
- return this.move()
- }
-}
-
-module.exports = {
- App: WindowsApp,
- updateWineMissingException: updateWineMissingException
-}