machineInnoVersion static method

String? machineInnoVersion(
  1. File isccExe
)

Returns the Inno Setup version reported by isccExe, or null when it can't be determined. ISCC prints a Version x.y.z banner on startup.

A detection failure returns null and is treated as "version unknown", which does not block the install (only a positively-identified below-floor version is skipped).

Implementation

static String? machineInnoVersion(File isccExe) {
  try {
    final result = Process.runSync(isccExe.path, const []);
    final output = '${result.stdout}${result.stderr}';
    return RegExp(r'Version\s+(\d+\.\d+\.\d+)').firstMatch(output)?.group(1);
  } catch (_) {
    return null;
  }
}