Jakub Kostka
11/10/2024, 6:44 PMOlivier Patry
11/11/2024, 8:05 AMOlivier Patry
11/11/2024, 8:05 AMmacOS {
infoPlist {
extraKeysRawXml = """
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myApp</string>
</array>
</dict>
</array>
"""
}
}
Olivier Patry
11/11/2024, 8:07 AMtry {
Desktop.getDesktop().setOpenURIHandler { event ->
val url = Url(event.uri)
...
}
}
} catch (e: UnsupportedOperationException) {
println("setOpenURIHandler is unsupported")
}
Olivier Patry
11/11/2024, 8:09 AMOlivier Patry
11/11/2024, 8:11 AM2.9.0-alpha02
, there will be NavController.handleDeepLink(request: NavDeepLinkRequest)
Jakub Kostka
11/11/2024, 9:11 AMval commands = listOf(
"""reg add "HKCU\Software\Classes\yourApp" /ve /d "Description here" /f""",
"""reg add "HKCU\Software\Classes\yourApp" /v "URL Protocol" /f""",
"""reg add "HKCU\Software\Classes\yourApp\shell" /f""",
"""reg add "HKCU\Software\Classes\yourApp\shell\open" /f""",
"""reg add "HKCU\Software\Classes\yourApp\shell\open\command" /ve /d "\"$exePath\" \"%1\"" /f"""
)
for (cmd in commands) {
val process = Runtime.getRuntime().exec(cmd)
process.waitFor()
if (process.exitValue() != 0) {
println("Command failed: $cmd")
process.errorStream.bufferedReader()
.use { it.lines().forEach { line -> println(line) } }
} else {
println("Command succeeded: $cmd")
}
fun main(args: Array<String>) = application {
//handle args here
}
Calling then yourApp://path from the website successfully executes the yourApp.exe. I couldn't find a better solution.Jakub Kostka
11/11/2024, 9:13 AMmikehearn
11/11/2024, 10:47 AMapp.url-schemes = myapp
to the config.mikehearn
11/11/2024, 10:47 AM