Has anyone been able to set up file associations w...
# compose-desktop
c
Has anyone been able to set up file associations when packaging a compose app (specifically on Mac .dmg)? I don’t see anything in the documentation, so I tried adding the jpackage flags manually to the
AbstractJPackageTask
in my
build.gradle.kts.
but it still doesn’t seem to be working
n
Not sure if related, but I am trying to include some
.sh
scripts with my
.dmg
so that the application can invoke those files, unsure how to include them from the
build.gradle.kts
if you’ve had any success with something like that yet
c
I think that’s something different. You might be able to just bundle those files in the app resources, and at runtime copy them to a temporary file and exec it with
ProcessBuilder
n
Gotcha, yeah I’m using https://github.com/lordcodes/turtle for the execution, definitely a matter of getting the files into the app resources somehow
c
I’m making an app that has a custom file format, and double-clicking that file should directly open the app and start editing that file (think like opening a MS Word file).
c
Yeah, that’s the guide I’ve been following. I have this in the build.gradle.kts:
Copy code
tasks.withType<AbstractJPackageTask>().all {
    freeArgs.add("--file-associations")
    freeArgs.add(project.file("tdlx.properties").absolutePath)
}
and this in that file
Copy code
mime-type=application/vnd.sqlite3
extension=tdlx
description=Tidal Game Document
I’ve verified the build is finding the file and it looks like it’s being added to whatever Gradle is doing, as I see the args added to
build/compose/tmp/packageDmg.args.txt
. But after installing the DMG, it’s still not able to open the file with my app. But I’ve never made any other desktop apps so I really don’t know if this is something I’m doing wrong, or if there’s something with how Compose is running jpackage that’s the problem
m
c
After some more digging into both the jpackage tool and the CfD Gradle plugin source, I’m fairly certain this is an issue with Compose and currently it is not possible to get the
--file-associations
flag working, at least on Mac (I haven’t investigated other targets)