Skip to content

Commit c8aa9fd

Browse files
author
Chubby Granny Chaser
committed
Merge branch 'main' of github.com:hydralauncher/hydra
2 parents 0f12dfa + be48306 commit c8aa9fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+681
-495
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.vscode
22
node_modules
33
hydra-download-manager/
4+
aria2/
45
fastlist.exe
56
__pycache__
67
dist

electron-builder.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ productName: Hydra
33
directories:
44
buildResources: build
55
extraResources:
6+
- aria2
67
- hydra-download-manager
78
- seeds
8-
- from: node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe
9-
to: fastlist.exe
109
- from: node_modules/create-desktop-shortcuts/src/windows.vbs
11-
- from: resources/hydralauncher.vbs
1210
files:
1311
- "!**/.vscode/*"
1412
- "!src/*"
@@ -20,7 +18,6 @@ asarUnpack:
2018
- resources/**
2119
win:
2220
executableName: Hydra
23-
requestedExecutionLevel: requireAdministrator
2421
target:
2522
- nsis
2623
- portable
@@ -33,7 +30,6 @@ nsis:
3330
allowToChangeInstallationDirectory: true
3431
portable:
3532
artifactName: ${name}-${version}-portable.${ext}
36-
requestExecutionLevel: admin
3733
mac:
3834
entitlementsInherit: build/entitlements.mac.plist
3935
extendInfo:

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"start": "electron-vite preview",
2424
"dev": "electron-vite dev",
2525
"build": "npm run typecheck && electron-vite build",
26-
"postinstall": "electron-builder install-app-deps",
26+
"postinstall": "electron-builder install-app-deps && node ./postinstall.cjs",
2727
"build:unpack": "npm run build && electron-builder --dir",
2828
"build:win": "electron-vite build && electron-builder --win",
2929
"build:mac": "electron-vite build && electron-builder --mac",
@@ -41,6 +41,7 @@
4141
"@sentry/electron": "^5.1.0",
4242
"@vanilla-extract/css": "^1.14.2",
4343
"@vanilla-extract/recipes": "^0.5.2",
44+
"aria2": "^4.1.2",
4445
"auto-launch": "^5.0.6",
4546
"axios": "^1.6.8",
4647
"better-sqlite3": "^9.5.0",
@@ -65,11 +66,11 @@
6566
"lottie-react": "^2.4.0",
6667
"parse-torrent": "^11.0.16",
6768
"piscina": "^4.5.1",
68-
"ps-list": "^8.1.1",
6969
"react-i18next": "^14.1.0",
7070
"react-loading-skeleton": "^3.4.0",
7171
"react-redux": "^9.1.1",
7272
"react-router-dom": "^6.22.3",
73+
"sudo-prompt": "^9.2.1",
7374
"typeorm": "^0.3.20",
7475
"user-agents": "^1.1.193",
7576
"yaml": "^2.4.1",

postinstall.cjs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
const { default: axios } = require("axios");
2+
const util = require("node:util");
3+
const fs = require("node:fs");
4+
5+
const exec = util.promisify(require("node:child_process").exec);
6+
7+
const downloadAria2 = async () => {
8+
if (fs.existsSync("aria2")) {
9+
console.log("Aria2 already exists, skipping download...");
10+
return;
11+
}
12+
13+
const file =
14+
process.platform === "win32"
15+
? "aria2-1.37.0-win-64bit-build1.zip"
16+
: "aria2-1.37.0-1-x86_64.pkg.tar.zst";
17+
18+
const downloadUrl =
19+
process.platform === "win32"
20+
? `https://github.com/aria2/aria2/releases/download/release-1.37.0/${file}`
21+
: "https://archlinux.org/packages/extra/x86_64/aria2/download/";
22+
23+
console.log(`Downloading ${file}...`);
24+
25+
const response = await axios.get(downloadUrl, { responseType: "stream" });
26+
27+
const stream = response.data.pipe(fs.createWriteStream(file));
28+
29+
stream.on("finish", async () => {
30+
console.log(`Downloaded ${file}, extracting...`);
31+
32+
if (process.platform === "win32") {
33+
await exec(`npx extract-zip ${file}`);
34+
console.log("Extracted. Renaming folder...");
35+
36+
fs.renameSync(file.replace(".zip", ""), "aria2");
37+
} else {
38+
await exec(`tar --zstd -xvf ${file} usr/bin/aria2c`);
39+
console.log("Extracted. Copying binary file...");
40+
fs.mkdirSync("aria2");
41+
fs.copyFileSync("usr/bin/aria2c", "aria2/aria2c");
42+
fs.rmSync("usr", { recursive: true });
43+
}
44+
45+
console.log(`Extracted ${file}, removing compressed downloaded file...`);
46+
fs.rmSync(file);
47+
});
48+
};
49+
50+
downloadAria2();

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ cx_Freeze
33
cx_Logging; sys_platform == 'win32'
44
lief; sys_platform == 'win32'
55
pywin32; sys_platform == 'win32'
6+
psutil

resources/hydralauncher.vbs

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/locales/en/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@
199199
"game_ready_to_install": "{{title}} is ready to install",
200200
"repack_list_updated": "Repack list updated",
201201
"repack_count_one": "{{count}} repack added",
202-
"repack_count_other": "{{count}} repacks added"
202+
"repack_count_other": "{{count}} repacks added",
203+
"new_update_available": "Version {{version}} available",
204+
"restart_to_install_update": "Restart Hydra to install the update"
203205
},
204206
"system_tray": {
205207
"open": "Open Hydra",

src/locales/es/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@
199199
"game_ready_to_install": "{{title}} está listo para instalarse",
200200
"repack_list_updated": "Lista de repacks actualizadas",
201201
"repack_count_one": "{{count}} repack ha sido añadido",
202-
"repack_count_other": "{{count}} repacks añadidos"
202+
"repack_count_other": "{{count}} repacks añadidos",
203+
"new_update_available": "Version {{version}} disponible"
203204
},
204205
"system_tray": {
205206
"open": "Abrir Hydra",

src/locales/pt/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@
195195
"game_ready_to_install": "{{title}} está pronto para ser instalado",
196196
"repack_list_updated": "Lista de repacks atualizada",
197197
"repack_count_one": "{{count}} novo repack",
198-
"repack_count_other": "{{count}} novos repacks"
198+
"repack_count_other": "{{count}} novos repacks",
199+
"new_update_available": "Versão {{version}} disponível",
200+
"restart_to_install_update": "Reinicie o Hydra para instalar a nova versão"
199201
},
200202
"system_tray": {
201203
"open": "Abrir Hydra",

src/locales/ru/translation.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@
197197
"game_ready_to_install": "{{title}} готова к установке",
198198
"repack_list_updated": "Список репаков обновлен",
199199
"repack_count_one": "{{count}} репак добавлен",
200-
"repack_count_other": "{{count}} репаков добавлено"
200+
"repack_count_other": "{{count}} репаков добавлено",
201+
"new_update_available": "Доступна версия {{version}}"
201202
},
202203
"system_tray": {
203204
"open": "Открыть Hydra",

0 commit comments

Comments
 (0)