How to make Hollywood exe file loads work in Mac?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 1390
Joined: Sun Feb 14, 2010 7:11 pm

How to make Hollywood exe file loads work in Mac?

Post by Bugala »

I have macbook from 2015, I made MacOs x64 executebale and put it to a USB stick.

It seems like it might be working right away, as when I put the stick to Macbook, it shows Hollywood logo, and when I click it, it seems like it actually starts and works.

However, I get an error when trying to Open a file "Cannot read file X".

Thing is, I have also made exe to a Windows, and when I put that stick to a Windows, I don't have that problem.

I am using relative path, as in "pictures/pic1.img".

Because it does work in Windows with the same USB stick, I don't think problem is with the code, but it has something to do with the MacBook. Like maybe the current directory is not the directory where the program is started from, but maybe I need to move this relative folders somewhere elsewhere, but where?
User avatar
jPV
Posts: 734
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: How to make Hollywood exe file loads work in Mac?

Post by jPV »

I don't have a Mac at hand at the moment, but maybe it's because Mac apps are actually directories where the actual executable is buried under MyProgram_x64.app/Contents/MacOS/ or so... maybe the current dir for the app is there and not where you launch it?
Bugala
Posts: 1390
Joined: Sun Feb 14, 2010 7:11 pm

Re: How to make Hollywood exe file loads work in Mac?

Post by Bugala »

Seems your idea was right, thanks!

For those wondering about the same, when you compile Mac executable with Hollywood, you can see there comes a whole folder instead of just an exe.

If you want to open file "file.txt" as example, you need to place that file.txt under

hollywood.app/Contents/Resources

Similarly if you like to access something in a relative path, like Pictures/pic.img

then it needs to be placed in Hollywood.app/Contents/Resources/Pictures/pic.img

Notice that this hollywood.app is the name of your executable. As in, if you name it as Game, then you will have Game.app instead of hollywood.app.

As in using Game as the name, then you would place file.txt under Game.app/Contents/Resources.

@Andreas

I think it would be good to add something about this to the manual, unless there actually already is something about this somewhere, as Im not the first one to ask about this, and seems even if you don't have a Mac, it most times isn't that hard to make Hollywood exe for it now that I know I am supposed to put all the files in that Resources folder.
Post Reply