Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX: Compress DMG #745

Merged
merged 2 commits into from
Nov 25, 2017
Merged

Conversation

jflyper
Copy link
Contributor

@jflyper jflyper commented Nov 25, 2017

UDB0 is good enough.

UDB0 is good enough.
Copy link
Contributor

@basdelfos basdelfos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oddly enough when I created the dmg locally it already compressed the dmg to 89MB, probably an overall systemsetting that already enabled some kind of compression.
I tested your PR to compress with UDB0 and now the filesize reduced to 80MB. Everything is working fine.

gulpfile.js Outdated
@@ -322,7 +322,8 @@ function release_osx64() {
{ 'x': 448, 'y': 342, 'type': 'link', 'path': '/Applications' },
{ 'x': 192, 'y': 344, 'type': 'file', 'path': pkg.name + '.app', 'name': 'Betaflight Configurator.app' }
]
}
},
format: 'UDB0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, according to https://github.com/LinusU/node-appdmg#specification it looks like format should go inside specification (and the same applies to background, maybe that's why the background is not working, @basdelfos).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh, that's it. Now I remember that the background was working in the beginning when I used a separate json file.

Copy link
Contributor

@basdelfos basdelfos Nov 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jflyper can you replace this from line 114:

    return gulp.src([])
        .pipe(appdmg({
            target: path.join(releaseDir, get_release_filename('macOS', 'dmg')),
            basepath: path.join(appsDir, pkg.name, 'osx64'),
            specification: {
                title: 'Betaflight Configurator',
                contents: [
                    { 'x': 448, 'y': 342, 'type': 'link', 'path': '/Applications' },
                    { 'x': 192, 'y': 344, 'type': 'file', 'path': pkg.name + '.app', 'name': 'Betaflight Configurator.app' }
                ],
                background: path.join(__dirname, 'images/dmg-background.png'),
                format: 'UDZO',
                window: {
                    size: {
                        width: 638,
                        height: 479
                    }
                }
            },
        })
    );

It fixes the compression to move to specification and the correct enum value. Also fixes the background not showing in the dmg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange. The dmg file is 205MB, and still no background image...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tags should be double-quoted? Not mandatory???

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting is not mandatory as long as the name does not have special characters like spaces, dashes, ...

@mikeller mikeller merged commit 2e610aa into betaflight:master Nov 25, 2017
@jflyper jflyper deleted the Compress-osx-dmg-with-UDB0 branch November 25, 2017 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants