Skip to content

Commit 98dfd5c

Browse files
authored
Update Windows configuration to remove AppX ambiguity (#3239)
1 parent df20f1e commit 98dfd5c

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

.buildkite/commands/package_windows.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ If (Test-Path $certPath) {
2626
[System.Environment]::SetEnvironmentVariable('CSC_LINK', $certPath, [System.EnvironmentVariableTarget]::Machine)
2727
Write-Host "Environment variable CSC_LINK set to $certPath"
2828
} else {
29-
Write-Host "[!] certificate.pfx file does not exist."
29+
Write-Host "[!] Certificate file does not exist at given path $certPath."
3030
Exit 1
3131
}
3232

@@ -38,8 +38,8 @@ Import-PfxCertificate -FilePath $certPath -CertStoreLocation Cert:\LocalMachine\
3838
Write-Host "--- :windows: Installing make"
3939
choco install make
4040

41-
Write-Host "--- :npm: Installing dependencies"
42-
npm ci --legacy-peer-deps
41+
bash ".\.buildkite\commands\install_node_dependencies.sh"
42+
If ($LastExitCode -ne 0) { Exit $LastExitCode }
4343

4444
Write-Host "--- :lock_with_ink_pen: Decrypting secrets"
4545
make decrypt_conf

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ package: build-if-changed
141141

142142
.PHONY: package-win32
143143
package-win32:
144-
@echo Packaging .exe...
144+
@echo "Packaging exe..."
145145
@npx electron-builder --win -p $(PUBLISH)
146-
ifeq ($(IS_WINDOWS),true)
147-
@echo Packaging .appx as well...
146+
# Note: the configuration required to generate a code signed exe via the `nsis` target will conflict with the `appx` configuration.
147+
# In practice, "certificateSubjectName": "Automattic, Inc." is required to sign the exe, but if that setting is present and so are the `appx` settings, there will be a failure.
148+
# Hence the need for a separate configuration here.
149+
# See also in https://github.com/electron-userland/electron-builder/issues/6698
150+
@echo "Packaging appx — with dedicated configuration to work around code signing conflicts..."
148151
@npx electron-builder --win -p $(PUBLISH) --config=./electron-builder-appx.json
149-
else
150-
@echo Skipping packaging .appx because we are not running on a Windows machine.
151-
endif
152152

153153
.PHONY: package-osx
154154
package-osx: build-if-changed

electron-builder-appx.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"productName": "Simplenote",
33
"appId": "com.automattic.simplenote",
44
"directories": {
5-
"output": "release",
6-
"buildResources": "resources"
5+
"output": "./release",
6+
"buildResources": "./resources"
77
},
88
"files": ["desktop", "dist", "shared"],
99
"win": {
@@ -29,7 +29,5 @@
2929
"name": "simplenote",
3030
"schemes": ["simplenote"]
3131
}
32-
],
33-
"afterSign": "./after_sign_hook.js",
34-
"afterAllArtifactBuild": "./after_sign_hook.js"
32+
]
3533
}

electron-builder.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,9 @@
5454
{
5555
"target": "nsis",
5656
"arch": ["ia32", "x64"]
57-
},
58-
{
59-
"target": "appx",
60-
"arch": ["ia32", "x64"]
6157
}
6258
]
6359
},
64-
"appx": {
65-
"backgroundColor": "transparent",
66-
"showNameOnTiles": true
67-
},
6860
"nsis": {
6961
"artifactName": "Simplenote-win-${version}-${arch}.${ext}",
7062
"deleteAppDataOnUninstall": true,

0 commit comments

Comments
 (0)