feat: implement MySqlManagerService to fetch, track, and verify local MySQL installations

This commit is contained in:
Ümit Tunç
2026-03-28 09:53:53 +03:00
parent 430476416d
commit 4195cdfa8b
+7 -4
View File
@@ -19,10 +19,8 @@ export class MySqlManagerService {
constructor() {
this.binDir = path.join(app.getPath('userData'), 'bin')
// In development, it's in src/main/resources, but we should handle both
this.catalogPath = path.join(app.getAppPath(), 'src/main/resources/mysql_catalog.json')
if (!fs.existsSync(this.catalogPath)) {
// Fallback for production or different root
this.catalogPath = path.join(process.cwd(), 'src/main/resources/mysql_catalog.json')
}
this.init()
@@ -49,8 +47,13 @@ export class MySqlManagerService {
const dynamicVersions: MySqlVersion[] = releases.map(v => {
const version = v.version
const cycle = v.series
// Pattern: https://downloads.mysql.com/archives/get/p/23/file/mysql-VERSION-winx64.zip
const url = `https://downloads.mysql.com/archives/get/p/23/file/mysql-${version}-winx64.zip`
// Extract MAJOR.MINOR (e.g. 8.0 from 8.0.40)
const versionParts = version.split('.')
const majorMinor = `${versionParts[0]}.${versionParts[1]}`
// Working CDN Pattern: https://cdn.mysql.com/archives/mysql-MAJOR.MINOR/mysql-VERSION-winx64.zip
const url = `https://cdn.mysql.com/archives/mysql-${majorMinor}/mysql-${version}-winx64.zip`
return {
id: `mysql-${version}`,