3

How to append AppVersion to setup.exe file?

In other words, how to make output filename as sample-setup-1.4.2.0.exe?

[Setup]
AppName= {#GetStringFileInfo("Sample.exe", "ProductName")}
AppVersion= {#GetStringFileInfo("Sample.exe", "FileVersion")}

OutputBaseFilename=setup
Youngjae
  • 24,352
  • 18
  • 113
  • 198

1 Answers1

4

Two valuable lessons are;

  1. Lesson 1: Inline function should be used as {#FunctionName(...)}
  2. Lesson 2: variables in [Setup] field are called by using SetupSetting function.

With above information, we can make sample-setup-1.0.0.0 as below;

OutputBaseFilename=sample-setup-{#SetupSetting("AppVersion")}

Likewise, we can append datetime;

OutputBaseFilename=sample-setup-{#SetupSetting("AppVersion") + GetDateTimeString('dd-mm-yyyy hh-nn-ss', '-', ':')}
Youngjae
  • 24,352
  • 18
  • 113
  • 198