-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packageDmg and install run init KCEF error #2
Comments
Installation DirectoryYou should provide a proper installation directory. This can depend on the platform the application is running on. I built a tooling library that can help you. dependencies {
implementation("dev.datlag.tooling:tooling:1.1.0") // can be used in commonMain
} Then you can initialize KCEF like this: /**
* Your provided app name should not contain whitespaces, as some systems do not support it
* So instead of "My application", do something like "My-application"
*
* Your provided app name should not be localized, so it should not change if the user switches his language
* The app name has to be a constant value
*/
val appWriteableRootFolder = Tooling.getApplicationWriteableRootFolder("your-app-name") ?: File("./")
val kcefInstallDir = File(appWriteableRootFolder, "kcef-bundle")
KCEF.init(
builder = {
installDir(kcefInstallDir)
// all other configuration
},
// all other configuration
) Build ScriptLooking at your build script indicates that the browser won't work on Mac if you package it. The compose {
desktop {
application {
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
jvmArgs("--add-opens", "java.desktop/sun.java2d=ALL-UNNAMED")
jvmArgs("--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED")
if (System.getProperty("os.name").contains("Mac")) {
jvmArgs("--add-opens", "java.desktop/sun.lwawt=ALL-UNNAMED")
jvmArgs("--add-opens", "java.desktop/sun.lwawt.macosx=ALL-UNNAMED")
}
// all other configuration
}
}
} Here is a full working example of the build script: https://github.com/DatL4g/Burning-Series/blob/compose/app/desktop/build.gradle.kts |
nice! it's working !! thanks!!! |
Hi @LiuPack I'm facing a similar issue. I could implement KCEF on my compose desktop app and make it to work without issue swhen running from IntelliJ Idea. But when creating the MSI file and installing the app on Windows I'm always getting into I tried using |
@tomastiminskas It's required to clean the project before packaging Otherwise just try to debug where the package will be saved when you use the |
@DatL4g I copied the implementation of the example project and even when running from IntelliJ Idea I'm getting on the "The provided archive contains a bad (malicious) file". Thanks in advance for you help |
Hi @tomastiminskas This is how I currently handle it. You can control the different installation paths of |
Thanks @LiuPack it worked. |
build release dmg ,install and run KCEF.init error
this is my
KCEF Init
this is my
build.gradle
The text was updated successfully, but these errors were encountered: