Where to put app and how to reference it?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 223
- Joined: Wed Jun 21, 2006 7:33 pm
- Contact:
Where to put app and how to reference it?
Firstly: This is on a Mac running 10.8 and using LiveCode 4.6.4
I have a fairly simple app that is just acting as the GUI to some open source Unix Executable that is normally run in the Terminal. My app asks the user to specify a source file, the app concatenates the file path with the proper syntax for the executable and then I use "put shell(myConcatenation)". It works.
However, I'd like to include the open source app -inside- my app so I don't have to worry about the user having to download and install the executable in the "proper" location (where my app expects to find it).
So the two questions are:
1. How to I put the executable inside my app? (I know how to "show package contents" but I think there's a way to do this from within the stack inspector.)
2. What path do I use to call the code when I don't know exactly where the user will install my app?
Thanks in advance for any assistance.
Barry
I have a fairly simple app that is just acting as the GUI to some open source Unix Executable that is normally run in the Terminal. My app asks the user to specify a source file, the app concatenates the file path with the proper syntax for the executable and then I use "put shell(myConcatenation)". It works.
However, I'd like to include the open source app -inside- my app so I don't have to worry about the user having to download and install the executable in the "proper" location (where my app expects to find it).
So the two questions are:
1. How to I put the executable inside my app? (I know how to "show package contents" but I think there's a way to do this from within the stack inspector.)
2. What path do I use to call the code when I don't know exactly where the user will install my app?
Thanks in advance for any assistance.
Barry
-
- Posts: 223
- Joined: Wed Jun 21, 2006 7:33 pm
- Contact:
Re: Where to put app and how to reference it?
One thing I forgot to mention: My app is free so whatever open source code I am using I am not charging for.
Re: Where to put app and how to reference it?
Look in the standalone application settings, copy files pane.
You can select files and folders you wish to be bundled up in the app package.
When your app starts up, these files and folders should be in the root of the defaultfolder. You can store this path somewhere on startup if you have need to change where the defaultfolder is pointing, so that you always have a quick easy way to point to the executable you need to shell.
You can select files and folders you wish to be bundled up in the app package.
When your app starts up, these files and folders should be in the root of the defaultfolder. You can store this path somewhere on startup if you have need to change where the defaultfolder is pointing, so that you always have a quick easy way to point to the executable you need to shell.
-
- Posts: 223
- Joined: Wed Jun 21, 2006 7:33 pm
- Contact:
Re: Where to put app and how to reference it?
So if I'm allowed to copy the executable into the app package, how do I test my app prior to making the standalone? Won't the paths be different?
Re: Where to put app and how to reference it?
You can manually set the defaultfolder to point to where the executable is from the message box. In fact, you can add something like this..
if the environment is "development" then
get shell("/where/it/is/on/system")
else
get shell("where/it/is/in/standalone/package
end if
Then you can just use tPath in your shell.
if the environment is "development" then
get shell("/where/it/is/on/system")
else
get shell("where/it/is/in/standalone/package
end if
Then you can just use tPath in your shell.
-
- Posts: 223
- Joined: Wed Jun 21, 2006 7:33 pm
- Contact:
Re: Where to put app and how to reference it?
So where, exactly is ("where/it/is/in/standalone/package") in terms of a path the executable expects?if the environment is "development" then
get shell("/where/it/is/on/system")
else
get shell("where/it/is/in/standalone/package")
end if
Thanks
Re: Where to put app and how to reference it?
To get the location do this
tPath now points to the location in the app package that actually contains the executable. And the file you added with the "copy files" pane, should be right next to it.
If you added a folder using the copy files pane the folder should be there too.
So, you can then:
Code: Select all
put the effectivefilename of this stack into tPath
set the itemdelimiter to slash
delete the last item of tPath
If you added a folder using the copy files pane the folder should be there too.
So, you can then:
Code: Select all
set the defaultfolder to tPath
answer the files -- will open an answer box listing the files in the default location
-
- Posts: 223
- Joined: Wed Jun 21, 2006 7:33 pm
- Contact:
Re: Where to put app and how to reference it?
A-ha! Now I understand. Just what I needed. Thanks very much for your patience.
Barry
Barry
