From e9e4083363e99e80bc71a512af063ce858dd4dd0 Mon Sep 17 00:00:00 2001 From: Evshiron Magicka Date: Fri, 14 Apr 2017 13:29:50 +0800 Subject: [PATCH] fix(nsis-gen): fix Unicode scripts reading --- docs/Options.md | 2 +- src/lib/nsis-gen/NsisComposer.ts | 12 +++++++----- src/lib/nsis-gen/index.ts | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/Options.md b/docs/Options.md index b50da05..5b8eb17 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -48,6 +48,6 @@ Name | Type | Description --- | --- | --- icon | string | .ico icon file for NSIS installers. Defaults to `undefined`. unIcon | string | .ico icon file for NSIS uninstallers. Defaults to `undefined`. -languages | string[] | Languages for NSIS installers. Multiple languages will result in a language selection dialog on startup. Defaults to `[ 'English' ]`. +languages | string[] | Languages for NSIS installers. Multiple languages will result in a language selection dialog on startup. See [/assets/nsis/Contrib/Language files/](../assets/nsis/Contrib/Language files/) for available values. Defaults to `[ 'English' ]`. diffUpdaters | boolean | Whether to build diff updaters. Defaults to `false`. hashCalculation | boolean | Whether to calculate hashes for installers and updaters. Defaults to `true`. diff --git a/src/lib/nsis-gen/NsisComposer.ts b/src/lib/nsis-gen/NsisComposer.ts index eae7846..4e1a572 100644 --- a/src/lib/nsis-gen/NsisComposer.ts +++ b/src/lib/nsis-gen/NsisComposer.ts @@ -95,6 +95,8 @@ ${ await this.makeUninstallSection() } # ${ NsisComposer.DIVIDER } +Unicode true + Name "${ this.options.appName }" Caption "${ this.options.appName }" BrandingText "${ this.options.appName } ${ this.fixedVersion }" @@ -168,11 +170,11 @@ ${ ${ NsisComposer.DIVIDER } VIProductVersion "${ this.fixedVersion }" -VIAddVersionKey "ProductName" "${ this.options.appName }" -VIAddVersionKey "CompanyName" "${ this.options.companyName }" -VIAddVersionKey "FileDescription" "${ this.options.description }" -VIAddVersionKey "FileVersion" "${ this.fixedVersion }" -VIAddVersionKey "LegalCopyright" "${ this.options.copyright }"`; +VIAddVersionKey /LANG=0 "ProductName" "${ this.options.appName }" +VIAddVersionKey /LANG=0 "CompanyName" "${ this.options.companyName }" +VIAddVersionKey /LANG=0 "FileDescription" "${ this.options.description }" +VIAddVersionKey /LANG=0 "FileVersion" "${ this.fixedVersion }" +VIAddVersionKey /LANG=0 "LegalCopyright" "${ this.options.copyright }"`; } protected async makeHookSection(): Promise { diff --git a/src/lib/nsis-gen/index.ts b/src/lib/nsis-gen/index.ts index 934d651..abe809c 100644 --- a/src/lib/nsis-gen/index.ts +++ b/src/lib/nsis-gen/index.ts @@ -17,7 +17,7 @@ export async function nsisBuild(cwd: string, script: string, options: INsisBuild mute: false, }) { - const args = [ win32.normalize(resolve(DIR_NSIS, 'makensis.exe')), '/NOCD', win32.normalize(resolve(script)) ]; + const args = [ win32.normalize(resolve(DIR_NSIS, 'makensis.exe')), '/NOCD', '/INPUTCHARSET', 'UTF8', win32.normalize(resolve(script)) ]; if(process.platform != 'win32') { args.unshift('wine'); }