JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.22k stars 1.18k forks source link

Support for custom WXS entries during MSI packaging #1972

Closed dmvanderuit closed 1 month ago

dmvanderuit commented 2 years ago

Hi,

I've got a question regarding the packaging of the application. In the section on native distributions, the docs mention that the packaging uses JPackage under the hood. In JPackage, it's possible to further customise the installer using WXS files. Is this something that is supported in the packaging of MSI packages run by the Gradle task in Compose too?

Thanks in advance.

sebkur commented 2 years ago

I think this might already be possible. In AbstractJPackageTask.kt we already have

if (targetFormat != TargetFormat.AppImage) {
    …
    cliArg("--resource-dir", jpackageResources)
    …
}

where jpackageResources is defined here:

@get:LocalState
protected val jpackageResources: Provider<Directory> = project.layout.buildDirectory.dir("compose/tmp/resources")

so apparently compose/tmp/resources is passed to jpackage via --resource-dir and files to modify the input for Wix creating the msi such as a modified main.wxs could be copied there.

sebkur commented 2 years ago

ah, well, OK, but then there's also cleanDirs(jpackageResources) executed during prepareWorkingDir, so essentially anything we copy to compose/tmp/resources to modify the input data for Wix will be deleted before running jpackage.

imptah commented 1 year ago

Any updated on this? It can be very useful! I have a need to write a registry entry during installation to register custom URI schema for my App

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.