feat: implement MySqlManagerService to fetch, track, and verify local MySQL installations
This commit is contained in:
@@ -19,10 +19,8 @@ export class MySqlManagerService {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.binDir = path.join(app.getPath('userData'), 'bin')
|
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')
|
this.catalogPath = path.join(app.getAppPath(), 'src/main/resources/mysql_catalog.json')
|
||||||
if (!fs.existsSync(this.catalogPath)) {
|
if (!fs.existsSync(this.catalogPath)) {
|
||||||
// Fallback for production or different root
|
|
||||||
this.catalogPath = path.join(process.cwd(), 'src/main/resources/mysql_catalog.json')
|
this.catalogPath = path.join(process.cwd(), 'src/main/resources/mysql_catalog.json')
|
||||||
}
|
}
|
||||||
this.init()
|
this.init()
|
||||||
@@ -49,8 +47,13 @@ export class MySqlManagerService {
|
|||||||
const dynamicVersions: MySqlVersion[] = releases.map(v => {
|
const dynamicVersions: MySqlVersion[] = releases.map(v => {
|
||||||
const version = v.version
|
const version = v.version
|
||||||
const cycle = v.series
|
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 {
|
return {
|
||||||
id: `mysql-${version}`,
|
id: `mysql-${version}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user