andlabs / andlabs/libui

How to make ui executable a double clickable Mac app

Abierto
#474 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C
Estrellas
10.9k
Forks
612
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

To make a "Double Clickable" Application for the Finder from an executable compiled with libui, one needs only to put the ui_executable in the correct directory structure:
|--- ui_executable.app
|------ Contents
|--------- MacOS
|------------ ui_executable
|--------- PkgInfo

The attached bash script will do that. It has been tested with your examples.

[makeapp.zip](https://github.com/andlabs/libui/files/3676999/makeapp.zip)
```
#!/bin/bash
#├── $1.app
#│   └── Contents
#│   ├── MacOS
#│   │   └── $1
#│   └── PkgInfo

if [ -z "$1" ]; then
_self="${0##*/}"
echo "Usage: $_self "
exit 0;
fi

mkdir -p "$1.app/Contents/MacOS"
mv "$1" "$1.app/Contents/MacOS/"
echo 'APPL????' > "$1.app/Contents/PkgInfo"

# Info.plist is optional
# change copyright for "Get Info" in Finder
copyright="$(id -F) License"
cat > "$1.app/Contents/Info.plist" <<- EOM

CFBundleExecutable
$1
CFBundleIdentifier
com.uiLib.$1
CFBundleInfoDictionaryVersion
6.0
CFBundleName
$1
CFBundlePackageType
APPL
CFBundleShortVersionString
1.0
CFBundleSupportedPlatforms

MacOSX

CFBundleVersion
1
NSHumanReadableCopyright
$copyright

EOM

# touch is important for Finder
touch "$1.app"
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.