Blitzmax on Mac troubles
BlitzMax Forums/BlitzMax Programming/Blitzmax on Mac troubles
| ||
Hey, having some weird troubles with a game I am trying to convert for Mac using Blitzmax. It's possible this is more an issue with me never having used a Mac before, but I managed to convert a Unity game without this problem occurring, I've had no luck searching for a solution. I made a game on PC a while ago using Blitzmax, and recently got hold of a mini-mac, so I went through the process of making the game run on a Mac and testing it. Had to make a few changes to some code, but I got it working. Compiled it, it ran fine, great. But when I uploaded it, then downloaded again, the downloaded version wouldn't work. I get the initial "[game] is an application downloaded from the internet. Are you sure you want to open it?" as expected, and I say yes, but then it just has the "[game] quit unexpectedly" message every time I try to run it. Doesn't seem to launch at all, just quits before it starts. It should be the exact same files, I have a folder with the app and data files, it runs fine, I zip it up and upload it, download it, doesn't run. I have done basically the same thing with a Unity game, and it was no problem downloading and running it. The PC version of the game is fine when I download it. It is only the Mac version, but only after downloaded. Does anyone have any idea because I am stumped and whenever I google it I just get the same answers regarding the "this app was downloaded from the internet" which isn't the issue, I am getting past that error message. I would assume it's some kind of security thing as it is only happening when I download it, but getting past that first message should solve that issue. I got that same message with the Unity game, but approving the app made it work as expected. While typing I tried downloading the Mac version onto my PC, then transferring it to the Mac via USB. That worked and it ran fine on the Mac! So... I am not sure what is going on. That makes me think this is some download security setting on the Mac, but I go through the procedure of allowing the program to run, so that shouldn't be an issue. Does anyone know what I am doing wrong? :S The game is located here if anyone on Mac can let me know if it works for them : www.black-moth.net/games/ANamelessInheritanceMac.zip |
| ||
I don't have a real answer but this does sound familiar. Many years ago when Mark Sibly was regularly uploading new Mac versions of BlitzMax they failed for some reason. I think it had something to with files being zipped on the Mac. I don't remember exactly what he did but I believe he gave up on that method and created the archive by some other means. |
| ||
BlitzMax by itself is not suitable for publishing apps for public MacOS consumption. You will need to sign your work. If Unity works it is because Unity has some self signing trickery which BlitzMax does not include. In future it is likely no unsigned binaries will be trusted on any operating system and it is a small miracle your game can be freely distributed for Windows using anonymous / unregistered mingw toolchains. or you include the standard control click open menu requirement clause... |
| ||
Hallo. It's crashing on a call to brl_stream_WriteInt - TStream.WriteInt() - which implies the TStream that you attempted to open for writing, didn't work, and may be Null at the point you try to use it. A couple of things to look into : * Improve handling of failures, such as your TStream being null because you weren't granted permission to open is - something like a user notification to say there was an error and you can't continue, or run without saving? * It's likely that your App is being "sandboxed" which would prevent it writing into unauthorised locations. There are standard locations on OS X (and other platforms) that your app has write access to. You should be using those, instead of assuming you can write to the local folder. For accessing standard locations, I have a module (BaH.Volumes) which will get the correct paths for you to use with your app. |
| ||
@ skidracer Signing ? Why should one sign it? I accept sign-requirements if you want to publish it in a store, but for "hobbyist/selfmade-binaries" I think this should be made voluntary. @ Access rights Linux and Mac systems store their owner rights in zip files. So when extracting a linux binary you are able to "run" a binary because it got it's executable bit set. Now archive it via 7z and this will remove the file access bitmask. If I need that functionality, then I 7z-archive my folder with a "123"-password and the 7z setting to even password-encrypt the file list of the archive. That way Windows OS does no longer want admin access when executing an previously unpacked the archive ("downloaded program"). Mac has a similar security mechanic - and it might kick in here. So while the game is run in a download-folder it might not have the required rights to modify files in its "own" folder (which for a "portable game" is something I dislike very much). And even if it has access to its own folder: if the parental folder disallows changes for itself and the children, then it will be prohibited too (this is the reason for many "amateurs" to chmod777 their apache-htdocs folders). @ Brucey BaH.Volumes allows access to $home$ and so on - but does not help a portable app to be able to write in the folder of the binary. So you can only do as you already suggested: inform the user about the problem your app is confronted with, it is his computer so it is his task to "repair" it. You could offer your user a "fallback" (I cannot write to my directory, so I could use a non-portable directory in your home folder...). Remember to not rely on "notify()" but use a ingame-window. On Linux notify() and confirm() only print to the console (it only uses "WriteStdout" in the system.linux.bmx) so I wanted to note it down as you might run into that problem when doing "cross platform" programming with BlitzMax. bye Ron |
| ||
Thanks for the replies! That's a good few things I can spend some time looking into. |
| ||
I accept sign-requirements if you want to publish it in a store, but for "hobbyist/selfmade-binaries" Expecting the user to both unlock and then change security permissions and then use a control click open sequence to run your app is expecting a lot. I admit that Tifu's issue is more likely file permissions so my remarks are perhaps OT. |
| ||
Ok! Success I think! I seem to have gotten it working thanks to Brucey's volume module, saving settings and progress to a folder in the App Data folder that I created seems to work so far. I had to change a lot of code though (using incbin for a lot of data I used to just have in a textdata folder) so I'll have to test through the game a few times to be certain I've fixed everything, but this has solved my saving problem it seems, thanks so much! |