diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 8d7b08c..0fd5ef4 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -170,8 +170,9 @@ compose.desktop { packageVersion = debianVersion iconFile.set(project.file("icons/icon-linux.png")) shortcut = true - appCategory = "AudioVideo" + appCategory = "Qt;KDE;Audio;" debMaintainer = "feufar.ooo" + packageName = "feufar.ooo" } buildTypes.release.proguard { isEnabled.set(false) @@ -284,12 +285,17 @@ fun getCleanDesktopVersion(versionName: String): String { fun getWindowsVersion(rawVersion: String): String { val cleanVersion = rawVersion.trimStart('v', 'V') - val numbers = Regex("""\d+""").findAll(cleanVersion).map { it.value.toLong() }.toList() - val major = numbers.getOrNull(0)?.coerceIn(0, 255) ?: 1 - val minor = numbers.getOrNull(1)?.coerceIn(0, 255) ?: 0 - val build = gitVersionCode.coerceIn(0, 65535) + val semverRegex = Regex("""^(\d+)(?:\.(\d+))?(?:\.(\d+))?""") + val match = semverRegex.find(cleanVersion) - return "$major.$minor.$build" + return if (match != null) { + val major = match.groupValues[1].ifEmpty { "0" } + val minor = match.groupValues[2].ifEmpty { "0" } + val build = match.groupValues[3].ifEmpty { "0" } + "$major.$minor.$build" + } else { + "0.0.0.0" + } } fun getDebianVersion(rawVersion: String): String {