Multi-Platform Support

This commit is contained in:
NaiboWang-Alienware 2023-02-07 17:25:08 +08:00
parent fe0e84f64b
commit d0c08ccd97
2 changed files with 11 additions and 3 deletions

View File

@ -10,6 +10,14 @@ if (process.platform === 'win32' || process.platform === 'win64') {
driverPath = path.join(__dirname, "chrome_win32/chromedriver_win32.exe");
chromeBinaryPath = path.join(__dirname, "chrome_win32/chrome.exe");
execute_path = path.join(__dirname, "chrome_win32/execute.bat");
} else if (process.platform === 'darwin') {
driverPath = path.join(__dirname, "chrome_mac/chromedriver");
chromeBinaryPath = path.join(__dirname, "chrome_mac/Chromium.app/Contents/MacOS/Chromium");
execute_path = path.join(__dirname, "chrome_mac/execute.sh");
} else if (process.platform === 'linux') {
driverPath = path.join(__dirname, "chrome_linux/chromedriver");
chromeBinaryPath = path.join(__dirname, "chrome_linux/chrome");
execute_path = path.join(__dirname, "chrome_linux/execute.sh");
}
let server_address = "https://servicewrapper.systems";
@ -146,7 +154,7 @@ function handleOpenBrowser(event) {
const win = BrowserWindow.fromWebContents(webContents);
runBrowser();
flowchart_window = new BrowserWindow({
width: 1440,
width: 1600,
height: 900,
icon: iconPath,
});

View File

@ -680,8 +680,8 @@ if __name__ == '__main__':
driver_path = os.path.join(
os.getcwd(), "EasySpider/resources/app/chrome_win32/chromedriver_win32.exe")
elif sys.platform == "linux" and platform.architecture()[0] == "64bit":
options.binary_location = "EasySpider/chrome_linux64/chrome"
driver_path = "EasySpider/chrome_linux64/chromedriver_linux64"
options.binary_location = "EasySpider/resources/app/chrome_linux64/chrome"
driver_path = "EasySpider/resources/app/chrome_linux64/chromedriver_linux64"
elif sys.platform == "darwin" and platform.architecture()[0] == "64bit":
options.binary_location = "EasySpider/chrome_mac64/chrome"
driver_path = "EasySpider/chrome_mac64/chromedriver_mac64"