* limitations under the License.
*/
-const wrt = require('../browser/wrt');
+const wrt = require('./wrt');
require(wrt.getElectronPath() + '/browser/init')
* limitations under the License.
*/
-require('../../electron.asar/renderer/init')
+const wrtRenderer = require('./wrt_renderer');
+require(wrtRenderer.getElectronPath() + '/renderer/init')
process.on('uncaughtException', function (error) {
// Do nothing if the user has a custom uncaught exception handler.
if (wrt.isElectronApp()) {
console.log("Electron App launch");
- let filePath = src;
- let pkgJson = require(filePath.substr(7, filePath.length - 12));
- let mainJsPath = filePath.substr(7, filePath.length - 19) +
- (pkgJson.main || 'index.js');
+ require('module').globalPaths.push(wrt.getAppPath());
+ let filePath = src[7] === '/' ? src.substr(8) : src.substr(7); // strip "file://"
+ let pkgJson = require(filePath);
+ let pos = filePath.lastIndexOf('/');
+ let mainJsPath = (pos !== -1 ? filePath.substr(0, pos + 1) : '') +
+ (pkgJson.main || 'index.js');
const Module = require('module');
Module._load(mainJsPath, Module, true);
_this.webApplication.resume();
});
}
- onAppControl() {}
onLanguageChanged() {}
onLowMemory() {}
killAllProcesses() {}