summaryrefslogtreecommitdiff
path: root/node_modules/rcedit/lib
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/rcedit/lib')
-rw-r--r--node_modules/rcedit/lib/index.d.ts68
-rw-r--r--node_modules/rcedit/lib/rcedit.js43
2 files changed, 0 insertions, 111 deletions
diff --git a/node_modules/rcedit/lib/index.d.ts b/node_modules/rcedit/lib/index.d.ts
deleted file mode 100644
index 24c931a..0000000
--- a/node_modules/rcedit/lib/index.d.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Runs the `rcedit` Windows binary (via Wine on macOS/Linux) to modify the metadata of a
- * Windows executable.
- *
- * @param exePath - the path to the Windows executable to be modified
- * @param options - metadata used to update the Windows executable
- */
-declare function rcedit (exePath: string, options: rcedit.Options): Promise<void>
-
-/* eslint-disable-next-line no-redeclare */
-declare namespace rcedit {
- /** See [MSDN](https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/deployment/trustinfo-element-clickonce-application?view=vs-2015#requestedexecutionlevel) for details. */
- type RequestedExecutionLevel = 'asInvoker' | 'highestAvailable' | 'requireAdministrator'
- /**
- * Basic user-supplied metadata embedded in the application. Docstrings are copied from MSDN.
- *
- * See [MSDN](https://docs.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-block) for details.
- */
- interface VersionStringOptions {
- /** Additional information that should be displayed for diagnostic purposes. */
- Comments?: string
- /** Company that produced the executable. */
- CompanyName?: string
- /** File description to be presented to users. */
- FileDescription?: string
- /** Internal name of the file. Usually, this string should be the original filename, without the extension. */
- InternalFilename?: string
- /** Copyright notices that apply, including the full text of all notices, legal symbols, copyright dates, etc. */
- LegalCopyright?: string
- /** Trademarks and registered trademarks, including the full text of all notices, legal symbols, trademark numbers, etc. */
- LegalTrademarks1?: string
- /** Trademarks and registered trademarks, including the full text of all notices, legal symbols, trademark numbers, etc. */
- LegalTrademarks2?: string
- /** Original name of the file, not including a path. */
- OriginalFilename?: string
- /** Name of the product with which the file is distributed. */
- ProductName?: string
- }
- /**
- * EXE metadata that can be changed.
- */
- interface Options {
- /** The metadata within a version-information resource. */
- 'version-string'?: VersionStringOptions
- /**
- * See [MSDN](https://docs.microsoft.com/en-us/windows/win32/msi/version) for the version format.
- */
- 'file-version'?: string
- /**
- * See [MSDN](https://docs.microsoft.com/en-us/windows/win32/msi/version) for the version format.
- */
- 'product-version'?: string
- /**
- * Absolute path to the [ICO-formatted icon](https://en.wikipedia.org/wiki/ICO_(file_format))
- * to set as the application's icon.
- */
- icon?: string
- /** See [MSDN](https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/deployment/trustinfo-element-clickonce-application?view=vs-2015#requestedexecutionlevel) for details. */
- 'requested-execution-level'?: RequestedExecutionLevel
- /**
- * The path to the [application manifest](https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests)
- * XML that is to be embedded in the EXE.
- */
- 'application-manifest'?: string
- }
-}
-
-export = rcedit
diff --git a/node_modules/rcedit/lib/rcedit.js b/node_modules/rcedit/lib/rcedit.js
deleted file mode 100644
index b6bd5ce..0000000
--- a/node_modules/rcedit/lib/rcedit.js
+++ /dev/null
@@ -1,43 +0,0 @@
-const { canRunWindowsExeNatively, is64BitArch, spawnExe } = require('cross-spawn-windows-exe')
-const path = require('path')
-
-const pairSettings = ['version-string']
-const singleSettings = ['file-version', 'product-version', 'icon', 'requested-execution-level']
-const noPrefixSettings = ['application-manifest']
-
-module.exports = async (exe, options) => {
- const rceditExe = is64BitArch(process.arch) ? 'rcedit-x64.exe' : 'rcedit.exe'
- const rcedit = path.resolve(__dirname, '..', 'bin', rceditExe)
- const args = [exe]
-
- for (const name of pairSettings) {
- if (options[name]) {
- for (const [key, value] of Object.entries(options[name])) {
- args.push(`--set-${name}`, key, value)
- }
- }
- }
-
- for (const name of singleSettings) {
- if (options[name]) {
- args.push(`--set-${name}`, options[name])
- }
- }
-
- for (const name of noPrefixSettings) {
- if (options[name]) {
- args.push(`--${name}`, options[name])
- }
- }
-
- const spawnOptions = {
- env: { ...process.env }
- }
-
- if (!canRunWindowsExeNatively()) {
- // Suppress "fixme:" stderr log messages
- spawnOptions.env.WINEDEBUG = '-all'
- }
-
- await spawnExe(rcedit, args, spawnOptions)
-}