Sorry to ask a bone question, Im building a test a...
# compose-desktop
s
Sorry to ask a bone question, Im building a test application where we are deploying a control application, which can start and stop various components. We want to package these components in resources/common and be able to deploy them to the installdir/app/resources any tips if we can do this via the Gradle script?
r
I'm not sure about case when you do MSI distributable. But did this for preparing
all-in-one-zip
file. Here is the code from
build.gradle.kts
:
Copy code
tasks.register<Copy>("createDistributableWithExtras") {
    dependsOn(":desktop:createDistributable")

    from("../your")
    from("../stuff")
    into(layout.buildDirectory.dir("./compose/binaries/main/app/desktop/model"))
}

tasks.register<Zip>("prepareZip") {
    dependsOn(":desktop:createDistributableWithExtras")

    from(layout.buildDirectory.dir("./compose/binaries/main/app/desktop"))
    archiveFileName.set("your-project-${rootProject.version}.zip")
    destinationDirectory.set(file("./build"))
}
and I just call
prepareZip
gradle command
s
Thanks @rcd27 that's similar to what I do with zip distributions,
Copy code
compose.desktop {
    application {
        mainClass = "MainKt"
        nativeDistributions {
            appResourcesRootDir.set(project.layout.projectDirectory.dir("resources"))
            windows{
                iconFile.set(project.file("pathto/1612983736419.ico"))
                menuGroup = "supderDuperApp"

            }
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
            packageName = "supderDuperApp"
            packageVersion = "1.0.0"
        }
    }
}
Im using the above to create the msi, and it is wrapping the resources dir into the packaged .jar file. Unfortunately I want it to package as part of the msi and to push it into the app/resources dir
r
I need this for MSI as well, if you find any solution, please share.
s
@Alexander Kurasov[JB] is there anyone who may be able to provide a pointer on this?>
a
I don’t have ready solution how to achieve that (