0

Is there a way to get the project name and target at execution time or is it not stored into executable?

Pipo
  • 4,653
  • 38
  • 47

2 Answers2

1

Project and target names are not stored in an executable.

Alexander Kogtenkov
  • 5,770
  • 1
  • 27
  • 35
0

As a workaround Setting the executable name into project settings -> target -> Output name and getting it from following function made me able to do something similar

application_file_name: STRING
    local
        l_path: PATH
    once
        Result := {EXECUTION_ENVIRONMENT}.arguments.argument (0).out
        create l_path.make_from_string (Result)
        check
            attached l_path.entry as l_fname_path
        then
            Result := l_fname_path.utf_8_name
        end
    ensure
        instance_free: Class
    end
Pipo
  • 4,653
  • 38
  • 47