Fixes, old certificated also included in a single file
This commit is contained in:
parent
fcb483919e
commit
2aceea6bcb
|
@ -1,6 +1,6 @@
|
|||
|
||||
#define MyAppName "Verdnatura"
|
||||
#define MyAppVersion "1.2"
|
||||
#define MyAppVersion "2"
|
||||
#define MyAppPublisher "Verdnatura"
|
||||
#define MyAppURL "http://www.verdnatura.es/"
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIEQzCCAyugAwIBAgIJAJimL+J4jUaQMA0GCSqGSIb3DQEBBQUAMIG2MQswCQYD
|
||||
VQQGEwJFUzEdMBsGA1UECAwUQ29tdW5pZGFkIFZhbGVuY2lhbmExETAPBgNVBAcM
|
||||
CFZhbGVuY2lhMR4wHAYDVQQKDBVWZXJkbmF0dXJhIExldmFudGUgU0wxFDASBgNV
|
||||
BAsMC0luZm9ybWF0aWNhMRYwFAYDVQQDDA12ZXJkbmF0dXJhLmVzMScwJQYJKoZI
|
||||
hvcNAQkBFhhob3N0bWFzdGVyQHZlcmRuYXR1cmEuZXMwIBcNMTMwNjExMTE1MjQ1
|
||||
WhgPMjA2MzA1MzAxMTUyNDVaMIG2MQswCQYDVQQGEwJFUzEdMBsGA1UECAwUQ29t
|
||||
dW5pZGFkIFZhbGVuY2lhbmExETAPBgNVBAcMCFZhbGVuY2lhMR4wHAYDVQQKDBVW
|
||||
ZXJkbmF0dXJhIExldmFudGUgU0wxFDASBgNVBAsMC0luZm9ybWF0aWNhMRYwFAYD
|
||||
VQQDDA12ZXJkbmF0dXJhLmVzMScwJQYJKoZIhvcNAQkBFhhob3N0bWFzdGVyQHZl
|
||||
cmRuYXR1cmEuZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsqq+h
|
||||
1kUfZE19Inm3M2XF1ytIqXeIsXsiZ5T9aVdedQrF2xcVOr4dvJyE5zp9g7NNxy9T
|
||||
FyAHPXiPWKSoX3w0uoQfLW9Hm19QZYu40hBD5oRrJy5m6l4JU3Gj0tnkvYc4m8Fl
|
||||
2uEUT3ain0FE2I1XjKpL6eQi9TKjhgmWNRgDJUbllAB3lsQLkNfB6EFo2QJykiKl
|
||||
aRi4UaHdSkd3zkUJyYRdcG7IxCFvsViKpwr3JF+TLXSN/oronLFgG8cKedrn+sMW
|
||||
pBm2FZQKAh8hLT3QQQqQgGpQ2y4t2EVJkYVdcGBXCyWYDKegMXgJR10WunICFCaD
|
||||
kM0P3pYQdtbgr7e9AgMBAAGjUDBOMB0GA1UdDgQWBBQ9+iZdf7pLNQItxs4o43dN
|
||||
FZD0CTAfBgNVHSMEGDAWgBQ9+iZdf7pLNQItxs4o43dNFZD0CTAMBgNVHRMEBTAD
|
||||
AQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAcFzJhm3jjuexZf9tTgQfzwtsafLLsYkrm
|
||||
EZOTkhvZFJYbBd8UngL5UPF1M3buSEV1VqsWCALLrFkxzbmjk5uM8cswZR/3J6un
|
||||
7GFYWTEllVgkD8KmNA2b6j5uSuGCQmOccsR4069vwNjrvTbtQpEpEAAnDf6d5/N4
|
||||
MXuDozHq3iEYi7qyGf++5mp4D+82y2ONSUsiLgxqnMT5JX/yhDKI1IiX1ndyt+6r
|
||||
ie2i2fzdOgovlAILuTM4hoUjPYFOxwmUwpxU2EAjPqo9Bi7bQiH+fv0QBzbpQ9on
|
||||
DRHo7NuXaDG49nvatJjuf4DiDELBCTMeKBOk5hG7kyWCIwp5wr+w
|
||||
-----END CERTIFICATE-----
|
78
src/main.js
78
src/main.js
|
@ -10,6 +10,9 @@ var Conf = {
|
|||
,defaultLocale: 'es'
|
||||
,dbName: 'vn2008'
|
||||
,maxCorruptSize: 600
|
||||
,odbcDriver: 'MySQL ODBC 8.0 ANSI Driver'
|
||||
,driverPath: '\\MySQL\\Connector ODBC 8.0\\myodbc8a.dll'
|
||||
,version: 2
|
||||
};
|
||||
|
||||
var Locale = {
|
||||
|
@ -51,6 +54,10 @@ var App = {
|
|||
window.moveTo((screen.width - width) / 2, (screen.height - height) / 2);
|
||||
},
|
||||
|
||||
onUnload: function() {
|
||||
this.disableUi(false);
|
||||
},
|
||||
|
||||
onLoad: function() {
|
||||
// Initializes the global variables
|
||||
|
||||
|
@ -72,25 +79,24 @@ var App = {
|
|||
|
||||
var configured = this.regRead(Conf.regPath, 'configured');
|
||||
|
||||
if (!configured) {
|
||||
if (!configured || configured < Conf.version) {
|
||||
var path;
|
||||
|
||||
// Creates the Access configuration entries
|
||||
|
||||
path = 'HKCU\\Software\\Microsoft\\Office\\11.0\\Access\\Settings';
|
||||
this.regWrites(path, 'REG_DWORD', {
|
||||
'Confirm Document Deletions' : 0,
|
||||
'Confirm Action Queries' : 0,
|
||||
'Confirm Record Changes' : 0
|
||||
this.regWrites(path, {
|
||||
'Confirm Document Deletions' : false,
|
||||
'Confirm Action Queries' : false,
|
||||
'Confirm Record Changes' : false
|
||||
});
|
||||
|
||||
path = 'HKCU\\Software\\Microsoft\\Office\\11.0\\Access\\Security';
|
||||
this.regWrite(path, 'Level', 1, 'REG_DWORD');
|
||||
this.regWrite(path, 'Level', 1);
|
||||
|
||||
// Creates the MySQL ODBC connection
|
||||
|
||||
var driverPath = this.getEnv('ProgramFiles')
|
||||
+'\\MySQL\\Connector ODBC 8.0\\myodbc8a.dll';
|
||||
var driverPath = this.getEnv('ProgramFiles') + Conf.driverPath;
|
||||
|
||||
var params = {
|
||||
Driver : driverPath,
|
||||
|
@ -100,20 +106,20 @@ var App = {
|
|||
SSLCA : this.certFile,
|
||||
SSLMODE : 'VERIFY_IDENTITY',
|
||||
SSLCIPHER : 'AES256-SHA',
|
||||
AUTO_RECONNECT : 1,
|
||||
NO_PROMPT : 1,
|
||||
ENABLE_CLEARTEXT_PLUGIN : 1
|
||||
AUTO_RECONNECT : '1',
|
||||
NO_PROMPT : '1',
|
||||
ENABLE_CLEARTEXT_PLUGIN : '1'
|
||||
};
|
||||
|
||||
this.createOdbc(
|
||||
Conf.dsName,
|
||||
'MySQL ODBC 8.0 ANSI Driver',
|
||||
Conf.odbcDriver,
|
||||
params
|
||||
);
|
||||
|
||||
// Marks the application as configured
|
||||
|
||||
this.regWrite(Conf.regPath, 'configured', 1, 'REG_DWORD');
|
||||
this.regWrite(Conf.regPath, 'configured', Conf.version);
|
||||
}
|
||||
|
||||
// Loads the form data
|
||||
|
@ -142,11 +148,9 @@ var App = {
|
|||
},
|
||||
|
||||
createOdbc: function(dsName, driverName, params) {
|
||||
var odbcPath = 'HKCU\\Software\\ODBC\\ODBC.INI\\';
|
||||
|
||||
this.regWrites(odbcPath + dsName, 'REG_SZ', params);
|
||||
this.regWrite(odbcPath + 'ODBC Data Sources',
|
||||
dsName, driverName, 'REG_SZ');
|
||||
var odbcPath = 'HKCU\\Software\\ODBC\\ODBC.INI\\';
|
||||
this.regWrites(odbcPath + dsName, params);
|
||||
this.regWrite(odbcPath + 'ODBC Data Sources', dsName, driverName);
|
||||
},
|
||||
|
||||
disableUi: function(disabled, loadMessage) {
|
||||
|
@ -225,8 +229,8 @@ var App = {
|
|||
if (!password || password === '')
|
||||
throw new Error(_('Enter a password'));
|
||||
|
||||
this.regWrite(Conf.dsPath, 'UID', user, 'REG_SZ');
|
||||
this.regWrite(Conf.dsPath, 'PWD', password, 'REG_SZ');
|
||||
this.regWrite(Conf.dsPath, 'UID', user);
|
||||
this.regWrite(Conf.dsPath, 'PWD', password);
|
||||
|
||||
var version = this.fetchVersion();
|
||||
|
||||
|
@ -263,7 +267,7 @@ var App = {
|
|||
|
||||
try {
|
||||
mysqlConn.open(this.getOdbcString({
|
||||
Driver : '{MySQL ODBC 8.0 ANSI Driver}',
|
||||
Driver : '{'+ Conf.odbcDriver +'}',
|
||||
Server : Conf.dbHost,
|
||||
Database : Conf.dbName,
|
||||
Uid : this.$('user').value,
|
||||
|
@ -403,8 +407,8 @@ var App = {
|
|||
},
|
||||
|
||||
openMdb: function() {
|
||||
var remember = this.$('remember').checked ? 1 : 0;
|
||||
this.regWrite(Conf.regPath, 'remember', remember, 'REG_DWORD');
|
||||
var remember = !!this.$('remember').checked;
|
||||
this.regWrite(Conf.regPath, 'remember', remember);
|
||||
|
||||
var programFiles = this.getEnv('ProgramFiles');
|
||||
var accessBin = programFiles +'\\Microsoft Office\\OFFICE11\\MSACCESS.EXE';
|
||||
|
@ -420,7 +424,7 @@ var App = {
|
|||
var clearPassword = err.name == 'BadLogin';
|
||||
|
||||
if (!this.$('remember').checked || clearPassword)
|
||||
this.regWrite(Conf.dsPath, 'PWD', '', 'REG_SZ');
|
||||
this.regWrite(Conf.dsPath, 'PWD', '');
|
||||
|
||||
this.disableUi(false);
|
||||
this.showMessage(err.message, 'error');
|
||||
|
@ -498,16 +502,32 @@ var App = {
|
|||
},
|
||||
|
||||
regWrite: function(path, key, value, type) {
|
||||
this.shell.regWrite(path +'\\'+ key, value, type);
|
||||
if (!type)
|
||||
switch (typeof (value))
|
||||
{
|
||||
case 'boolean':
|
||||
type = 'REG_DWORD';
|
||||
value = value ? 1 : 0;
|
||||
break;
|
||||
case 'number':
|
||||
type = 'REG_DWORD';
|
||||
break;
|
||||
default:
|
||||
type = 'REG_SZ';
|
||||
}
|
||||
|
||||
this.shell.regWrite(path +'\\'+ key, value.toString(), type);
|
||||
},
|
||||
|
||||
regWrites: function(path, type, values) {
|
||||
regWrites: function(path, values, type) {
|
||||
for(var key in values)
|
||||
this.regWrite(path, key, values[key], type);
|
||||
this.regWrite(path, key, values[key], type);
|
||||
},
|
||||
|
||||
onUnload: function() {
|
||||
this.disableUi(false);
|
||||
regDelete: function(path) {
|
||||
try {
|
||||
this.shell.regDelete(path);
|
||||
} catch (e) {}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue