Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip rcedit for .msi installer #677

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions src/winPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,29 +147,32 @@ export class WinPackager extends PlatformPackager<WinBuildOptions> {
}

async signAndEditResources(file: string) {
const appInfo = this.appInfo

const args = [
file,
"--set-version-string", "CompanyName", appInfo.companyName,
"--set-version-string", "FileDescription", appInfo.description,
"--set-version-string", "ProductName", appInfo.productName,
"--set-version-string", "InternalName", appInfo.productName,
"--set-version-string", "LegalCopyright", appInfo.copyright,
"--set-version-string", "OriginalFilename", "",
"--set-file-version", appInfo.buildVersion,
"--set-product-version", appInfo.version,
]

use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push("--set-version-string", "LegalTrademarks", it!))
use(await this.getIconPath(), it => args.push("--set-icon", it))

const rceditExecutable = path.join(await getSignVendorPath(), "rcedit.exe")
const isWin = process.platform === "win32"
if (!isWin) {
args.unshift(rceditExecutable)
// rcedit can only edit .exe resources
if (path.extname(file) !== ".msi") {
const appInfo = this.appInfo

const args = [
file,
"--set-version-string", "CompanyName", appInfo.companyName,
"--set-version-string", "FileDescription", appInfo.description,
"--set-version-string", "ProductName", appInfo.productName,
"--set-version-string", "InternalName", appInfo.productName,
"--set-version-string", "LegalCopyright", appInfo.copyright,
"--set-version-string", "OriginalFilename", "",
"--set-file-version", appInfo.buildVersion,
"--set-product-version", appInfo.version,
]

use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push("--set-version-string", "LegalTrademarks", it!))
use(await this.getIconPath(), it => args.push("--set-icon", it))

const rceditExecutable = path.join(await getSignVendorPath(), "rcedit.exe")
const isWin = process.platform === "win32"
if (!isWin) {
args.unshift(rceditExecutable)
}
await exec(isWin ? rceditExecutable : "wine", args)
}
await exec(isWin ? rceditExecutable : "wine", args)

await this.sign(file)
}
Expand Down Expand Up @@ -247,4 +250,4 @@ function parseIco(buffer: Buffer): Array<Size> {

function isIco(buffer: Buffer): boolean {
return buffer.readUInt16LE(0) === 0 && buffer.readUInt16LE(2) === 1
}
}