Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Oct 5, 2023
2 parents 8186af3 + ba08402 commit 1a87362
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 28 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ Run the `setup.exe` file and follow all instructions.

Run the `.dmg` file and follow all instructions to move the file into your Applications folder.

### Ubuntu - Graphical Interface
### Ubuntu

> **Note:** If you're running the `.AppImage` and the app window clears to a white screen within a few seconds of starting, you will need to follow the [Developer Instructions](#developer-installation) on the [linux-fix](https://github.com/neurodatawithoutborders/nwb-guide/tree/linux-fix) branch of the NWB GUIDE.
#### Graphical Interface

Right-click the `.AppImage` file, navigate to `permissions`, and check any box which mentions 'run as executable'.

### Ubuntu - CLI
#### Ubuntu - CLI

From the terminal, simply type

Expand All @@ -57,6 +61,7 @@ Where you are using version `X.Y.Z`; then execute by calling




## Developer Installation

Start by cloning the repository
Expand Down
9 changes: 2 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
"name": "nwb-guide",
"productName": "NWB GUIDE",
"version": "0.0.10",
"private": true,
"description": "",
"main": "./build/main/main.js",
"engine": {
"node": ">=18"
},
"workspaces": [
"src/renderer"
],
"scripts": {
"start": "electron-vite dev --outDir build",
"postinstall": "electron-builder install-app-deps",
Expand Down
3 changes: 2 additions & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import './application-menu.js';

import icon from '../renderer/assets/img/logo-guide-draft.png?asset'
import splashHTML from './splash-screen.html?asset'
import preloadUrl from './../preload/preload.js?asset'

// autoUpdater.channel = "latest";

Expand Down Expand Up @@ -242,7 +243,7 @@ function initialize() {
enableRemoteModule: true,
contextIsolation: false,
sandbox: false,
// preload: path.join(__dirname, "preload.js"),
preload: path.join(preloadUrl),
},
};

Expand Down
12 changes: 12 additions & 0 deletions src/preload/preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const electron = require("electron");

// Expose ipcRenderer
if (process.contextIsolated) {
try {
electron.contextBridge.exposeInMainWorld("electron", electron);
} catch (error) {
console.error(error);
}
} else {
globalThis.electron = electron;
}
Empty file removed src/preload/preload.ts
Empty file.
7 changes: 0 additions & 7 deletions src/renderer/package.json

This file was deleted.

1 change: 0 additions & 1 deletion src/renderer/src/electron/check.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var userAgent = navigator.userAgent.toLowerCase();
export const isElectron = userAgent.indexOf(" electron/") > -1;

export default isElectron;
6 changes: 1 addition & 5 deletions src/renderer/src/electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import isElectron from "./check.js";
export { isElectron };

export let port = 4242;
export let electron = {};
export const electron = globalThis.electron ?? {}; // ipcRenderer, remote, shell, etc.
export let fs = null;
export let os = null;
export let remote = {};
Expand All @@ -15,13 +15,9 @@ export let crypto = null;

if (isElectron) {
try {
// Import Electron API
electron = require("electron"); // ipcRenderer, remote, shell, etc.
fs = require("fs-extra"); // File System
os = require("os");

crypto = require("crypto");

remote = require("@electron/remote");
app = remote.app;

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const appVersion = app?.getVersion();

const statusBar = new StatusBar({
items: [
{ label: unsafeSVG(webAssetSVG), value: appVersion ?? 'Web' },
{ label: unsafeSVG(webAssetSVG), value: isElectron ? appVersion ?? 'ERROR' : 'Web' },
{ label: unsafeSVG(wifiSVG) },
{ label: unsafeSVG(serverSVG) }
]
Expand Down

0 comments on commit 1a87362

Please sign in to comment.