Page 1 of 1
What was that thing about saving standalones?
Posted: Mon Feb 23, 2015 4:47 pm
by dunbarx
My memory...
Simple splash stack arrangements no longer work in Mavericks and above? Do I recall a discussion about this not long ago? I really liked that method. Is it gone? I just tried to make such a gadget, and a separate stack file attached to the executable will not save its data, like it did in the old days. Is there a new trick for splash, or does everything have to migrate to external text files? Please say it ain't so.
Craig
Re: What was that thing about saving standalones?
Posted: Mon Feb 23, 2015 5:00 pm
by Klaus
Hi Craig,
do you have your separate stack(s) in -> specialfolderpath("engine")?
That folder is taboo (for writing) and has always been!
Copy your stack(s) to -> specialfolderpath("documents") or the users prefs-folder
when the app starts the very first time.
Best
Klaus
Re: What was that thing about saving standalones?
Posted: Mon Feb 23, 2015 5:31 pm
by FourthWorld
dunbarx wrote:Simple splash stack arrangements no longer work in Mavericks and above? Do I recall a discussion about this not long ago? I really liked that method. Is it gone? I just tried to make such a gadget, and a separate stack file attached to the executable will not save its data, like it did in the old days. Is there a new trick for splash, or does everything have to migrate to external text files? Please say it ain't so.
Apple now requires control of the format of files in the Preferences folder, but AFAIK they still allow developers to use their own binary formats for everything else.
The ability to write to the Applications folder has AFAIK always been limited by user permissions in OS X, as with any Unix system. So for the sake of the majority of our users whom we hope are running with non-admin accounts for security reasons, anything writable should be in an explicitly user-writable space, such as the Documents folder as Klaus suggested, or Application Support.
There are many ways to put stack files there, including writing your own installer in LC like RunRev does, but perhaps the simplest is to have a stack in your app's stack file that you clone and set the file name to a user-writable space, and then use the save command to save it there.
Re: What was that thing about saving standalones?
Posted: Mon Feb 23, 2015 6:56 pm
by dunbarx
Thank you, gentlemen. That worked just fine. I even understand it, and it is not too onerous.
Hate to be a bother, but I despise Windows, and wonder if you might suggest a folder similar to the "documents" folder that would be suitable. I must write a standalone for that (sound of hawking and spitting...) platform.
Craig
Re: What was that thing about saving standalones?
Posted: Mon Feb 23, 2015 6:59 pm
by Klaus
Hi Craig,
...a folder similar to the "documents" folder...
On Windows? Try -> specialfolderpath("documents")
Best
Klaus
Re: What was that thing about saving standalones?
Posted: Mon Feb 23, 2015 7:27 pm
by dunbarx
Klaus.
(Wipes mouth from earlier, badly aimed expectoration...)
Makes sense. I actually need to make both platforms work in the same office, so I will test the platform and reference the working stack accordingly.
Thanks.
Craig
Re: What was that thing about saving standalones?
Posted: Mon Feb 23, 2015 8:37 pm
by FourthWorld
dunbarx wrote:Hate to be a bother, but I despise Windows, and wonder if you might suggest a folder similar to the "documents" folder that would be suitable. I must write a standalone for that (sound of hawking and spitting...) platform.
Klaus' suggestion of specialFolderPath("documents") is a good one since Mac, Windows, and Linux all support a Documents folder in the user's Home folder.
That said, Documents is ideally where we'd store true documents, things the user has explicitly chosen to save there.
For non-document files used by an application, the HIGs for each OS suggest a different folder:
OS X: /Users/<userName>/Library/Application Support/
Windows: <driveLetter>:/Users/<userName>/AppData/Local/
Linux: /home/<userName>/.<yourappname>/
LiveCode can use OS constants where available for many special folders. For example, this will get the Application Data folder on Windows:
specialFolderPath(26)
Unfortunately, using specialFolderPath("asup") on OS X will return the system App Support folder, not the one in user-space guaranteed to be user-writable.
Anyone here know the constant for Application Support in user space?
I've been concatenating it from parts of $HOME and "asup", but I'd like to think Apple has an easier way we can use within LC.
Re: What was that thing about saving standalones?
Posted: Wed May 13, 2015 9:42 pm
by atout66
OK, so if I code something like below:
Code: Select all
put specialFolderPath(Documents) into lePath
do you know if I can be sure that "Documents" folder exists on all plateforme (Mac,Win,Linux, IOS,And) ?
Because in the dictionnary I have (6.5 version) it seems to be more complicated to store config files...
Thanks in advance, Jean-Paul.
Re: What was that thing about saving standalones?
Posted: Wed May 13, 2015 10:07 pm
by dunbarx
Hi.
You can always:
Code: Select all
if there is a folder "documentsFolderPath" then..
Craig
Re: What was that thing about saving standalones?
Posted: Thu May 14, 2015 11:45 am
by atout66
OK, thanks Craig
