Get application executable name and path of the runtime version

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Get application executable name and path of the runtime version

Post by mrcoollion » Wed Feb 08, 2023 12:12 pm

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

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Wed Feb 08, 2023 1:09 pm

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

mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

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

Post by mrcoollion » Wed Feb 08, 2023 2:15 pm

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

mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

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

Post by mrcoollion » Wed Feb 08, 2023 2:17 pm

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

mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

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

Post by mrcoollion » Wed Feb 08, 2023 2:19 pm

Instead om me i used

Code: Select all

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

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Wed Feb 08, 2023 4:37 pm

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.

mrcoollion
Posts: 709
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

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

Post by mrcoollion » Wed Feb 08, 2023 6:15 pm

Thanks again Klaus.
:D

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”