문제

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'])
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top