Skip to content

Commit 11b4e6f

Browse files
optimize: vlc加载 架构名获取
1 parent 043fb34 commit 11b4e6f

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

composeApp/src/desktopMain/kotlin/com/corner/init/CustomDirectoryDiscovery.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ class CustomDirectoryDiscovery:DiscoveryDirectoryProvider {
4545
else "${osName.name.lowercase()}-${SystemUtil.getOsInfo().arch}"
4646
}
4747

48-
private fun getArchName():String{
49-
val arch = SystemUtil.getOsInfo().arch
50-
return if(arch == "amd64") "x86"
51-
else arch
48+
private fun getArchName():String {
49+
System.getProperty("os.arch").lowercase().let {
50+
return when {
51+
"x86" in it || "x64" in it || "amd64" in it -> "x86"
52+
"arm" in it || "aarch" in it -> "arm64"
53+
else -> "x86"
54+
}
55+
}
5256
}
5357

5458
override fun supported(): Boolean {

composeApp/src/desktopMain/kotlin/main.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fun main() {
4343
launchErrorCatcher()
4444
printSystemInfo()
4545
Runtime.getRuntime().addShutdownHook(Thread {
46-
println("Performing cleanup before exiting...")
46+
log.info("Performing cleanup before exiting...")
4747
Init.stop()
4848
})
4949
// System.setProperty("java.net.useSystemProxies", "true");

0 commit comments

Comments
 (0)