13 posts
Posted 16 August 2012 - 10:05 PM
I have a setup program and I want the program to copy itself to the computer.
How do I make a program find out what it's own name is.
3790 posts
Location
Lincoln, Nebraska
Posted 16 August 2012 - 10:09 PM
shell.getRunningProgram() Check it out here:
Shell API
13 posts
Posted 16 August 2012 - 10:12 PM
I thought it was from the FS api. I didn't bother looking at the shell API. Thanks.
3790 posts
Location
Lincoln, Nebraska
Posted 16 August 2012 - 10:13 PM
No problem, that's what we're here for! :(/>/>
350 posts
Posted 19 May 2014 - 08:19 PM
sorry for posting on a old thread, but what if i want a api to get the main program's dir? Is it possible without needing to type the dir manually in a api function?
570 posts
Posted 19 May 2014 - 08:28 PM
sorry for posting on a old thread, but what if i want a api to get the main program's dir? Is it possible without needing to type the dir manually in a api function?
Since an API doesn't have its own shell, you're going to have to pass a shell to the API. Then you can use shell.getRunningProgram().
350 posts
Posted 19 May 2014 - 08:46 PM
sorry for posting on a old thread, but what if i want a api to get the main program's dir? Is it possible without needing to type the dir manually in a api function?
Since an API doesn't have its own shell, you're going to have to pass a shell to the API. Then you can use shell.getRunningProgram().
how so?
1281 posts
Posted 19 May 2014 - 09:34 PM
It's because os.loadAPI runs the API in it's own environment, which has access to the global environment. The global environment however, does not actually contain the shell API.
Edited on 19 May 2014 - 07:34 PM
350 posts
Posted 19 May 2014 - 09:46 PM
It's because os.loadAPI runs the API in it's own environment, which has access to the global environment. The global environment however, does not actually contain the shell API.
Yea i got that, but how do i get a shell in the global environment?
Nevermind, i got it. I loaded the shell into the api using a function parameter.
Edited on 19 May 2014 - 07:55 PM