Skip to content

macOS-bundler: unmount old dmg when building #1571

@lucaheise

Description

@lucaheise

When (re)building the binarys the Build-Script will fail if the previouly build .dmg file is still mounted.

Steps to reproduce the behavior:

  1. Build the binarys
  2. Open the .dmg file
  3. Close the file (Closing won't actually unmount it)
  4. Build again

Expected behavior
I think there should be an exception preventing this.
Either it should check if previously the created .dmg is still mounted and exit with corresponding error-message or (better) it should try to unmount it.

While building the script will actually mount the new .dmg file and unmount it again. So unmounting it with the same process as in tauri/tooling/bundler/src/bundle/templates/dmg/bundle_dmg Line 360 should be possible as long as names dont change.

# unmount
echo "Unmounting disk image..."
hdiutil detach "${DEV_NAME}"

OS: macOS 11.2.3 / M1
Node: 15.12.0
NPM: 7.6.3
Rustc: 1.51.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions