ReviewOS

also looking at this

craft-native/craft

fix(ci): unblock the three failing native lifecycle legs

#37
Merged glennmichael123 wants to merge fix/native-lifecycle-and-release into main
4 files +130 -20
packages/typescript/src/package.tsmodified+15-1
Changes to packages/typescript/src/package.ts
@@ -964,6 +964,20 @@ export function windowsExecutableName(name: string): string {
964964 return `${name}.exe`
965965}
966966
967/**
968 * `candle.exe` arguments.
969 *
970 * `-arch` is not optional. WiX v3 deprecated `Package/@Platform` in favour of
971 * this switch, and candle defaults to `x86` without it — so an x64 payload was
972 * being compiled into a 32-bit installer whose one component declares
973 * `Win64="yes"` and installs under `ProgramFiles64Folder`. ICE80 exists to
974 * catch exactly that contradiction, and `light -sval` below turns validation
975 * off, so nothing ever reported it.
976 */
977export function candleArguments(architecture: 'x86' | 'x64' | 'arm64', wixobjPath: string, wxsPath: string): string[] {
978 return ['-nologo', '-arch', architecture, '-out', wixobjPath, wxsPath]
979}
980
967981function runCommand(command: string, args: string[], cwd?: string): Promise<void> {
968982 return new Promise((resolve, reject) => {
969983 const child = spawn(command, args, { cwd, stdio: 'inherit', windowsHide: true })
@@ -981,7 +995,7 @@ async function createMSI(opts: MSIOptions): Promise<{ success: boolean; outputPa
981995 const wixobjPath = join(tempDir, 'installer.wixobj')
982996 copyFileSync(opts.binaryPath, sourcePath)
983997 writeFileSync(wxsPath, renderWixSource(opts, binaryName))
984 await runCommand('candle.exe', ['-nologo', '-out', wixobjPath, wxsPath], tempDir)
998 await runCommand('candle.exe', candleArguments(opts.architecture, wixobjPath, wxsPath), tempDir)
985999 await runCommand('light.exe', ['-nologo', '-sval', '-out', opts.outputPath, wixobjPath], tempDir)
9861000 if (opts.certificatePath) {
9871001 const signArgs = ['sign', '/fd', 'sha256', '/tr', 'https://timestamp.digicert.com', '/td', 'sha256', '/f', opts.certificatePath]