5

I want to use the [Files] section to create a new file which has the format:

Program Name plus date plus time .fmpur

I'd be grateful for any ideas.

TLama
  • 73,451
  • 17
  • 201
  • 368
John Carpmael
  • 139
  • 3
  • 8

2 Answers2

6

For instance the following way. How to modify a date time pattern, see the GetDateTimeString page:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

#define FileNamePattern SetupSetting("AppName") + " " + GetDateTimeString('dd-mm-yyyy hh-nn-ss', '-', ':') + ".fmpur";

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; DestName: "{#FileNamePattern}"
TLama
  • 73,451
  • 17
  • 201
  • 368
0

An alternative to TLama's example using a function to get the filename.

[code]
function GetFileName(Dummy: String): String;
begin
    Result := SetupSetting("AppName") + " " + GetDateTimeString('dd-mm-yyyy hh-nn-ss', '-', ':') + ".fmpur";
end;

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; DestName: "{code:GetFileName}"
T.S
  • 346
  • 3
  • 18