Skip to content

Commit

Permalink
feat: support additionalLightArgs for msi target (#8120)
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondkmp authored Mar 11, 2024
1 parent 25a2489 commit 00f46e6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/neat-bottles-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": minor
---

feat: support `additionalLightArgs` for msi target
1 change: 1 addition & 0 deletions docs/configuration/msi.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<li><code id="MsiOptions-upgradeCode">upgradeCode</code> String | “undefined” - The <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx">upgrade code</a>. Optional, by default generated using app id.</li>
<li><code id="MsiOptions-warningsAsErrors">warningsAsErrors</code> = <code>true</code> Boolean - If <code>warningsAsErrors</code> is <code>true</code> (default): treat warnings as errors. If <code>warningsAsErrors</code> is <code>false</code>: allow warnings.</li>
<li><code id="MsiOptions-additionalWixArgs">additionalWixArgs</code> Array&lt;String&gt; | “undefined” - Any additional arguments to be passed to the WiX installer compiler, such as <code>[&quot;-ext&quot;, &quot;WixUtilExtension&quot;]</code></li>
<li><code id="MsiOptions-additionalLightArgs">additionalLightArgs</code> Array&lt;String&gt; | “undefined” - Any additional arguments to be passed to the light.ext, such as <code>[&quot;-cultures:ja-jp&quot;]</code></li>
<li><code id="MsiOptions-perMachine">perMachine</code> = <code>false</code> Boolean - Whether to install per all users (per-machine).</li>
<li><code id="MsiOptions-runAfterFinish">runAfterFinish</code> = <code>true</code> Boolean - Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.</li>
</ul>
Expand Down
14 changes: 14 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -3597,6 +3597,20 @@
"MsiOptions": {
"additionalProperties": false,
"properties": {
"additionalLightArgs": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Any additional arguments to be passed to the light.ext, such as `[\"-cultures:ja-jp\"]`"
},
"additionalWixArgs": {
"anyOf": [
{
Expand Down
5 changes: 5 additions & 0 deletions packages/app-builder-lib/src/options/MsiOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ export interface MsiOptions extends CommonWindowsInstallerConfiguration, TargetS
* Any additional arguments to be passed to the WiX installer compiler, such as `["-ext", "WixUtilExtension"]`
*/
readonly additionalWixArgs?: Array<string> | null

/**
* Any additional arguments to be passed to the light.ext, such as `["-cultures:ja-jp"]`
*/
readonly additionalLightArgs?: Array<string> | null
}
12 changes: 11 additions & 1 deletion packages/app-builder-lib/src/targets/MsiTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ export default class MsiTarget extends Target {
"-sw1076",
`-dappDir=${vm.toVmFile(appOutDir)}`,
// "-dcl:high",
].concat(this.getCommonWixArgs())
]
.concat(this.getCommonWixArgs())
.concat(this.getAdditionalLightArgs())

// http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Build-3-5-2229-0-give-me-the-following-error-error-LGHT0216-An-unexpected-Win32-exception-with-errorn-td5707443.html
if (process.platform !== "win32") {
Expand All @@ -145,6 +147,14 @@ export default class MsiTarget extends Target {
})
}

private getAdditionalLightArgs() {
const args: Array<string> = []
if (this.options.additionalLightArgs != null) {
args.push(...this.options.additionalLightArgs)
}
return args
}

private getCommonWixArgs() {
const args: Array<string> = ["-pedantic"]
if (this.options.warningsAsErrors !== false) {
Expand Down

0 comments on commit 00f46e6

Please sign in to comment.