Reputation: 23
I need to insert the last part of the installation dirrectory in the icon name.
To do that I'm trying to use ExtractFileName({app})
, and insert its result in the Name
parameter of my icon.
[Icons]
Name: '{group}\ApplicationName\' + ExtractFileName({app}) + '\filename.txt'
It compiles, but at runtime I get a 123 error, telling that
c:\Windows\system32\'c: could not be created.
I just need to insert the basename of the installation path as a new level in start menu.
Upvotes: 1
Views: 355
Reputation: 202534
You are looking for a scripted constant.
[Icons]
Name: "{group}\ApplicationName\{code:GetAppName}\filename.txt"
[Code]
function GetAppName(Param: string): string;
begin
Result := ExtractFileName(ExpandConstant('{app}'));
end;
Upvotes: 1