Fix confilicts
This commit is contained in:
commit
7132d2c402
29
.github/workflows/build.yml
vendored
Normal file
29
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Build/release
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out Git repository
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Install Node.js, NPM and Yarn
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
|
||||||
|
- name: Build/release Electron app
|
||||||
|
uses: samuelmeuli/action-electron-builder@v1
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.github_token }}
|
||||||
|
|
||||||
|
# If the commit is tagged with a version (e.g. "v1.0.0"),
|
||||||
|
# release the app after building
|
||||||
|
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
45
.travis.yml
45
.travis.yml
@ -1,45 +0,0 @@
|
|||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode11.3
|
|
||||||
language: node_js
|
|
||||||
node_js: "12"
|
|
||||||
env:
|
|
||||||
- ELECTRON_CACHE=$HOME/.cache/electron
|
|
||||||
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
|
|
||||||
- ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true
|
|
||||||
- CSC_IDENTITY_AUTO_DISCOVERY=false
|
|
||||||
|
|
||||||
- os: linux
|
|
||||||
services: docker
|
|
||||||
language: generic
|
|
||||||
node_js: "12"
|
|
||||||
env:
|
|
||||||
- ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- node_modules
|
|
||||||
- $HOME/.cache/electron
|
|
||||||
- $HOME/.cache/electron-builder
|
|
||||||
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
|
||||||
ENVS=`env | grep -iE '(DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_)' | sed -n '/^[^\t]/s/=.*//p' | sed '/^$/d' | sed 's/^/-e /g' | tr '\n' ' '`
|
|
||||||
docker run $ENVS --rm \
|
|
||||||
-v ${PWD}:/project \
|
|
||||||
-v ~/.cache/electron:/root/.cache/electron \
|
|
||||||
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
|
||||||
electronuserland/builder:wine \
|
|
||||||
/bin/bash -c "node -v && npm ci && npm run cilinux"
|
|
||||||
else
|
|
||||||
npm run cidarwin
|
|
||||||
fi
|
|
||||||
|
|
||||||
before_cache:
|
|
||||||
- rm -rf $HOME/.cache/electron-builder/wine
|
|
||||||
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- "/^v\\d+\\.\\d+\\.\\d+$/"
|
|
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2017-2021 Daniel D. Scalzi
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
20
README.md
20
README.md
@ -53,9 +53,10 @@ If you download from the [Releases](https://github.com/dscalzi/HeliosLauncher/re
|
|||||||
|
|
||||||
| Platform | File |
|
| Platform | File |
|
||||||
| -------- | ---- |
|
| -------- | ---- |
|
||||||
| Windows x64 | `helioslauncher-setup-VERSION.exe` |
|
| Windows x64 | `Helios-Launcher-setup-VERSION.exe` |
|
||||||
| macOS | `helioslauncher-VERSION.dmg` |
|
| macOS x64 | `Helios-Launcher-setup-VERSION.dmg` |
|
||||||
| Linux x64 | `helioslauncher-VERSION-x86_64.AppImage` |
|
| macOS arm64 | `Helios-Launcher-setup-VERSION-arm64.dmg` |
|
||||||
|
| Linux x64 | `Helios-Launcher-setup-VERSION.AppImage` |
|
||||||
|
|
||||||
## Console
|
## Console
|
||||||
|
|
||||||
@ -76,11 +77,13 @@ If you want to export the console output, simply right click anywhere on the con
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
This section details the setup of a basic developmentment environment.
|
||||||
|
|
||||||
### Getting Started
|
### Getting Started
|
||||||
|
|
||||||
**System Requirements**
|
**System Requirements**
|
||||||
|
|
||||||
* [Node.js][nodejs] v12
|
* [Node.js][nodejs] v16
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -175,14 +178,7 @@ Note that you **cannot** open the DevTools window while using this debug configu
|
|||||||
|
|
||||||
### Note on Third-Party Usage
|
### Note on Third-Party Usage
|
||||||
|
|
||||||
You may use this software in your own project so long as the following conditions are met.
|
Please give credit to the original author and provide a link to the original source. This is free software, please do at least this much.
|
||||||
|
|
||||||
* Credit is expressly given to the original authors (Daniel Scalzi).
|
|
||||||
* Include a link to the original source on the launcher's About page.
|
|
||||||
* Credit the authors and provide a link to the original source in any publications or download pages.
|
|
||||||
* The source code remain **public** as a fork of this repository.
|
|
||||||
|
|
||||||
We reserve the right to update these conditions at any time, please check back periodically.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ const child_process = require('child_process')
|
|||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
const EventEmitter = require('events')
|
const EventEmitter = require('events')
|
||||||
const fs = require('fs-extra')
|
const fs = require('fs-extra')
|
||||||
|
const StreamZip = require('node-stream-zip')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const Registry = require('winreg')
|
const Registry = require('winreg')
|
||||||
const request = require('request')
|
const request = require('request')
|
||||||
@ -222,42 +223,6 @@ class JavaGuard extends EventEmitter {
|
|||||||
this.mcVersion = mcVersion
|
this.mcVersion = mcVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * @typedef OracleJREData
|
|
||||||
// * @property {string} uri The base uri of the JRE.
|
|
||||||
// * @property {{major: string, update: string, build: string}} version Object containing version information.
|
|
||||||
// */
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Resolves the latest version of Oracle's JRE and parses its download link.
|
|
||||||
// *
|
|
||||||
// * @returns {Promise.<OracleJREData>} Promise which resolved to an object containing the JRE download data.
|
|
||||||
// */
|
|
||||||
// static _latestJREOracle(){
|
|
||||||
|
|
||||||
// const url = 'https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html'
|
|
||||||
// const regex = /https:\/\/.+?(?=\/java)\/java\/jdk\/([0-9]+u[0-9]+)-(b[0-9]+)\/([a-f0-9]{32})?\/jre-\1/
|
|
||||||
|
|
||||||
// return new Promise((resolve, reject) => {
|
|
||||||
// request(url, (err, resp, body) => {
|
|
||||||
// if(!err){
|
|
||||||
// const arr = body.match(regex)
|
|
||||||
// const verSplit = arr[1].split('u')
|
|
||||||
// resolve({
|
|
||||||
// uri: arr[0],
|
|
||||||
// version: {
|
|
||||||
// major: verSplit[0],
|
|
||||||
// update: verSplit[1],
|
|
||||||
// build: arr[2]
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// resolve(null)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef OpenJDKData
|
* @typedef OpenJDKData
|
||||||
* @property {string} uri The base uri of the JRE.
|
* @property {string} uri The base uri of the JRE.
|
||||||
@ -281,30 +246,41 @@ class JavaGuard extends EventEmitter {
|
|||||||
if(process.platform === 'darwin') {
|
if(process.platform === 'darwin') {
|
||||||
return this._latestCorretto(major)
|
return this._latestCorretto(major)
|
||||||
} else {
|
} else {
|
||||||
return this._latestAdoptOpenJDK(major)
|
return this._latestAdoptium(major)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static _latestAdoptOpenJDK(major) {
|
static _latestAdoptium(major) {
|
||||||
|
|
||||||
|
const majorNum = Number(major)
|
||||||
const sanitizedOS = process.platform === 'win32' ? 'windows' : (process.platform === 'darwin' ? 'mac' : process.platform)
|
const sanitizedOS = process.platform === 'win32' ? 'windows' : (process.platform === 'darwin' ? 'mac' : process.platform)
|
||||||
|
const url = `https://api.adoptium.net/v3/assets/latest/${major}/hotspot?vendor=eclipse`
|
||||||
const url = `https://api.adoptopenjdk.net/v2/latestAssets/nightly/openjdk${major}?os=${sanitizedOS}&arch=x64&heap_size=normal&openjdk_impl=hotspot&type=jre`
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
request({url, json: true}, (err, resp, body) => {
|
request({url, json: true}, (err, resp, body) => {
|
||||||
if(!err && body.length > 0){
|
if(!err && body.length > 0){
|
||||||
resolve({
|
|
||||||
uri: body[0].binary_link,
|
const targetBinary = body.find(entry => {
|
||||||
size: body[0].binary_size,
|
return entry.version.major === majorNum
|
||||||
name: body[0].binary_name
|
&& entry.binary.os === sanitizedOS
|
||||||
|
&& entry.binary.image_type === 'jdk'
|
||||||
|
&& entry.binary.architecture === 'x64'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if(targetBinary != null) {
|
||||||
|
resolve({
|
||||||
|
uri: targetBinary.binary.package.link,
|
||||||
|
size: targetBinary.binary.package.size,
|
||||||
|
name: targetBinary.binary.package.name
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve(null)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
resolve(null)
|
resolve(null)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static _latestCorretto(major) {
|
static _latestCorretto(major) {
|
||||||
@ -839,6 +815,7 @@ class JavaGuard extends EventEmitter {
|
|||||||
pathSet1 = new Set([
|
pathSet1 = new Set([
|
||||||
...pathSet1,
|
...pathSet1,
|
||||||
...(await JavaGuard._scanFileSystem('C:\\Program Files\\Java')),
|
...(await JavaGuard._scanFileSystem('C:\\Program Files\\Java')),
|
||||||
|
...(await JavaGuard._scanFileSystem('C:\\Program Files\\Eclipse Foundation')),
|
||||||
...(await JavaGuard._scanFileSystem('C:\\Program Files\\AdoptOpenJDK'))
|
...(await JavaGuard._scanFileSystem('C:\\Program Files\\AdoptOpenJDK'))
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
@ -1583,21 +1560,7 @@ class AssetGuard extends EventEmitter {
|
|||||||
this.java = new DLTracker([jre], jre.size, (a, self) => {
|
this.java = new DLTracker([jre], jre.size, (a, self) => {
|
||||||
if(verData.name.endsWith('zip')){
|
if(verData.name.endsWith('zip')){
|
||||||
|
|
||||||
const zip = new AdmZip(a.to)
|
this._extractJdkZip(a.to, dataDir, self)
|
||||||
const pos = path.join(dataDir, zip.getEntries()[0].entryName)
|
|
||||||
zip.extractAllToAsync(dataDir, true, (err) => {
|
|
||||||
if(err){
|
|
||||||
console.log(err)
|
|
||||||
self.emit('complete', 'java', JavaGuard.javaExecFromRoot(pos))
|
|
||||||
} else {
|
|
||||||
fs.unlink(a.to, err => {
|
|
||||||
if(err){
|
|
||||||
console.log(err)
|
|
||||||
}
|
|
||||||
self.emit('complete', 'java', JavaGuard.javaExecFromRoot(pos))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Tar.gz
|
// Tar.gz
|
||||||
@ -1638,6 +1601,32 @@ class AssetGuard extends EventEmitter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _extractJdkZip(zipPath, runtimeDir, self) {
|
||||||
|
|
||||||
|
const zip = new StreamZip.async({
|
||||||
|
file: zipPath,
|
||||||
|
storeEntries: true
|
||||||
|
})
|
||||||
|
|
||||||
|
let pos = ''
|
||||||
|
try {
|
||||||
|
const entries = await zip.entries()
|
||||||
|
pos = path.join(runtimeDir, Object.keys(entries)[0])
|
||||||
|
|
||||||
|
console.log('Extracting jdk..')
|
||||||
|
await zip.extract(null, runtimeDir)
|
||||||
|
console.log('Cleaning up..')
|
||||||
|
await fs.remove(zipPath)
|
||||||
|
console.log('Jdk extraction complete.')
|
||||||
|
|
||||||
|
} catch(err) {
|
||||||
|
console.log(err)
|
||||||
|
} finally {
|
||||||
|
zip.close()
|
||||||
|
self.emit('complete', 'java', JavaGuard.javaExecFromRoot(pos))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// _enqueueOracleJRE(dataDir){
|
// _enqueueOracleJRE(dataDir){
|
||||||
// return new Promise((resolve, reject) => {
|
// return new Promise((resolve, reject) => {
|
||||||
// JavaGuard._latestJREOracle().then(verData => {
|
// JavaGuard._latestJREOracle().then(verData => {
|
||||||
|
@ -9,7 +9,7 @@ const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.e
|
|||||||
const dataPath = path.join(sysRoot, '.helioslauncher')
|
const dataPath = path.join(sysRoot, '.helioslauncher')
|
||||||
|
|
||||||
// Forked processes do not have access to electron, so we have this workaround.
|
// Forked processes do not have access to electron, so we have this workaround.
|
||||||
const launcherDir = process.env.CONFIG_DIRECT_PATH || require('electron').remote.app.getPath('userData')
|
const launcherDir = process.env.CONFIG_DIRECT_PATH || require('@electron/remote').app.getPath('userData')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the absolute path of the launcher directory.
|
* Retrieve the absolute path of the launcher directory.
|
||||||
|
@ -92,14 +92,17 @@ exports.addDropinMods = function(files, modsdir) {
|
|||||||
* @param {string} modsDir The path to the mods directory.
|
* @param {string} modsDir The path to the mods directory.
|
||||||
* @param {string} fullName The fullName of the discovered mod to delete.
|
* @param {string} fullName The fullName of the discovered mod to delete.
|
||||||
*
|
*
|
||||||
* @returns {boolean} True if the mod was deleted, otherwise false.
|
* @returns {Promise.<boolean>} True if the mod was deleted, otherwise false.
|
||||||
*/
|
*/
|
||||||
exports.deleteDropinMod = function(modsDir, fullName){
|
exports.deleteDropinMod = async function(modsDir, fullName){
|
||||||
const res = shell.moveItemToTrash(path.join(modsDir, fullName))
|
try {
|
||||||
if(!res){
|
await shell.trashItem(path.join(modsDir, fullName))
|
||||||
|
return true
|
||||||
|
} catch(error) {
|
||||||
shell.beep()
|
shell.beep()
|
||||||
|
console.error('Error deleting drop-in mod.', error)
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,7 +130,7 @@ function updateSelectedAccount(authUser){
|
|||||||
username = authUser.displayName
|
username = authUser.displayName
|
||||||
}
|
}
|
||||||
if(authUser.uuid != null){
|
if(authUser.uuid != null){
|
||||||
document.getElementById('avatarContainer').style.backgroundImage = `url('https://crafatar.com/renders/body/${authUser.uuid}')`
|
document.getElementById('avatarContainer').style.backgroundImage = `url('https://mc-heads.net/body/${authUser.uuid}/right')`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
user_text.innerHTML = username
|
user_text.innerHTML = username
|
||||||
@ -327,7 +327,7 @@ function asyncSystemScan(mcVersion, launchAfter = true){
|
|||||||
// Show this information to the user.
|
// Show this information to the user.
|
||||||
setOverlayContent(
|
setOverlayContent(
|
||||||
'No Compatible<br>Java Installation Found',
|
'No Compatible<br>Java Installation Found',
|
||||||
'In order to join WesterosCraft, you need a 64-bit installation of Java 8. Would you like us to install a copy? By installing, you accept <a href="http://www.oracle.com/technetwork/java/javase/terms/license/index.html">Oracle\'s license agreement</a>.',
|
'In order to join WesterosCraft, you need a 64-bit installation of Java 8. Would you like us to install a copy?',
|
||||||
'Install Java',
|
'Install Java',
|
||||||
'Install Manually'
|
'Install Manually'
|
||||||
)
|
)
|
||||||
|
@ -299,7 +299,7 @@ function populateAccountListings(){
|
|||||||
let htmlString = ''
|
let htmlString = ''
|
||||||
for(let i=0; i<accounts.length; i++){
|
for(let i=0; i<accounts.length; i++){
|
||||||
htmlString += `<button class="accountListing" uuid="${accounts[i].uuid}" ${i===0 ? 'selected' : ''}>
|
htmlString += `<button class="accountListing" uuid="${accounts[i].uuid}" ${i===0 ? 'selected' : ''}>
|
||||||
<img src="https://crafatar.com/renders/head/${accounts[i].uuid}?scale=2&default=MHF_Steve&overlay">
|
<img src="https://mc-heads.net/head/${accounts[i].uuid}/40">
|
||||||
<div class="accountListingName">${accounts[i].displayName}</div>
|
<div class="accountListingName">${accounts[i].displayName}</div>
|
||||||
</button>`
|
</button>`
|
||||||
}
|
}
|
||||||
|
@ -444,7 +444,7 @@ function populateAuthAccounts(){
|
|||||||
const acc = authAccounts[val]
|
const acc = authAccounts[val]
|
||||||
authAccountStr += `<div class="settingsAuthAccount" uuid="${acc.uuid}">
|
authAccountStr += `<div class="settingsAuthAccount" uuid="${acc.uuid}">
|
||||||
<div class="settingsAuthAccountLeft">
|
<div class="settingsAuthAccountLeft">
|
||||||
<img class="settingsAuthAccountImage" alt="${acc.displayName}" src="https://crafatar.com/renders/body/${acc.uuid}?scale=3&default=MHF_Steve&overlay">
|
<img class="settingsAuthAccountImage" alt="${acc.displayName}" src="https://mc-heads.net/body/${acc.uuid}/60">
|
||||||
</div>
|
</div>
|
||||||
<div class="settingsAuthAccountRight">
|
<div class="settingsAuthAccountRight">
|
||||||
<div class="settingsAuthAccountDetails">
|
<div class="settingsAuthAccountDetails">
|
||||||
@ -687,9 +687,9 @@ function resolveDropinModsForUI(){
|
|||||||
function bindDropinModsRemoveButton(){
|
function bindDropinModsRemoveButton(){
|
||||||
const sEls = settingsModsContainer.querySelectorAll('[remmod]')
|
const sEls = settingsModsContainer.querySelectorAll('[remmod]')
|
||||||
Array.from(sEls).map((v, index, arr) => {
|
Array.from(sEls).map((v, index, arr) => {
|
||||||
v.onclick = () => {
|
v.onclick = async () => {
|
||||||
const fullName = v.getAttribute('remmod')
|
const fullName = v.getAttribute('remmod')
|
||||||
const res = DropinModUtil.deleteDropinMod(CACHE_SETTINGS_MODS_DIR, fullName)
|
const res = await DropinModUtil.deleteDropinMod(CACHE_SETTINGS_MODS_DIR, fullName)
|
||||||
if(res){
|
if(res){
|
||||||
document.getElementById(fullName).remove()
|
document.getElementById(fullName).remove()
|
||||||
} else {
|
} else {
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
// Requirements
|
// Requirements
|
||||||
const $ = require('jquery')
|
const $ = require('jquery')
|
||||||
const {ipcRenderer, remote, shell, webFrame} = require('electron')
|
const {ipcRenderer, shell, webFrame} = require('electron')
|
||||||
|
const remote = require('@electron/remote')
|
||||||
const isDev = require('./assets/js/isdev')
|
const isDev = require('./assets/js/isdev')
|
||||||
const LoggerUtil = require('./assets/js/loggerutil')
|
const LoggerUtil = require('./assets/js/loggerutil')
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ if(!isDev){
|
|||||||
loggerAutoUpdaterSuccess.log('New update available', info.version)
|
loggerAutoUpdaterSuccess.log('New update available', info.version)
|
||||||
|
|
||||||
if(process.platform === 'darwin'){
|
if(process.platform === 'darwin'){
|
||||||
info.darwindownload = `https://github.com/dscalzi/HeliosLauncher/releases/download/v${info.version}/helioslauncher-setup-${info.version}.dmg`
|
info.darwindownload = `https://github.com/dscalzi/HeliosLauncher/releases/download/v${info.version}/helioslauncher-setup-${info.version}${process.arch === 'arm64' ? '-arm64' : ''}.dmg`
|
||||||
showUpdateUI(info)
|
showUpdateUI(info)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="loginOptions">
|
<div id="loginOptions">
|
||||||
<span class="loginSpanDim">
|
<span class="loginSpanDim">
|
||||||
<a href="https://my.minecraft.net/en-us/password/forgot/">forgot password?</a>
|
<a href="https://minecraft.net/password/forgot/">forgot password?</a>
|
||||||
</span>
|
</span>
|
||||||
<label id="checkmarkContainer">
|
<label id="checkmarkContainer">
|
||||||
<input id="loginRememberOption" type="checkbox" checked>
|
<input id="loginRememberOption" type="checkbox" checked>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<div id="loginDisclaimer">
|
<div id="loginDisclaimer">
|
||||||
<span class="loginSpanDim" id="loginRegisterSpan">
|
<span class="loginSpanDim" id="loginRegisterSpan">
|
||||||
<a href="https://minecraft.net/en-us/store/minecraft/">Need an Account?</a>
|
<a href="https://minecraft.net/store/minecraft-java-edition/">Need an Account?</a>
|
||||||
</span>
|
</span>
|
||||||
<p class="loginDisclaimerText">Your password is sent directly to mojang and never stored.</p>
|
<p class="loginDisclaimerText">Your password is sent directly to mojang and never stored.</p>
|
||||||
<p class="loginDisclaimerText">Helios Launcher is not affiliated with Mojang AB.</p>
|
<p class="loginDisclaimerText">Helios Launcher is not affiliated with Mojang AB.</p>
|
||||||
|
68
build.js
68
build.js
@ -1,68 +0,0 @@
|
|||||||
const builder = require('electron-builder')
|
|
||||||
const Platform = builder.Platform
|
|
||||||
|
|
||||||
function getCurrentPlatform(){
|
|
||||||
switch(process.platform){
|
|
||||||
case 'win32':
|
|
||||||
return Platform.WINDOWS
|
|
||||||
case 'darwin':
|
|
||||||
return Platform.MAC
|
|
||||||
case 'linux':
|
|
||||||
return Platform.linux
|
|
||||||
default:
|
|
||||||
console.error('Cannot resolve current platform!')
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.build({
|
|
||||||
targets: (process.argv[2] != null && Platform[process.argv[2]] != null ? Platform[process.argv[2]] : getCurrentPlatform()).createTarget(),
|
|
||||||
config: {
|
|
||||||
appId: 'helioslauncher',
|
|
||||||
productName: 'Helios Launcher',
|
|
||||||
artifactName: '${productName}-setup-${version}.${ext}',
|
|
||||||
copyright: 'Copyright © 2018-2020 Daniel Scalzi',
|
|
||||||
directories: {
|
|
||||||
buildResources: 'build',
|
|
||||||
output: 'dist'
|
|
||||||
},
|
|
||||||
win: {
|
|
||||||
target: [
|
|
||||||
{
|
|
||||||
target: 'nsis',
|
|
||||||
arch: 'x64'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
nsis: {
|
|
||||||
oneClick: false,
|
|
||||||
perMachine: false,
|
|
||||||
allowElevation: true,
|
|
||||||
allowToChangeInstallationDirectory: true
|
|
||||||
},
|
|
||||||
mac: {
|
|
||||||
target: 'dmg',
|
|
||||||
category: 'public.app-category.games'
|
|
||||||
},
|
|
||||||
linux: {
|
|
||||||
target: 'AppImage',
|
|
||||||
maintainer: 'Daniel Scalzi',
|
|
||||||
vendor: 'Daniel Scalzi',
|
|
||||||
synopsis: 'Modded Minecraft Launcher',
|
|
||||||
description: 'Custom launcher which allows users to join modded servers. All mods, configurations, and updates are handled automatically.',
|
|
||||||
category: 'Game'
|
|
||||||
},
|
|
||||||
compression: 'maximum',
|
|
||||||
files: [
|
|
||||||
'!{dist,.gitignore,.vscode,docs,dev-app-update.yml,.travis.yml,.nvmrc,.eslintrc.json,build.js}'
|
|
||||||
],
|
|
||||||
extraResources: [
|
|
||||||
'libraries'
|
|
||||||
],
|
|
||||||
asar: true
|
|
||||||
}
|
|
||||||
}).then(() => {
|
|
||||||
console.log('Build complete!')
|
|
||||||
}).catch(err => {
|
|
||||||
console.error('Error during build!', err)
|
|
||||||
})
|
|
51
electron-builder.yml
Normal file
51
electron-builder.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
appId: 'helioslauncher'
|
||||||
|
productName: 'Helios Launcher'
|
||||||
|
artifactName: '${productName}-setup-${version}.${ext}'
|
||||||
|
|
||||||
|
copyright: 'Copyright © 2018-2021 Daniel Scalzi'
|
||||||
|
|
||||||
|
asar: true
|
||||||
|
compression: 'maximum'
|
||||||
|
|
||||||
|
files:
|
||||||
|
- '!{dist,.gitignore,.vscode,docs,dev-app-update.yml,.travis.yml,.nvmrc,.eslintrc.json,build.js}'
|
||||||
|
|
||||||
|
extraResources:
|
||||||
|
- 'libraries'
|
||||||
|
|
||||||
|
# Windows Configuration
|
||||||
|
win:
|
||||||
|
target:
|
||||||
|
- target: 'nsis'
|
||||||
|
arch: 'x64'
|
||||||
|
|
||||||
|
# Windows Installer Configuration
|
||||||
|
nsis:
|
||||||
|
oneClick: false
|
||||||
|
perMachine: false
|
||||||
|
allowElevation: true
|
||||||
|
allowToChangeInstallationDirectory: true
|
||||||
|
|
||||||
|
# macOS Configuration
|
||||||
|
mac:
|
||||||
|
target:
|
||||||
|
- target: 'dmg'
|
||||||
|
arch:
|
||||||
|
- 'x64'
|
||||||
|
- 'arm64'
|
||||||
|
artifactName: '${productName}-setup-${version}-${arch}.${ext}'
|
||||||
|
category: 'public.app-category.games'
|
||||||
|
|
||||||
|
# Linux Configuration
|
||||||
|
linux:
|
||||||
|
target: 'AppImage'
|
||||||
|
maintainer: 'Daniel Scalzi'
|
||||||
|
vendor: 'Daniel Scalzi'
|
||||||
|
synopsis: 'Modded Minecraft Launcher'
|
||||||
|
description: 'Custom launcher which allows users to join modded servers. All mods, configurations, and updates are handled automatically.'
|
||||||
|
category: 'Game'
|
||||||
|
|
||||||
|
|
||||||
|
directories:
|
||||||
|
buildResources: 'build'
|
||||||
|
output: 'dist'
|
19
index.js
19
index.js
@ -1,3 +1,6 @@
|
|||||||
|
const remoteMain = require('@electron/remote/main')
|
||||||
|
remoteMain.initialize()
|
||||||
|
|
||||||
// Requirements
|
// Requirements
|
||||||
const { app, BrowserWindow, ipcMain, Menu } = require('electron')
|
const { app, BrowserWindow, ipcMain, Menu } = require('electron')
|
||||||
const autoUpdater = require('electron-updater').autoUpdater
|
const autoUpdater = require('electron-updater').autoUpdater
|
||||||
@ -6,7 +9,7 @@ const fs = require('fs')
|
|||||||
const isDev = require('./app/assets/js/isdev')
|
const isDev = require('./app/assets/js/isdev')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const semver = require('semver')
|
const semver = require('semver')
|
||||||
const url = require('url')
|
const { pathToFileURL } = require('url')
|
||||||
|
|
||||||
// Setup auto updater.
|
// Setup auto updater.
|
||||||
function initAutoUpdater(event, data) {
|
function initAutoUpdater(event, data) {
|
||||||
@ -85,9 +88,6 @@ ipcMain.on('distributionIndexDone', (event, res) => {
|
|||||||
// https://electronjs.org/docs/tutorial/offscreen-rendering
|
// https://electronjs.org/docs/tutorial/offscreen-rendering
|
||||||
app.disableHardwareAcceleration()
|
app.disableHardwareAcceleration()
|
||||||
|
|
||||||
// https://github.com/electron/electron/issues/18397
|
|
||||||
app.allowRendererProcessReuse = true
|
|
||||||
|
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
// be closed automatically when the JavaScript object is garbage collected.
|
// be closed automatically when the JavaScript object is garbage collected.
|
||||||
let win
|
let win
|
||||||
@ -102,20 +102,15 @@ function createWindow() {
|
|||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.join(__dirname, 'app', 'assets', 'js', 'preloader.js'),
|
preload: path.join(__dirname, 'app', 'assets', 'js', 'preloader.js'),
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
contextIsolation: false,
|
contextIsolation: false
|
||||||
enableRemoteModule: true,
|
|
||||||
worldSafeExecuteJavaScript: true
|
|
||||||
},
|
},
|
||||||
backgroundColor: '#171614'
|
backgroundColor: '#171614'
|
||||||
})
|
})
|
||||||
|
remoteMain.enable(win.webContents)
|
||||||
|
|
||||||
ejse.data('bkid', Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)))
|
ejse.data('bkid', Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)))
|
||||||
|
|
||||||
win.loadURL(url.format({
|
win.loadURL(pathToFileURL(path.join(__dirname, 'app', 'app.ejs')).toString())
|
||||||
pathname: path.join(__dirname, 'app', 'app.ejs'),
|
|
||||||
protocol: 'file:',
|
|
||||||
slashes: true
|
|
||||||
}))
|
|
||||||
|
|
||||||
/*win.once('ready-to-show', () => {
|
/*win.once('ready-to-show', () => {
|
||||||
win.show()
|
win.show()
|
||||||
|
Binary file not shown.
1779
package-lock.json
generated
1779
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@ -13,37 +13,36 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
"cilinux": "node build.js WINDOWS && node build.js LINUX",
|
"dist": "electron-builder build",
|
||||||
"cidarwin": "node build.js MAC",
|
"dist:win": "npm run dist -- -w",
|
||||||
"dist": "cross-env ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true node build.js",
|
"dist:mac": "npm run dist -- -m",
|
||||||
"dist:win": "npm run dist -- WINDOWS",
|
"dist:linux": "npm run dist -- -l",
|
||||||
"dist:mac": "npm run dist -- MAC",
|
|
||||||
"dist:linux": "npm run dist -- LINUX",
|
|
||||||
"lint": "eslint --config .eslintrc.json ."
|
"lint": "eslint --config .eslintrc.json ."
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "12.x.x"
|
"node": "16.x.x"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"adm-zip": "^0.5.1",
|
"@electron/remote": "^2.0.1",
|
||||||
"async": "^3.2.0",
|
"adm-zip": "^0.5.9",
|
||||||
"discord-rpc": "^3.1.4",
|
"async": "^3.2.1",
|
||||||
"ejs": "^3.1.5",
|
"discord-rpc": "^3.2.0",
|
||||||
|
"ejs": "^3.1.6",
|
||||||
"ejs-electron": "^2.1.1",
|
"ejs-electron": "^2.1.1",
|
||||||
"electron-updater": "^4.3.5",
|
"electron-updater": "^4.3.9",
|
||||||
"fs-extra": "^9.0.1",
|
"fs-extra": "^10.0.0",
|
||||||
"github-syntax-dark": "^0.5.0",
|
"github-syntax-dark": "^0.5.0",
|
||||||
"jquery": "^3.5.1",
|
"jquery": "^3.6.0",
|
||||||
|
"node-stream-zip": "^1.15.0",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"semver": "^7.3.4",
|
"semver": "^7.3.5",
|
||||||
"tar-fs": "^2.1.1",
|
"tar-fs": "^2.1.1",
|
||||||
"winreg": "^1.2.4"
|
"winreg": "^1.2.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cross-env": "^7.0.3",
|
"electron": "^15.2.0",
|
||||||
"electron": "^11.0.5",
|
"electron-builder": "^22.13.1",
|
||||||
"electron-builder": "^22.9.1",
|
"eslint": "^8.0.1"
|
||||||
"eslint": "^7.15.0"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
Loading…
Reference in New Issue
Block a user