getting the iso file from the user and extracting the assets working properly

This commit is contained in:
trippjoe 2022-03-27 22:55:07 -04:00
parent 5b3db5ef61
commit a80414adb9
5 changed files with 18 additions and 4 deletions

View file

@ -0,0 +1,8 @@
:: mount the ISO File
PowerShell Mount-DiskImage -ImagePath "%USERPROFILE%\AppData\Roaming\opengoal-launcher\iso\jak.iso"
:: extract the folders & files from the ISO File
xcopy G:\*.* %USERPROFILE%\AppData\Roaming\opengoal-launcher\iso\jak1\. /E /Y
:: unmount the ISO File
PowerShell Dismount-DiskImage -ImagePath "%USERPROFILE%\AppData\Roaming\opengoal-launcher\iso\jak.iso"

View file

@ -35,7 +35,7 @@
<!-- buttons -->
<div id="buttons" class="row justify-content-center">
<!-- config button -->
<button id="config" type="button" class="btn btn-success">CONFIG</button>
<button id="config" type="button" class="btn btn-success" onclick="config()">CONFIG</button>
<!-- play button -->
<button id="play" type="button" class="btn btn-success">PLAY</button>
</div>

View file

@ -2,6 +2,7 @@ const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
const isDev = !app.isPackaged;
const { launchGame, buildGame, isoSeries, fetchLatestCommit } = require('./js/utils/utils.js');
let mainWindow;
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
if (require('electron-squirrel-startup')) {
@ -11,7 +12,7 @@ if (require('electron-squirrel-startup')) {
const createWindow = () => {
// Create the browser window.
const mainWindow = new BrowserWindow({
mainWindow = new BrowserWindow({
width: 800,
height: 600,
resizable: false,
@ -71,5 +72,5 @@ ipcMain.on('build', buildGame);
ipcMain.on('launch', launchGame);
app.on('status', (status) => {
win.webContents.send('status', status);
mainWindow.webContents.send('status', status);
});

View file

@ -9,6 +9,7 @@ const offcanvas = document.querySelector(".offcanvas-start");
let backdrop = document.querySelector('.offcanvas-backdrop');
const background = document.querySelector('#background');
const logo = document.querySelector('#logo');
const configButton = document.querySelector("#config");
const { recieve, send } = window.api;
@ -57,4 +58,8 @@ function changeGame(game) {
logo.src = "../assets/images/jak1-logo.png";
break;
}
}
function config() {
send('getISO');
}

View file

@ -70,7 +70,7 @@ function extractISOFile(callback) {
// }
if (process.platform === 'win32') {
const extractISOScript = path.join(__dirname, '../../src/assets/scripts/batch/extract-iso.bat');
const extractISOScript = path.join(__dirname, '../../assets/scripts/batch/extract-iso.bat');
shell.openPath(extractISOScript);
// copy the iso contents to the jak1 folder created above