Inno Setup Use a part of an application path for an icon path

Jerome

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.

Martin Prikryl

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;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Inno Setup User Home Path

From Dev

Inno Setup: Verify that {app} path contains no spaces

From Dev

Inno Setup (How to get dynamically path to file)?

From Dev

Inno Setup - Get a path to parent folder

From Java

Check installation path for spaces and special symbol in Inno Setup

From Dev

Inno-Setup: SetupIconFile: The system cannot find the path specified

From Dev

Inno Setup Compiler "Cannot find the path specified" error with long paths

From Dev

Install external file from subdirectory (relative path) using Inno Setup

From Dev

Install external file from subdirectory (relative path) using Inno Setup

From Dev

How to change launcher icon path of an installed application

From Dev

Use a part of a registry key/value in the Inno Setup script

From Dev

Inno Setup task bar icon

From Dev

Inno Setup: Hide icon in titlebar?

From Dev

Inno Setup - Remove path from PATH environment variable while uninstalling a program

From Dev

Can I use xargs as part of a directory path?

From Dev

How do you find the user-selected install path in Inno Setup?

From Dev

Inno Setup error when installing to USB drive root: "You must enter a full path with drive letter"

From Dev

Inno Setup always creates desktop icon

From Dev

Inno Setup: Control panel icon does not show

From Dev

Inno Setup always creates desktop icon

From Dev

Icon path for JFrame

From Dev

Icon path in .desktop file

From Dev

Adaptive Icon shapes path

From Dev

Icon path in .desktop file

From Dev

Error "Could not find a part of the path" while publishing .NET Core Application

From Dev

Use Define and Constant in Inno Setup

From Dev

VBA, TRIM part of a Path

From Dev

Android fill in part of a path?

From Dev

replace part of path - python

Related Related

  1. 1

    Inno Setup User Home Path

  2. 2

    Inno Setup: Verify that {app} path contains no spaces

  3. 3

    Inno Setup (How to get dynamically path to file)?

  4. 4

    Inno Setup - Get a path to parent folder

  5. 5

    Check installation path for spaces and special symbol in Inno Setup

  6. 6

    Inno-Setup: SetupIconFile: The system cannot find the path specified

  7. 7

    Inno Setup Compiler "Cannot find the path specified" error with long paths

  8. 8

    Install external file from subdirectory (relative path) using Inno Setup

  9. 9

    Install external file from subdirectory (relative path) using Inno Setup

  10. 10

    How to change launcher icon path of an installed application

  11. 11

    Use a part of a registry key/value in the Inno Setup script

  12. 12

    Inno Setup task bar icon

  13. 13

    Inno Setup: Hide icon in titlebar?

  14. 14

    Inno Setup - Remove path from PATH environment variable while uninstalling a program

  15. 15

    Can I use xargs as part of a directory path?

  16. 16

    How do you find the user-selected install path in Inno Setup?

  17. 17

    Inno Setup error when installing to USB drive root: "You must enter a full path with drive letter"

  18. 18

    Inno Setup always creates desktop icon

  19. 19

    Inno Setup: Control panel icon does not show

  20. 20

    Inno Setup always creates desktop icon

  21. 21

    Icon path for JFrame

  22. 22

    Icon path in .desktop file

  23. 23

    Adaptive Icon shapes path

  24. 24

    Icon path in .desktop file

  25. 25

    Error "Could not find a part of the path" while publishing .NET Core Application

  26. 26

    Use Define and Constant in Inno Setup

  27. 27

    VBA, TRIM part of a Path

  28. 28

    Android fill in part of a path?

  29. 29

    replace part of path - python

HotTag

Archive