fix: fix Inno Setup preprocessor defines via environment variables

ISCC's /D command-line flag combined with Node.js spawn on Windows
produces broken ISPP defines due to argument quoting conflicts.
Switch to environment variables read via GetEnv() — robust and
avoids all quoting issues. Product name and publisher are now
hardcoded in the ISS (they never change).

Verified: installer shows 'Aryx' and correct version in metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-26 16:14:14 +01:00
co-authored by Copilot
parent 7c1852f79f
commit 69562c19f3
2 changed files with 28 additions and 33 deletions
+21 -20
View File
@@ -1,26 +1,27 @@
; Inno Setup script for Aryx
; Metadata values are passed via /D preprocessor defines from the build script.
; Dynamic values are read from environment variables set by the build script.
#ifndef PRODUCT_NAME
#define PRODUCT_NAME "Aryx"
#endif
#ifndef PRODUCT_VERSION
#define PRODUCT_VERSION "0.0.0"
#endif
#ifndef PRODUCT_PUBLISHER
#define PRODUCT_PUBLISHER "David Kaya"
#endif
#ifndef SOURCE_DIR
#error "SOURCE_DIR must be defined (path to the packaged app directory)."
#endif
#ifndef OUTPUT_DIR
#error "OUTPUT_DIR must be defined (path to the output directory)."
#endif
#ifndef OUTPUT_FILENAME
#error "OUTPUT_FILENAME must be defined (output installer filename without extension)."
#endif
#define PRODUCT_NAME "Aryx"
#define PRODUCT_PUBLISHER "David Kaya"
#define PRODUCT_VERSION GetEnv("ARYX_BUILD_VERSION")
#define SOURCE_DIR GetEnv("ARYX_BUILD_SOURCE_DIR")
#define OUTPUT_DIR GetEnv("ARYX_BUILD_OUTPUT_DIR")
#define OUTPUT_FILENAME GetEnv("ARYX_BUILD_OUTPUT_FILENAME")
#define ICON_PATH GetEnv("ARYX_BUILD_ICON_PATH")
#ifndef ICON_PATH
#if PRODUCT_VERSION == ""
#error "ARYX_BUILD_VERSION environment variable must be set."
#endif
#if SOURCE_DIR == ""
#error "ARYX_BUILD_SOURCE_DIR environment variable must be set."
#endif
#if OUTPUT_DIR == ""
#error "ARYX_BUILD_OUTPUT_DIR environment variable must be set."
#endif
#if OUTPUT_FILENAME == ""
#error "ARYX_BUILD_OUTPUT_FILENAME environment variable must be set."
#endif
#if ICON_PATH == ""
#define ICON_PATH SOURCE_DIR + "\" + PRODUCT_NAME + ".exe"
#endif
+7 -13
View File
@@ -86,19 +86,13 @@ async function createWindowsInstaller(version: string): Promise<void> {
const outputFilename = releaseTarget.installerAssetName.replace(/\.exe$/, '');
const iconPath = join(repositoryRoot, 'assets', 'icons', 'windows', 'icon.ico');
await runCommand(
isccPath,
[
`/DPRODUCT_NAME=${productName}`,
`/DPRODUCT_VERSION=${version}`,
`/DSOURCE_DIR=${packagedAppDirectory}`,
`/DOUTPUT_DIR=${releaseRootDirectory}`,
`/DOUTPUT_FILENAME=${outputFilename}`,
`/DICON_PATH=${iconPath}`,
issScript,
],
repositoryRoot,
);
process.env.ARYX_BUILD_VERSION = version;
process.env.ARYX_BUILD_SOURCE_DIR = packagedAppDirectory;
process.env.ARYX_BUILD_OUTPUT_DIR = releaseRootDirectory;
process.env.ARYX_BUILD_OUTPUT_FILENAME = outputFilename;
process.env.ARYX_BUILD_ICON_PATH = iconPath;
await runCommand(isccPath, [issScript], repositoryRoot);
}
// --- macOS: DMG disk image ---