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: 744
Joined: Thu Sep 11, 2014 1:49 pm

Get application executable name and path of the runtime version

Post 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
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post 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
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

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

Post 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
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

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

Post 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
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

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

Post by mrcoollion »

Instead om me i used

Code: Select all

 of this stack
. In effect we then have the same command :-)
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus »

mrcoollion wrote: Wed Feb 08, 2023 2:17 pmYour 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: 744
Joined: Thu Sep 11, 2014 1:49 pm

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

Post by mrcoollion »

Thanks again Klaus.
:D
Post Reply