FedoraQt / MediaWriter

Fedora Media Writer - Write Fedora Images to Portable Media
GNU General Public License v2.0
708 stars 154 forks source link

macOS dmg include link to Applications folder #624

Closed ghost closed 1 year ago

ghost commented 1 year ago

First - have to say Media Writer is AMAZING!

This is an enhancement request. In #fedora:fedoraproject.org Matrix today, a question was asked if for the macOS dmg to include a linked folder to Applications so folks could drag and drop the app to their Applications folder?

Here's a similar example of this: https://apple.stackexchange.com/questions/404954/how-to-create-drag-to-applications-folder-in-dmg

ghost commented 1 year ago

I think updating the dmg() function to include this might do this, I don't have Xcode installed to test, but this might work if you agree with the enhancement.

https://github.com/FedoraQt/MediaWriter/blob/e51f3f27eb3cae51019b6e5fb445d00d609df50a/dist/mac/build.sh#L97

function dmg() {
    pushd build >/dev/null
    echo "=== Creating a disk image ==="
    # create the .dmg package - beware, it won't work while FMW is running (blocks partition mounting)
    rm -f "../*.dmg"
    STAGING_DIR="$SCRIPTDIR/staging"
    mkdir -p $STAGING_DIR
    cp -R src/app/Fedora\ Media\ Writer.app $STAGING_DIR
    ln -s /Applications $STAGING_DIR/Applications
    hdiutil create -srcfolder $STAGING_DIR -format UDCO -imagekey zlib-level=9 -scrub -volname FedoraMediaWriter-osx ../FedoraMediaWriter-osx-$VERSION.unnotarized.dmg
    rm -rf $STAGING_DIR
    popd >/dev/null
}
grulja commented 1 year ago

Hi, we actually used to have it, but then I think changed/simplified it and it no longer worked. I will look into it for the next release, but I'm currently busy finishing some other work. Thank you for your suggestion.