|
|
@ -122,7 +122,7 @@ var SF_Plugins = SF_Plugins || {};
|
|
|
|
var path = require('path');
|
|
|
|
var path = require('path');
|
|
|
|
var os = require('os');
|
|
|
|
var os = require('os');
|
|
|
|
var crypto = require('crypto');
|
|
|
|
var crypto = require('crypto');
|
|
|
|
var http = require('http');
|
|
|
|
var https = require('https');
|
|
|
|
|
|
|
|
|
|
|
|
SF_AutoUpdate.FileUtils.evaluateJavascript = function (script) {
|
|
|
|
SF_AutoUpdate.FileUtils.evaluateJavascript = function (script) {
|
|
|
|
(new Function(script)).call(window);
|
|
|
|
(new Function(script)).call(window);
|
|
|
@ -274,7 +274,7 @@ var SF_Plugins = SF_Plugins || {};
|
|
|
|
|
|
|
|
|
|
|
|
SF_AutoUpdate.UpdateUtils.downloadFullUrl = function (fileName, url, success, fail) {
|
|
|
|
SF_AutoUpdate.UpdateUtils.downloadFullUrl = function (fileName, url, success, fail) {
|
|
|
|
var file = fs.createWriteStream(fileName);
|
|
|
|
var file = fs.createWriteStream(fileName);
|
|
|
|
http.get(url, function (response) {
|
|
|
|
https.get(url, function (response) {
|
|
|
|
response.pipe(file);
|
|
|
|
response.pipe(file);
|
|
|
|
file.on('finish', function () {
|
|
|
|
file.on('finish', function () {
|
|
|
|
file.close(SF_AutoUpdate.UpdateUtils.evaluateJavascript.bind(SF_AutoUpdate.UpdateUtils, success));
|
|
|
|
file.close(SF_AutoUpdate.UpdateUtils.evaluateJavascript.bind(SF_AutoUpdate.UpdateUtils, success));
|
|
|
|