Page 1 of 1

Making a Standalone's Material Savable.

Posted: Thu Nov 15, 2012 11:54 pm
by trailboss
I'm not a beginner at all but this is so basic that I thought I'd ask here. I've completely forgotten how to make my changes in a standalone SAVABLE.

I'm making a little flash card program for language students. They will put in their words and save them.

The standalone settings have to allow this.

What did I use to do?

Thank you very kindly, for refreshing my memory.

Tom in Arizona

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 12:35 am
by trailboss
I'm posting a reply to my own question. I just looked; it's not in the standalone settings.

I put this is the stack script:

on closestack
answer "Save Changes?" with "Yes" or "No"
if it is "yes" then save stack "datastack"
end closestack

Never mind!

Thanks anyway,

Tom

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 1:04 am
by Mark
Hi Tom,

You can't save changes in a standalone. You need to save your data in a file outside your standalone. This file can also be a stack. Good places to save such files are the preferences folder or application data folder, the documents folder, and sometimes the home folder or application support folder. These folders are not always available on every operating system.

Kind regards,

Mark

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 3:44 am
by trailboss
You're right. I've discovered that it doesn't work after all. I thought it did.

I'm not sure what to do. I have a stack where you do your work and a data stack that has the data. How can I make that data stack a file that can be saved? The idea is for people to write in material to be studied later and added to.

Thanks for helping me.

Tom

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 4:05 am
by sturgis
A couple ways. You can set the mainstack of your data stack to point to itself and save it as a separate stack file, then load it from your standalone stack. (you can add files to the build in the standalone settings, forget the exact name of the tab but it's pretty obvious. Select the stack you want to add to the build and it will be included and placed in the .app package on mac, or next to the exe on win/linux, or in the apk for android. I assume for ios is the same (inside the package) but haven't built for ios so not sure.

If you're building for a mobile device you'll need to copy the stack file from the engine folder into the documents folder so that it is writable.


You can also change a setting in the standalone settings that will "save substacks as separate stack files.." but I forget where that checkbox is.

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 5:25 am
by dunbarx
This is an issue because no OS will allow an executable to save to itself.

I use the "splash screen" approach, whereby a mostly functionless mainstack is used as the executable, and any number of other stacks are added to it as ancillary files. The splash screen is sort of the front end, and the working stack(s) can then be used in the ordinary way, and you can save as needed. These ancillary stacks are added in the standalone settings. You can also add other files, (e.g ".bundle") as required.

Craig Newman

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 4:47 pm
by trailboss
Yes, now I see how I used to do this. I used a splash screen and a datastack. Thanks. It's working now!

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 5:07 pm
by Klaus
Hi friends,

please keep in mind that this will only work, if the current user has admin rights!
Other users do NOT have permissions to write (= save a stack) in the current OS
"Application" or "Programms" folder!


Best

Klaus

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 6:57 pm
by sturgis
yeah, better to treat desktop as if they were mobile also and make a copy in appdata or documents folder and use it from there.
Klaus wrote:Hi friends,

please keep in mind that this will only work, if the current user has admin rights!
Other users do NOT have permissions to write (= save a stack) in the current OS
"Application" or "Programms" folder!


Best

Klaus

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 8:30 pm
by trailboss
I don't understand. It seems to work for me on both mac and windows platform standalones. How will I come to grief?
Tom

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 9:05 pm
by sturgis
If the standalone package (or on windows/linux, the standalone and any other files and folders) are placed into the applications folder, program files folder, or one of the binary paths on linux, a regular user may not be able to write to those directories without elevating privilege. Of course on desktop, if the files are in user space then its not really an issue.

Re: Making a Standalone's Material Savable.

Posted: Fri Nov 16, 2012 11:10 pm
by trailboss
Well, this is for friends, so I can tell them that. Thanks