Page 1 of 1

Get application executable name and path of the runtime version

Posted: Wed Feb 08, 2023 12:12 pm
by mrcoollion
Hi LC specialist,

I need to get the application executable name and path of the runtime version of my application with code in that same application.
I need this for a button with which the user can place the application into de Auto Start Menu of windows.

Cannot seem to find information about this.

Anybody some clever ideas

Regards,

Paul

Re: Get application executable name and path of the runtime version

Posted: Wed Feb 08, 2023 1:09 pm
by Klaus
Hi Paul,

on Windows do this in the mainstack, the one that you create the runtime from:

Code: Select all

...
put the filename of me into the_long_path_to_this_application
...
Will return the name of the EXE and its full pathname.

Best

Klaus

Re: Get application executable name and path of the runtime version

Posted: Wed Feb 08, 2023 2:15 pm
by mrcoollion
Thanks Klaus,

I used:

Code: Select all

put the effective filename of this stack into tApplicationAndPath
Could this have worked also in the standalone?

Regards,

Paul

Re: Get application executable name and path of the runtime version

Posted: Wed Feb 08, 2023 2:17 pm
by mrcoollion
Hi Klaus,

Your suggestion throws me the following error : 'card "Main Card": execution error at line n/a (Object: object does not have this property)'

Am i missing something here?

Regards,

Paul

Re: Get application executable name and path of the runtime version

Posted: Wed Feb 08, 2023 2:19 pm
by mrcoollion
Instead om me i used

Code: Select all

 of this stack
. In effect we then have the same command :-)

Re: Get application executable name and path of the runtime version

Posted: Wed Feb 08, 2023 4:37 pm
by Klaus
mrcoollion wrote:
Wed Feb 08, 2023 2:17 pm
Your suggestion throws me the following error : 'card "Main Card": execution error at line n/a (Object: object does not have this property)'
Yes, in a cardscript ME = the CARD, so "... of this stack" will do.

Re: Get application executable name and path of the runtime version

Posted: Wed Feb 08, 2023 6:15 pm
by mrcoollion
Thanks again Klaus.
:D