AW: AW: How to keep dir structure when building standalone?

Tiemo Hollmann TB toolbook at kestner.de
Wed Jul 2 14:33:42 EDT 2008


Hi Devin,
thank you for your explanation, I think I got the setting of the path
correct. (I also tried your function, which is similar to mine) My problem
is building the standalone bundle for the Mac on a Win PC.
In the development environment my file.db is in "the
defaultfolder/resources" (in your example). In the standalone settings I
pointed to the file.db to be taken in the standalone. 
1. Now, when building the standalone, the builder puts my DBfile in the
MacOS folder (what is the defaultfolder) and not in a subfolder
"/resources". Why?
2. the DBfile, which the standalonebuilder has put in the MacOS folder has 0
kbWhy ?
3. When creating the /resources/file.db (with a correct file.db) in the
standalone MacOS folder after having build the standalone and testing it on
a Mac, he doesn't find my file.db though my resource path is correct
(tested)
4. Only when creating on the Mac a /resources/file.db folder and file
"outside" of the Mac prog.app in the same folder as the prog.app, my prog
finds the file.db.
Is my problem located in the building of the standalone, where you can't
push manually folder and files into, after having created?
But why does the standalone finds my file in a folder outside of the
prog.app in the same root as prog.app: "/resources/file.db" ?
The answer must be so easy, but I don't see it
Thank you
Tiemo

> I might not be understanding your problem exactly, but this
> explanation of how Rev in Mac OS X handles the defaultFolder
> situation might be helpful.
> 
> Condition 1: You never explicitly set the defaultFolder in your stack.
> In the development environment the defaultFolder points to the folder
> containing the Revolution executable, usually something like /
> Applications/Revolution Enterprise/2.9.0-gm-1.
> In the standalone environment the defaultFolder is the folder
> containing your application bundle--the .app file. Therefore in this
> case all relative paths will be relative to this folder. So if you
> distribute your standalone in its own folder, myAppStuff, the
> defaultFolder would be something like /Applications/myAppStuff.
> 
> Condition 2: You explicitly set the defaultFolder in your stack to
> the folder containing your stack.
> In the development environment the defaultFolder points to the folder
> containing your stack.
> In the standalone environment the defaultFolder points to the MacOS
> folder inside the myApp.app bundle. That would be something like /
> Applications/myApp.app/Contents/MacOS. Therefore all relative paths
> will be relative to this folder.
> 
> To deal with the difference between the IDE and standalone in Mac OS
> X, I often include the scripting similar to this in my mainstack's
> stack script:
> 
> on preOpenStack
>    # set the root folder for all resources
>    if the environment is "development" then
>      set the defaultFolder to enclosingFolder(the name of me)
>    end if
> 
>    ## Do this for local data and media files.
>    set the baseDir of me to the defaultFolder & "/" & "resources"
> end preOpenStack
> 
> function enclosingFolder pStName
>    get the filename of pStName
>    set the itemDelimiter to "/"
>    return item 1 to -2 of it
> end enclosingFolder
> 
> Hope this helps.
> 
> Devin
> 
> Devin Asay
> Humanities Technology and Research Support Center
> Brigham Young University
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list