Mac desktop question:
Hi there… I’m trying to implement the OpenAL framework in my software. Right now I have to get the user to install it before they can run it.
What I want to do is copy the folder OpenAL.framework in the framework folder
the directory to copy to is here
Mac OSX/Library/Frameworks/
How do I do this… I cannot seem to find a way of accessing this folder. So how would I do this?
Do I use a terminal command?
The OpenAl.Framework is in my resource folder
If the OpenAL.framework folder contains only files, use a Copy Files build step (Insert menu) to copy the files it contains into the OpenAL.framework subfolder of the framework folder.
If the OpenAL.framework folder contains a whole directory structure, you may want to use instead a bash script you call from a script using DoShelCommand. Or simply copy the folder manually into the bundle.
f=SpecialFolder.System.child("Library").Child("Frameworks").child("OpenAL.framework")
if f.exists<>true then
dim ff as FolderItem=app.ExecutableFile.Parent.Parent.Child("Resources").Child("OpenAL").Child("OpenAL.framework")
ff.CopyFileTo(f)
end if
it didn’t work… could I use a shell.execute command - what would be the syntax for that?
[code] f=SpecialFolder.System.child(“Library”).Child(“Frameworks”).child(“OpenAL.framework”)
if f.exists<>true then
dim ff as FolderItem=app.ExecutableFile.Parent.Parent.Child("Resources").Child("OpenAL").Child("OpenAL.framework")
f=SpecialFolder.System.child("Library").Child("Frameworks")
msgbox f.NativePath+" "+ff.NativePath
dim s as shell
s.Execute "cp -r "+ff.NativePath+" "+f.NativePath+"/"
end if[/code]
Under the Build Settings header in the sidebar, open the OS X item
From the Insert > Build Step menu, select Copy Files
Drop the framework bundle to the listbox that appears
Select the proper destination for it in the Inspector (Destination popup menu)
[quote=188168:@Sean Clancy]I also tried this to no avail:
[code] f=SpecialFolder.System.child(“Library”).Child(“Frameworks”).child(“OpenAL.framework”)
if f.exists<>true then
dim ff as FolderItem=app.ExecutableFile.Parent.Parent.Child("Resources").Child("OpenAL").Child("OpenAL.framework")
f=SpecialFolder.System.child("Library").Child("Frameworks")
msgbox f.NativePath+" "+ff.NativePath
dim s as shell
s.Execute "cp -r "+ff.NativePath+" "+f.NativePath+"/"
end if[/code][/quote]
You have not read my reply, right after your original post, two hours ago
[quote=188161:@Michel Bujardet]If the OpenAL.framework folder contains only files, use a Copy Files build step (Insert menu) to copy the files it contains into the OpenAL.framework subfolder of the framework folder.
If the OpenAL.framework folder contains a whole directory structure, you may want to use instead a bash script you call from a script using DoShelCommand. Or simply copy the folder manually into the bundle.[/quote]
Maybe it’s because of the second paragraph where you recommend to use a bash script if the framework contains folders… Just let the built-in tools do the work (your first paragraph) as they seem to work regardless of just files or whole directory structures…
I must ask what is your intention of including this within the Application Bundle? Are you intending to release this application on the Mac App Store, you’ll get rejected for including an Apple frameworks within your application bundle, trust me, I’ve tried.