diff --git a/electron.vite.config.js b/electron.vite.config.js
index 7119cf9..56deae9 100644
--- a/electron.vite.config.js
+++ b/electron.vite.config.js
@@ -18,7 +18,7 @@ import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
import commonjsExternals from 'vite-plugin-commonjs-externals'
-const externals = ['pimi-launcher-core', 'path']
+const externals = ['pimi-launcher-core', 'path', 'process']
export default defineConfig({
main: {
diff --git a/package.json b/package.json
index 473e689..8c5494e 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "pimi-launcher",
- "version": "1.0.0",
- "description": "An Electron application with React",
+ "version": "1.0.0-alpha",
+ "description": "Modern Minecraft Launcher",
"main": "./out/main/index.js",
"author": "artegoser",
"homepage": "https://github.com/artegoser/pimi-launcher",
diff --git a/src/renderer/src/components/utils.js b/src/renderer/src/components/utils.js
index 25ff393..027503d 100644
--- a/src/renderer/src/components/utils.js
+++ b/src/renderer/src/components/utils.js
@@ -1,7 +1,8 @@
import { Client, Authenticator } from 'pimi-launcher-core'
-
+import path from 'path'
+import process from 'process'
async function launch(version, setProgress, setDownload, setGameStarted, setStarted) {
- console.log(version)
+ const appdata = process.platform === 'win32' ? process.env.APPDATA : process.env.HOME
const launcher = new Client()
let opts = {
@@ -9,7 +10,7 @@ async function launch(version, setProgress, setDownload, setGameStarted, setStar
localStorage.getItem('name') || 'Steve',
localStorage.getItem('password') || ''
),
- root: './.pimi',
+ root: path.join(appdata, '.pimi-launcher'),
version: {
number: version.id,
type: version.type
diff --git a/src/renderer/src/pages/Main.jsx b/src/renderer/src/pages/Main.jsx
index 72bf37b..6164416 100644
--- a/src/renderer/src/pages/Main.jsx
+++ b/src/renderer/src/pages/Main.jsx
@@ -49,11 +49,13 @@ function Main() {
name="pets"
id="pet-select"
className="inputs"
- onChange={(e) => setVersion(e.target.value)}
+ onChange={(e) => {
+ setVersion(versions[e.target.value])
+ }}
>
- {versions.map((version) => {
+ {versions.map((version, index) => {
return (
-
)