diff --git a/src/main.js b/src/main.js index a92d2cc..52a46f2 100755 --- a/src/main.js +++ b/src/main.js @@ -1,3 +1,7 @@ +// Check when version 6 is uploaded +// Only in case all host have version 5 +// Delete code with comment REMOVE! + var Conf = { appName: 'Verdnatura', odbcPath: 'HKCU\\SOFTWARE\\ODBC\\ODBC.INI\\', @@ -94,12 +98,22 @@ var App = { this.regWrite(path + 'Security', 'Level', 1); // Creates the MySQL ODBC connection - this.createODBC(Conf.odbcPath, defaultDsName, Conf.odbcDriver); + this.createODBC(Conf.odbcPath, + defaultDsName, + Conf.odbcDriver, + Conf.defaultDatasource + ); this.regWrite(Conf.regPath, 'remoteURL', Conf.defaultRemoteURL); this.regWrite(Conf.regPath, 'lastExecutedVersion', Conf.version); - // Delete old strings values (REMOVE IN VERSION 6) + // REMOVE! + this.createODBC(Conf.odbcPath, + 'verdnatura', + Conf.odbcDriver, + 'keep for backward compatibility' + ); + // ----- this.regDelete(Conf.regPath +'\\configured'); this.regDelete(Conf.regPath + '\\remember'); this.regDelete(Conf.odbcPath +'verdnatura\\'); @@ -144,12 +158,12 @@ var App = { selectDatarouce.options.add(option[y]) } } - // In case old general odbc (REMOVE IN VERSION 6) + // REMOVE! if (this.dsName == 'verdnatura') { this.dsName = Conf.defaultDatasource; this.$('datasource').value = this.dsName + Conf.identifier; this.$('datasource').text = this.dsName; - } else + } else // ----- this.$('datasource').value = this.dsName; if (notSignOut && password) { @@ -174,11 +188,11 @@ var App = { this.$('user').focus(); this.$('user').select(); }, - createODBC: function(path, dsName, driverName) { + createODBC: function(path, dsName, driverName, description) { var driverPath = this.getEnv('ProgramFiles') + Conf.driverPath; var params = { Driver: driverPath, - DESCRIPTION: Conf.defaultDatasource, + DESCRIPTION: description, SERVER: Conf.defaultServer, DATABASE: Conf.dbName, SSLCA: this.certFile,