"damaged or incomplete" error when app is run outside of build folder

wick

Member
3rd Party Module Dev
Patreon Bronze
Joined
Jul 17, 2017
Location
oakland
This might be some kind of mac permissions problem, but I can't find any leads via google.

Game runs fine if I run it from glfw3/xcode/build/Release. If I copy that .app file to anywhere else, the icon gets crossed out and trying to run it will throw a "You can't open the application ... because it may be damaged or incomplete." Screenshot attached.

Am I looking at the wrong file or building it wrong somehow?

Catalina 10.15.3
Cerberus v2019-10-13
 

Attachments

dawlane

Well-Known Member
CX Code Contributor
Joined
Jun 21, 2017
Sounds like an issue with plist. May need the xcode template updating to a version of xcode that was the entry to the oldest supported version of Mac OS X.
 

wick

Member
3rd Party Module Dev
Patreon Bronze
Joined
Jul 17, 2017
Location
oakland
OK, I think I figured out what's causing it.

- Did a clean rebuild. The .app worked normally.
- I manually modified plist in order to set the app title, icon, etc.
- The "damaged or incomplete" error now pops up as soon as I move or rename the file.

I think this causes the plist's signature to differ from the one in Contents/_CodeSignature/CodeResources.

So... is there a better way to set the app name and icon for osx? Or to rebuild CodeResources after modifying plist? I'm already using #GLFW_APP_ICON, etc.
 
Last edited:

dawlane

Well-Known Member
CX Code Contributor
Joined
Jun 21, 2017
@MikeHart
The app name and bundle id should be easy enough to do.
Update the xcode project template and make sure you have some thing like this.
Take from my experimental git repo.

Cerberus X:
Local appName:=GetConfigVar( "GLFW_APP_NAME" ), bundleID:=GetConfigVar( "GLFW_XCODE_BUNDLE_ID" )

' Set the Application bundle name.
If appName="" appName=QuoteMe("CerberusGame") Else appName=QuoteMe(appName)
If bundleID="" bundleID="com.yourcompany.CerberusGame"

Local params:="OTHER_CFLAGS='"+ccopts+" ' OTHER_LDFLAGS='"+ldopts+" "+libsopts+" ' PRODUCT_NAME='"+StripQuotes( appName ) +
"' PRODUCT_BUNDLE_IDENTIFIER='"+bundleID
            
Execute "xcodebuild -configuration "+casedConfig+" "+params
Adding icons would be a bit trickier as there are two paths to take.
Add the ability to generate icns files from pngs, or use the xcatalog and copy over a bunch of pngs.
 

dawlane

Well-Known Member
CX Code Contributor
Joined
Jun 21, 2017
No I ment that we implemented the icon setting and I thought it worked. Have to look again.
I think this is the bit:
Cerberus X:
Method CopyIcon:Void(iFile:String,targetIcon:String)      
        If HostOS() = "winnt"
            Local iconPath:=ExtractDir(StripExt( tcc.opt_srcpath ))
            local iconFile:String = RealPath(iconPath+"\"+iFile)
            If FileType( iconFile )=FILETYPE_FILE
                'Print "Icon1== "+iconFile
                If ExtractExt( iconFile).ToLower() = "ico"
                    CopyFile (iconFile,targetIcon)
                Else
                    _ConvertToIco (iconFile,targetIcon)
                End
            Else
                iconFile = iFile
                If FileType( iconFile )=FILETYPE_FILE
                    'Print "Icon2== "+iconFile
                    If ExtractExt( iconFile).ToLower() = "ico"
                        CopyFile (iconFile,targetIcon)
                    Else
                        _ConvertToIco (iconFile,targetIcon)
                    End
                Endif
            Endif
        Endif
    End
I don't recall if OS X will handle ico format correctly, due to the nature of how images need to be stores for them to be displayed correctly over all Apple devices. Or if xcodebuild has any way for passing the icon name.
 

Jimmy

Active Member
Tutorial Author
Joined
Jan 2, 2020
Haven't built the latest on OS X due to being stuck on 10.11, so I don't know how it currently is implemented.
I can confirm that the Icon directive does not yet work on the latest version of macOS 10.15.5 Catalina.
 

Jimmy

Active Member
Tutorial Author
Joined
Jan 2, 2020
btw ico is a legacy format that only Windows uses, everything else uses png. I think Windows can use png too?
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
There is a difference changing an icon through file details dialog and providing it through the process of building the exe.
 
Top Bottom