fix(premiere-plugin): make build pipeline portable to Windows PowerShell 5.1
End-to-end verification on a fresh Windows machine surfaced three issues: 1. pwsh isn't installed by default — Windows ships powershell.exe (5.1). Switched all script invocations + docs from `pwsh` to `powershell`. 2. .NET's strict XML parser rejects manifest.xml because the <Resources> comment legally contains `--` (inside `--enable-nodejs`/`--mixed-context` CEF flag names). Switched build-installer.ps1 to regex extraction, matching what build-zxp.mjs already does. 3. winget installs Inno Setup 6 to %LOCALAPPDATA%\Programs by default, not Program Files (x86). Added the user-scope path to the ISCC.exe fallback list. Verified: `powershell -File build-all.ps1` produces both artifacts — dragonflight-premiere-panel-1.0.0.zxp (35 KB, signature valid) dragonflight-premiere-panel-1.0.0-windows-setup.exe (2 MB). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
0ff2625876
commit
8aece9cbc4
5 changed files with 24 additions and 14 deletions
|
|
@ -45,7 +45,7 @@ Building locally (requires Windows for the `.exe`, any OS for the `.zxp`):
|
||||||
```
|
```
|
||||||
cd services/premiere-plugin/build
|
cd services/premiere-plugin/build
|
||||||
npm install
|
npm install
|
||||||
pwsh -File build-all.ps1 # or: node build-zxp.mjs
|
powershell -File build-all.ps1 # or: node build-zxp.mjs
|
||||||
```
|
```
|
||||||
|
|
||||||
The Windows installer takes care of `PlayerDebugMode`. If you installed the
|
The Windows installer takes care of `PlayerDebugMode`. If you installed the
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ sets `PlayerDebugMode=1` for CSXS 8..13, and offers to remove any legacy
|
||||||
```
|
```
|
||||||
cd services/premiere-plugin/build
|
cd services/premiere-plugin/build
|
||||||
npm install
|
npm install
|
||||||
pwsh -File build-all.ps1
|
powershell -File build-all.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
See [`build/README.md`](build/README.md).
|
See [`build/README.md`](build/README.md).
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ winget install --id JRSoftware.InnoSetup
|
||||||
```
|
```
|
||||||
cd services/premiere-plugin/build
|
cd services/premiere-plugin/build
|
||||||
npm install
|
npm install
|
||||||
pwsh -File build-all.ps1
|
powershell -File build-all.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
Artifacts land in `services/premiere-plugin/build/dist/`.
|
Artifacts land in `services/premiere-plugin/build/dist/`.
|
||||||
|
|
@ -39,7 +39,7 @@ To build just one:
|
||||||
|
|
||||||
```
|
```
|
||||||
node build-zxp.mjs # cross-platform .zxp
|
node build-zxp.mjs # cross-platform .zxp
|
||||||
pwsh -File build-installer.ps1 # Windows .exe (needs ISCC.exe)
|
powershell -File build-installer.ps1 # Windows .exe (needs ISCC.exe)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Signing cert (.zxp)
|
## Signing cert (.zxp)
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,30 @@ $manifestPath = Join-Path $PSScriptRoot '..\CSXS\manifest.xml'
|
||||||
if (-not (Test-Path $manifestPath)) {
|
if (-not (Test-Path $manifestPath)) {
|
||||||
throw "Manifest not found at $manifestPath"
|
throw "Manifest not found at $manifestPath"
|
||||||
}
|
}
|
||||||
$manifestXml = [xml](Get-Content -Raw -Path $manifestPath)
|
# Regex over XML because the manifest's <Resources> comment contains '--'
|
||||||
$version = $manifestXml.ExtensionManifest.ExtensionBundleVersion
|
# (the --enable-nodejs/--mixed-context CEF flags), which is illegal per the
|
||||||
if (-not $version) {
|
# XML spec — .NET's strict parser rejects the doc even though Adobe CEP
|
||||||
|
# tolerates it.
|
||||||
|
$manifestRaw = Get-Content -Raw -Path $manifestPath
|
||||||
|
if ($manifestRaw -notmatch '<ExtensionBundleVersion>([^<]+)</ExtensionBundleVersion>') {
|
||||||
throw 'Could not read <ExtensionBundleVersion> from manifest.xml'
|
throw 'Could not read <ExtensionBundleVersion> from manifest.xml'
|
||||||
}
|
}
|
||||||
|
$version = $Matches[1].Trim()
|
||||||
Write-Host "Dragonflight Premiere panel - Windows installer build v$version"
|
Write-Host "Dragonflight Premiere panel - Windows installer build v$version"
|
||||||
|
|
||||||
$iscc = Get-Command 'ISCC.exe' -ErrorAction SilentlyContinue
|
$iscc = Get-Command 'ISCC.exe' -ErrorAction SilentlyContinue
|
||||||
if (-not $iscc) {
|
if (-not $iscc) {
|
||||||
# Common install location if not on PATH.
|
# Common Inno Setup 6 install locations. winget user-scope drops it in
|
||||||
$fallback = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe"
|
# %LOCALAPPDATA%\Programs; machine-wide installs land in Program Files.
|
||||||
if (Test-Path $fallback) {
|
$fallbacks = @(
|
||||||
$iscc = Get-Command $fallback
|
"${env:LOCALAPPDATA}\Programs\Inno Setup 6\ISCC.exe",
|
||||||
} else {
|
"${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe",
|
||||||
|
"${env:ProgramFiles}\Inno Setup 6\ISCC.exe"
|
||||||
|
)
|
||||||
|
foreach ($p in $fallbacks) {
|
||||||
|
if (Test-Path $p) { $iscc = Get-Command $p; break }
|
||||||
|
}
|
||||||
|
if (-not $iscc) {
|
||||||
throw "ISCC.exe not found. Install Inno Setup 6: winget install JRSoftware.InnoSetup"
|
throw "ISCC.exe not found. Install Inno Setup 6: winget install JRSoftware.InnoSetup"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:zxp": "node build-zxp.mjs",
|
"build:zxp": "node build-zxp.mjs",
|
||||||
"build:exe": "pwsh -NoProfile -ExecutionPolicy Bypass -File build-installer.ps1",
|
"build:exe": "powershell -NoProfile -ExecutionPolicy Bypass -File build-installer.ps1",
|
||||||
"build": "pwsh -NoProfile -ExecutionPolicy Bypass -File build-all.ps1"
|
"build": "powershell -NoProfile -ExecutionPolicy Bypass -File build-all.ps1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"zxp-sign-cmd": "^2.0.0"
|
"zxp-sign-cmd": "^2.0.0"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue