1

I'm trying to add a parameter to my setup file, with a default value. In this case I get a compile error at

OutputBaseFilename=MyApp {param:Version|{#MyAppVersion}} Setup

Saying:

Value of [Setup] section directive "OutputBaseFilename" is invalid

Shortened reference code:

#define MyAppName "My App"
#define MyAppVersion "1.7.24"

[Setup]
AppName={#MyAppName}
AppVersion="{param:Version|{#MyAppVersion}}"
DefaultGroupName=VHStudio
OutputBaseFilename=MyApp {param:Version|{#MyAppVersion}} Setup
SetupIconFile={#PathToRepoRoot}\Development\VHS\VHSStudio\media\logo.ico

[Icons]
Name: "{group}\VHStudio {param:version|MyAppVersion}"; Filename: "{app}\VHStudioApp.EXE"; WorkingDir: "{app}"
Name: "{group}\Uninstall VHStudio"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\VHStudioApp.EXE"; Tasks: desktopicon

I'm guessing I'm using the constant wrong? The Strange thing is that I do

AppVersion="{param:Version|{#MyAppVersion}}"

Without any errors...

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Royi Levy
  • 513
  • 1
  • 3
  • 14
  • I want to build the installer via the cmd and I want to pass the version to it through the parameters. The ```OutputBaseFilename ``` should change accordingly (ex. "MyApp 1.7.17 Installer") – Royi Levy Nov 06 '20 at 19:04

1 Answers1

1

Based on the comment from Martin. Suggesting to take a look at Passing in version number to Inno Setup compiler.

Turns out I overcomplicated things. You can easily pass parameters to the compiler for pre-processor variables. In my situation MyAppVersion.

What I did in Inno Setup:

#ifndef MyAppVersion
  #define MyAppVersion "1.7.24"
#endif

And when compiling it looks like this: ISCC.exe myProg.iss /DMyAppVersion=1.7.14

Royi Levy
  • 513
  • 1
  • 3
  • 14