diff --git a/README.md b/README.md index a790f71..a998dd9 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ detailed configuration of the UI. It has the following optional properties: * `template` (string, optional) - Substitute your own XML that will be inserted into the final `.wxs` file before compiling the installer to customize the UI options. +* `localizations` (string[], optional) - Provide an array of paths to `.wxl` files. * `chooseDirectory` (boolean, optional) - If set to `true`, the end user will be able to choose the installation directory. Set to `false` by default. Without effect if a custom `template` is used. diff --git a/package-lock.json b/package-lock.json index eeff997..636a215 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "electron-wix-msi", - "version": "2.1.1", + "version": "2.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8874a29..f413e0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "electron-wix-msi", - "version": "2.1.1", + "name": "@kno2/electron-wix-msi", + "version": "2.1.5", "description": "Creates an MSI installer for your Electron app", "license": "MIT", "repository": "", diff --git a/src/creator.ts b/src/creator.ts index 4e059c5..d85213b 100644 --- a/src/creator.ts +++ b/src/creator.ts @@ -41,6 +41,7 @@ export interface UIOptions { chooseDirectory?: boolean; template?: string; images?: UIImages; + localizations?: Array; } export interface UIImages { @@ -256,6 +257,10 @@ export class MSICreator { const preArgs = flatMap(this.extensions.map((e) => (['-ext', e]))); + if (typeof this.ui === 'object' && this.ui.localizations && this.ui.localizations.length && type === 'msi') { + this.ui.localizations.forEach((l) => preArgs.push('-loc', l)); + } + const { code, stderr, stdout } = await spawnPromise(binary, [ ...preArgs, input ], { env: process.env, cwd @@ -316,9 +321,9 @@ export class MSICreator { if (typeof this.ui === 'object' && this.ui !== 'null') { const { images, template, chooseDirectory } = this.ui; const propertiesXml = this.getUIProperties(this.ui); - const uiTemplate = template || chooseDirectory + const uiTemplate = template || (chooseDirectory ? this.uiDirTemplate - : this.uiTemplate; + : this.uiTemplate); xml = replaceInString(uiTemplate, { '': propertiesXml diff --git a/static/wix.xml b/static/wix.xml index 8be9a58..ce79af5 100644 --- a/static/wix.xml +++ b/static/wix.xml @@ -19,9 +19,7 @@ - +