From 004432d630e6b22b2d6151445bb192730e487aa5 Mon Sep 17 00:00:00 2001 From: Grant Lanham Date: Sat, 15 Mar 2025 14:32:32 -0400 Subject: [PATCH 1/2] Update README and add .nvmrc --- .nvmrc | 1 + readme.md | 43 ++++++++++++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..cb406c6 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16.20.2 diff --git a/readme.md b/readme.md index f3089d9..84fd3e3 100644 --- a/readme.md +++ b/readme.md @@ -1,13 +1,30 @@ -

Sploder Launcher

-A project that aims to revive sploder.
-Join the Discord server! -

How to use:

-- Download the latest release from here.
-- Run the installer.
-- Done.
-

How to build:

-- Use node 14.10.0.
-- Install yarn.
-- Install all the required packages by running yarn.
-- Run build or build.bat. -- The built files will be available in the dist folder. +# Sploder Launcher + +A repository that aims to provide a standalone application to be able to access the Sploder-Revival project without needing to install Flash or downgraded applications system wide. + +Join the [Discord Server](https://discord.gg/cHGz362sdC) for the active community and development. + +## Using without releases + +- Download the [latest release](https://github.com/Sploder-Saptarshi/Sploder-Launcher/releases/latest) +- Run the installer + +## How to build + +### Dependencies + + - [node.js](https://nodejs.org/en) + - [node version manager (nvm)](https://github.com/nvm-sh/nvm) + +### Steps to Build + + - Run `nvm use` to switch to the node version specified in .nvmrc + - Run `npm i` to install all necessary packages + - Run `npm run dist` to build the project + - The built files will be available in the dist folder. + +### Steps to Debug + + - Run `nvm use` to switch to the node version specified in .nvmrc + - Run `npm i` to install all necessary packages + - Run `npm run dev` to start the electron development server From e32e3dda48615ddc42e6273d9229ad2948334b18 Mon Sep 17 00:00:00 2001 From: Grant Lanham Date: Sat, 15 Mar 2025 19:36:05 -0400 Subject: [PATCH 2/2] Fix URL propagation for Launcher --- src/local/offline.html | 63 +++++++++++++++++++++++------------------ src/local/start.html | 64 +++++++++++++++++------------------------- src/main/index.js | 37 ++++++++++++++++++------ 3 files changed, 90 insertions(+), 74 deletions(-) diff --git a/src/local/offline.html b/src/local/offline.html index bf15534..47125d5 100644 --- a/src/local/offline.html +++ b/src/local/offline.html @@ -7,22 +7,38 @@ Sploder @@ -34,28 +50,19 @@ <
-


Whoops... Could not connect to the server.

+


+

Whoops... Could not connect to the server.

Check your internet connection and try again.

+ Server:

If that does not work, please email saptarshi12345yt@gmail.com with your exact issue.

-
- - +
+ + +
- - - - - + + diff --git a/src/local/start.html b/src/local/start.html index 0fa685f..b793921 100644 --- a/src/local/start.html +++ b/src/local/start.html @@ -7,15 +7,16 @@ Sploder -
-
Sploder
+
Sploder
@@ -178,13 +171,8 @@
- - +
- - \ No newline at end of file + diff --git a/src/main/index.js b/src/main/index.js index 4f42c22..3a67fdc 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1,5 +1,16 @@ const { app, BrowserWindow, shell } = require("electron"); const path = require("path"); +process.env.NODE_ENV || 'development'; + +const config = { + SPLODER_URL: "http://127.0.0.1:8010", + DEV: !app.isPackaged, +} +const isDev = config.DEV; +if (isDev) { + console.log(config); +} + // If not on windows, disable RPC let DiscordRPC; if (process.platform == "win32") { @@ -7,7 +18,6 @@ if (process.platform == "win32") { } let win; let pluginName; -const isDev = false; // Change to false if you want to disable development mode and package the application. switch (process.platform) { case "win32": pluginName = process.arch == 'x64' ? 'x64/pepflashplayer.dll' : 'x32/pepflashplayer32.dll'; @@ -116,13 +126,25 @@ function createWindow() { if(isDev){ win.openDevTools(); } + + function getSploderUrl(path='') { + return encodeURIComponent(config.SPLODER_URL + path); + } // Load the custom Windows XP titlebar. - if(isDev){ - startpath = "/../../src/local/start.html?url=" + if(isDev) { + startpath = '/../../src/local/start.html?url=' + console.log('startpath: ', startpath); } else { - startpath = "/../../resources/src/local/start.html?url=" + startpath = '/../../resources/src/local/start.html?url=' + } + function loadURLFromStartPath(appendedPath='') { + const path = "file:///" + app.getAppPath().replace(/\\/g, '/') + startpath + getSploderUrl() + appendedPath; + if (isDev) { + console.log(path); + } + win.loadURL(path); } - win.loadURL("file:///" + app.getAppPath().replace(/\\/g, '/') + startpath + "https://sploder.xyz/update"); + loadURLFromStartPath(); win.webContents.on('did-finish-load', () => { win.show(); }); @@ -147,7 +169,7 @@ function createWindow() { }, }); win.newwin.setMenu(null); - win.newwin.loadURL("file:///" + app.getAppPath().replace(/\\/g, '/') + startpath + url); + loadURLFromStartPath(url); win.newwin.webContents.on('did-finish-load', () => { win.newwin.show(); }); @@ -177,8 +199,7 @@ app.on("window-all-closed", function () { app.quit(); }); - -if (process.platform == "win32") { +if (process.platform === "win32") { const clientId = '915116210570539058'; const rpc = new DiscordRPC.Client({ transport: 'ipc' }); const startTimestamp = new Date();