Skip to content

Wails' default Info.plist configuration can result in broken macOS packaging #4866

@acanewby

Description

@acanewby

Description

By default, a Wails application include the following fragment in build/darwin/Info.[dev.]plist:

        <key>CFBundleExecutable</key>
        <string>{{.Name}}</string>
        <key>CFBundleIdentifier</key>
        <string>com.wails.{{.Name}}</string>

Imagine the following elements of wails.json configuration:

{
    "name": "My Fab Application",
    "outputfilename": "my-fab-application",
}

There are two issues here:

  1. CFBundleExecutable must point to the executable in the Contents/MacOS subfolder. However, in the above case, CFBundleExecutable will contain My Fab Application but Contents/MacOS will contain my-fab-application. This results in a broken application package that reports "You can’t open the application “My Fab Application” because it may be damaged or incomplete." when launched
  2. Per Apple guidance: CFBundleIdentifier can only contain "alphanumeric characters (A–Z, a–z, and 0–9), hyphens (-), and periods (.)". In the above case, CFBundleIdentifier will contain com.wails.My Fab Application. This results in an application package that Apple code signing/notarization will reject

To Reproduce

  1. Begin with a default Wails project
  2. Configure wails.json as described above
  3. Build with wails build -clean
  4. The resulting application package in build/bin will display with no icon and will present an error dialog when launched

Expected behaviour

The out-of-the-box Wails configuration should tolerate correct usage of wails.json parameters.

Two solutions are required:

  1. The default Info.plist template should use wails.json's outputFilename value (even when that is defaulted from name):
  2. Either a new wails.json parameter should introduced (perhaps macosBundleIdentifier?) or an error generated if the generated CFBundleIdentifier fails Apple's formatting requirements

Screenshots

Problem 1:

Image

Problem 2: Non-compliant Info.plist generated using the above (legitimate) wails.json parameters:

        <key>CFBundleExecutable</key>
        <string>My Fab Application</string>
        <key>CFBundleIdentifier</key>
        <string>com.wails.My Fab Application</string>

Attempted Fixes

No response

System Details

Wails Doctor



# Wails
Version | v2.10.2


# System
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | MacOS                                                                                                                       |
| Version      | 15.7.3                                                                                                                      |
| ID           | 24G419                                                                                                                      |
| Branding     |                                                                                                                             |
| Go Version   | go1.24.2                                                                                                                    |
| Platform     | darwin                                                                                                                      |
| Architecture | arm64                                                                                                                       |
| CPU 1        | Apple M1 Max                                                                                                                |
| CPU 2        | Apple M1 Max                                                                                                                |
| GPU          | Chipset Model: Apple M1 Max Type: GPU Bus: Built-In Total Number of Cores: 32 Vendor: Apple (0x106b) Metal Support: Metal 3 |
| Memory       | 32GB                                                                                                                        |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version |
| Xcode command line tools  | N/A          | Installed | 2410    |
| Nodejs                    | N/A          | Installed | 22.15.0 |
| npm                       | N/A          | Installed | 10.9.2  |
| *Xcode                    | N/A          | Available |         |
| *upx                      | N/A          | Available |         |
| *nsis                     | N/A          | Available |         |
|                                                                |
└─────────────────── * - Optional Dependency ────────────────────┘

# Diagnosis
Optional package(s) installation details:
  - Xcode: Available at https://apps.apple.com/us/app/xcode/id497799835
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions