简体   繁体   中英

Create mac DMG file on windows

We've got application which produces installer for windows and mac (app works under windows). It is almost finished, the last step is to create dmg. Is it possible to do it on windows?

Problem solved. I've used mkisofs to create dmg. This is my gradle script which produces dmg file:

apply plugin: 'base'

task build << {
    if (!project.hasProperty('dmgBuildDir')) {
        project.ext.set('dmgBuildDir', buildDir.absolutePath)
    }
    def mkisofs = new File(project.projectDir, 'src/main/resources/mkisofs.exe').getAbsolutePath()
    ant.exec(executable:mkisofs, failonerror: false, resultproperty: 'buildDmgRc') {
        arg(value: '-J')
        arg(value: '-R')
        arg(value: '-o')
        arg(value: DmgName+'.dmg')
        arg(value: '-mac-name')
        arg(value: '-V')
        arg(value:  DmgLabel)
        arg(value: '-apple')
        arg(value: '-v')
        arg(value: '-dir-mode')
        arg(value: '777')
        arg(value: '-file-mode')
        arg(value: '777')
        arg(value: new File(buildDir, 'installer'))
    }
    if (!ant.properties['buildDmgRc'].equals('0')) {
        throw new Exception('ant.exec failed rc: '+ant.properties['buildDmgRc'])
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM