Ladislav
Ladislav

Reputation: 418

Add installation type, maintain the predefined ones

I'd like to add an own installation type into an Inno setup project, while keeping the original ones (Full, Compact and Custom). The problem is, when I create the [Types] section, these installation types are lost and I have to redefine them.

If this is not possible, okay then, let's redefine them. But I'd like to use the original language constants from the .isl files. I haven't found any option, how to use [Message]-like declarations as constants in [CustomMessage] way (e. g. {cm:LaunchProgram}) in the Types' Description parameter. Is there any option, how to do this?

Upvotes: 1

Views: 985

Answers (1)

Robert Love
Robert Love

Reputation: 12581

Here is how you can do it, using [CustomMessages]

[CustomMessages]
FullInstall=Full installation
CompactInstall=Compact installation
CustomInstall=Custom installation

[Types]
Name: "full"; Description: "{cm:FullInstall}"
Name: "compact"; Description: "{cm:CompactInstall}"
Name: "custom"; Description: "{cm:CustomInstall}"; Flags: iscustom

Here is how you can do it using [Messages] values.

[Types]
Name: "full"; Description: "{code:FullInstall}"
Name: "compact"; Description: "{code:CompactInstall}"
Name: "custom"; Description: "{code:CustomInstall}"; Flags: iscustom

[Code]

function FullInstall(Param : String) : String;
begin
  result := SetupMessage(msgFullInstallation);
end;

function CustomInstall(Param : String) : String;
begin
  result := SetupMessage(msgCustomInstallation);
end;

function CompactInstall(Param : String) : String;
begin
  result := SetupMessage(msgCompactInstallation);
end;

Upvotes: 1

Related Questions