Skip to content

Commit

Permalink
fix(nsis): turkish lang - missed translation leads to error
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Mar 22, 2018
1 parent f339278 commit 9748776
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
9 changes: 4 additions & 5 deletions packages/builder-util/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ function removeWineSpam(out: string) {
}

export interface ExtraSpawnOptions {
isDebugEnabled?: boolean
isPipeInput?: boolean
}

Expand Down Expand Up @@ -164,7 +163,7 @@ export function doSpawn(command: string, args: Array<string>, options?: SpawnOpt
options.env = getProcessEnv(options.env)

if (options.stdio == null) {
const isDebugEnabled = extraOptions == null || extraOptions.isDebugEnabled == null ? debug.enabled : extraOptions.isDebugEnabled
const isDebugEnabled = debug.enabled
// do not ignore stdout/stderr if not debug, because in this case we will read into buffer and print on error
options.stdio = [extraOptions != null && extraOptions.isPipeInput ? "pipe" : "ignore", isDebugEnabled ? "inherit" : "pipe", isDebugEnabled ? "inherit" : "pipe"]
}
Expand All @@ -178,11 +177,11 @@ export function doSpawn(command: string, args: Array<string>, options?: SpawnOpt
}
}

export function spawnAndWrite(command: string, args: Array<string>, data: string, options?: SpawnOptions, isDebugEnabled: boolean = false) {
const childProcess = doSpawn(command, args, options, {isPipeInput: true, isDebugEnabled})
export function spawnAndWrite(command: string, args: Array<string>, data: string, options?: SpawnOptions) {
const childProcess = doSpawn(command, args, options, {isPipeInput: true})
const timeout = setTimeout(() => childProcess.kill(), 4 * 60 * 1000)
return new Promise<any>((resolve, reject) => {
handleProcess("close", childProcess, command, false, () => {
handleProcess("close", childProcess, command, true, () => {
try {
clearTimeout(timeout)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export class NsisTarget extends Target {
// we use NSIS_CONFIG_CONST_DATA_PATH=no to build makensis on Linux, but in any case it doesn't use stubs as MacOS/Windows version, so, we explicitly set NSISDIR
env: {...process.env, NSISDIR: nsisPath},
cwd: nsisTemplatesDir,
}, debug.enabled)
})
}

private async computeCommonInstallerScriptHeader() {
Expand Down
7 changes: 6 additions & 1 deletion packages/electron-builder-lib/src/targets/nsis/nsisLang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ function computeCustomMessageTranslations(messages: any, langConfigurator: LangC
continue
}

result.push(`LangString ${messageId} ${lcid[langWithRegion]} "${langToTranslations[lang].replace(/\n/g, "$\\r$\\n")}"`)
const value = langToTranslations[lang]
if (value == null) {
throw new Error(`${messageId} not specified for ${lang}`)
}

result.push(`LangString ${messageId} ${lcid[langWithRegion]} "${value.replace(/\n/g, "$\\r$\\n")}"`)
unspecifiedLangs.delete(langWithRegion)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder-lib/src/targets/nsis/nsisUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { NsisTarget } from "./NsisTarget"
export const nsisTemplatesDir = getTemplatePath("nsis")

// noinspection SpellCheckingInspection
export const NSIS_PATH = new Lazy(() => getBinFromGithub("nsis", "3.0.1.13", "WtEinikNm5ES8WSf1ZDefuUahn7iewbtVmJrRg4xWfm4eaESSJKy9pKIMRMgszdKw5e3YooCOqObnC5qJIfTLA=="))
export const NSIS_PATH = new Lazy(() => getBinFromGithub("nsis", "3.0.3.0", "3cZfTAEgX/iatMcjmh4c8ZSwhO76Oqpneb4UPzT+uWxsAfZdUgSuls3WXwOtb9oY+wqSvY7+WRvO8944RSTUcg=="))

export class AppPackageHelper {
private readonly archToFileInfo = new Map<Arch, Promise<PackageFileInfo>>()
Expand Down
2 changes: 1 addition & 1 deletion test/src/windows/oneClickInstallerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ test.ifAll.ifNotCiMac("menuCategory", app({
}
}))

test.ifAll.ifNotCiMac("string menuCategory", app({
test.ifNotCiMac("string menuCategory", app({
targets: Platform.WINDOWS.createTarget(["nsis"], Arch.ia32),
config: {
extraMetadata: {
Expand Down

0 comments on commit 9748776

Please sign in to comment.