digitalmars.D.learn - How to make Application bundle from Executable? (Mac)
- Gan (7/7) Feb 19 2015 I managed to copy an application bundle and change stuff inside
- Jeremy DeHaan (3/10) Feb 19 2015 I don't have an answer, but I too am interested in hearing what
- Nicholas Wilson (9/14) Feb 19 2015 I suggest to have a look at the projects generated by SFML
- Gan (7/21) Feb 19 2015 Frameworks aren't an issue, I put them into the Frameworks folder
- Israel (2/24) Feb 20 2015 It seems OSX is doing some weird stuff then...
- Nicholas Wilson (5/27) Feb 20 2015 are you loading using relative or absolute addresses (
- Gan (10/38) Feb 20 2015 I fixed it by using:
I managed to copy an application bundle and change stuff inside it to run my executable, but it was very manual and kinda hackish. Also I can't get my application to load images that I place in the Resources folder(or any folder in the bundle for that matter). Is there an official way to turn a D executable into a Mac Application Bundle?
Feb 19 2015
On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:I managed to copy an application bundle and change stuff inside it to run my executable, but it was very manual and kinda hackish. Also I can't get my application to load images that I place in the Resources folder(or any folder in the bundle for that matter). Is there an official way to turn a D executable into a Mac Application Bundle?I don't have an answer, but I too am interested in hearing what others have to say about this.
Feb 19 2015
On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:Also I can't get my application to load images that I place in the Resources folder(or any folder in the bundle for that matter).I suggest to have a look at the projects generated by SFML regarding locating the resources in C++/ObjC and translate them to C/ObjC/D. As for code (i.e frameworks and .dylibs) i don't know as shared libraries are still a murky area for D. Probably just better to stick to static libs.Is there an official way to turn a D executable into a Mac Application Bundle?Dunno Good luck!
Feb 19 2015
On Friday, 20 February 2015 at 06:10:51 UTC, Nicholas Wilson wrote:On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:Frameworks aren't an issue, I put them into the Frameworks folder in my hand made bundle and they load fine. When running the executable, it loads the image when it's in the same folder but when running the executable through the bundle, it doesn't find the image anywhere.Also I can't get my application to load images that I place in the Resources folder(or any folder in the bundle for that matter).I suggest to have a look at the projects generated by SFML regarding locating the resources in C++/ObjC and translate them to C/ObjC/D. As for code (i.e frameworks and .dylibs) i don't know as shared libraries are still a murky area for D. Probably just better to stick to static libs.Is there an official way to turn a D executable into a Mac Application Bundle?Dunno Good luck!
Feb 19 2015
On Friday, 20 February 2015 at 06:19:29 UTC, Gan wrote:On Friday, 20 February 2015 at 06:10:51 UTC, Nicholas Wilson wrote:It seems OSX is doing some weird stuff then...On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:Frameworks aren't an issue, I put them into the Frameworks folder in my hand made bundle and they load fine. When running the executable, it loads the image when it's in the same folder but when running the executable through the bundle, it doesn't find the image anywhere.Also I can't get my application to load images that I place in the Resources folder(or any folder in the bundle for that matter).I suggest to have a look at the projects generated by SFML regarding locating the resources in C++/ObjC and translate them to C/ObjC/D. As for code (i.e frameworks and .dylibs) i don't know as shared libraries are still a murky area for D. Probably just better to stick to static libs.Is there an official way to turn a D executable into a Mac Application Bundle?Dunno Good luck!
Feb 20 2015
On Friday, 20 February 2015 at 06:19:29 UTC, Gan wrote:On Friday, 20 February 2015 at 06:10:51 UTC, Nicholas Wilson wrote:are you loading using relative or absolute addresses ( ../../Resources/img.png or $BUNDLE_ROOT/Resources/img.png ) ? also check the cwd when launched from the executable vs, the bundle. Also does Console give any output?On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:Frameworks aren't an issue, I put them into the Frameworks folder in my hand made bundle and they load fine. When running the executable, it loads the image when it's in the same folder but when running the executable through the bundle, it doesn't find the image anywhere.Also I can't get my application to load images that I place in the Resources folder(or any folder in the bundle for that matter).I suggest to have a look at the projects generated by SFML regarding locating the resources in C++/ObjC and translate them to C/ObjC/D. As for code (i.e frameworks and .dylibs) i don't know as shared libraries are still a murky area for D. Probably just better to stick to static libs.Is there an official way to turn a D executable into a Mac Application Bundle?Dunno Good luck!
Feb 20 2015
On Friday, 20 February 2015 at 17:28:48 UTC, Nicholas Wilson wrote:On Friday, 20 February 2015 at 06:19:29 UTC, Gan wrote:I fixed it by using: string path = thisExePath(); int index = to!int(path.lastIndexOf("/")); if (!GameFont.loadFromFile(path[0 .. index]~"/vertiup2.ttf")) { writeln("Font failed to load"); } Now my hand made bundle works fine and loads resources from inside the bundle.On Friday, 20 February 2015 at 06:10:51 UTC, Nicholas Wilson wrote:are you loading using relative or absolute addresses ( ../../Resources/img.png or $BUNDLE_ROOT/Resources/img.png ) ? also check the cwd when launched from the executable vs, the bundle. Also does Console give any output?On Friday, 20 February 2015 at 03:26:47 UTC, Gan wrote:Frameworks aren't an issue, I put them into the Frameworks folder in my hand made bundle and they load fine. When running the executable, it loads the image when it's in the same folder but when running the executable through the bundle, it doesn't find the image anywhere.Also I can't get my application to load images that I place in the Resources folder(or any folder in the bundle for that matter).I suggest to have a look at the projects generated by SFML regarding locating the resources in C++/ObjC and translate them to C/ObjC/D. As for code (i.e frameworks and .dylibs) i don't know as shared libraries are still a murky area for D. Probably just better to stick to static libs.Is there an official way to turn a D executable into a Mac Application Bundle?Dunno Good luck!
Feb 20 2015