mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 05:46:17 +00:00
feat: adding commonredist
This commit is contained in:
@@ -23,6 +23,7 @@ win:
|
||||
extraResources:
|
||||
- from: binaries/7z.exe
|
||||
- from: binaries/7z.dll
|
||||
- from: resources/commonredist/**
|
||||
target:
|
||||
- nsis
|
||||
- portable
|
||||
|
||||
BIN
resources/commonredist/dotNetFx40_Full_setup.exe
Normal file
BIN
resources/commonredist/dotNetFx40_Full_setup.exe
Normal file
Binary file not shown.
BIN
resources/commonredist/dxwebsetup.exe
Normal file
BIN
resources/commonredist/dxwebsetup.exe
Normal file
Binary file not shown.
36
resources/commonredist/install.bat
Normal file
36
resources/commonredist/install.bat
Normal file
@@ -0,0 +1,36 @@
|
||||
@echo off
|
||||
:: Request admin privileges if not already elevated
|
||||
net session >nul 2>&1
|
||||
if %errorLevel% neq 0 (
|
||||
echo Requesting administrative privileges...
|
||||
powershell -Command "Start-Process '%~f0' -Verb RunAs"
|
||||
exit
|
||||
)
|
||||
|
||||
:: Change to the script’s directory
|
||||
cd /d "%~dp0"
|
||||
|
||||
echo Installing prerequisites silently...
|
||||
|
||||
:: Install .NET Framework 4.0
|
||||
if exist dotNetFx40_Full_setup.exe dotNetFx40_Full_setup.exe /q /norestart /log dotnet_install.log
|
||||
|
||||
:: Install DirectX
|
||||
if exist dxwebsetup.exe dxwebsetup.exe /Q
|
||||
|
||||
:: Install OpenAL
|
||||
if exist oalinst.exe oalinst.exe /silent
|
||||
|
||||
:: Install Visual C++ Redistributables (2015-2019)
|
||||
if exist vcredist_2015-2019_x64.exe vcredist_2015-2019_x64.exe /quiet /norestart
|
||||
if exist vcredist_2015-2019_x86.exe vcredist_2015-2019_x86.exe /quiet /norestart
|
||||
|
||||
:: Install older Visual C++ Redistributables
|
||||
if exist vcredist_x64.exe vcredist_x64.exe /quiet /norestart
|
||||
if exist vcredist_x86.exe vcredist_x86.exe /quiet /norestart
|
||||
|
||||
:: Install XNA Framework 4.0
|
||||
if exist xnafx40_redist.msi msiexec /i xnafx40_redist.msi /quiet /norestart
|
||||
|
||||
echo Installation complete!
|
||||
pause
|
||||
BIN
resources/commonredist/oalinst.exe
Normal file
BIN
resources/commonredist/oalinst.exe
Normal file
Binary file not shown.
BIN
resources/commonredist/vcredist_2015-2019_x64.exe
Normal file
BIN
resources/commonredist/vcredist_2015-2019_x64.exe
Normal file
Binary file not shown.
BIN
resources/commonredist/vcredist_2015-2019_x86.exe
Normal file
BIN
resources/commonredist/vcredist_2015-2019_x86.exe
Normal file
Binary file not shown.
BIN
resources/commonredist/vcredist_x64.exe
Normal file
BIN
resources/commonredist/vcredist_x64.exe
Normal file
Binary file not shown.
BIN
resources/commonredist/vcredist_x86.exe
Normal file
BIN
resources/commonredist/vcredist_x86.exe
Normal file
Binary file not shown.
BIN
resources/commonredist/xnafx40_redist.msi
Normal file
BIN
resources/commonredist/xnafx40_redist.msi
Normal file
Binary file not shown.
@@ -39,6 +39,7 @@ import "./misc/show-open-dialog";
|
||||
import "./misc/get-features";
|
||||
import "./misc/show-item-in-folder";
|
||||
import "./misc/get-badges";
|
||||
import "./misc/install-commonredist";
|
||||
import "./torrenting/cancel-game-download";
|
||||
import "./torrenting/pause-game-download";
|
||||
import "./torrenting/resume-game-download";
|
||||
|
||||
26
src/main/events/misc/install-commonredist.ts
Normal file
26
src/main/events/misc/install-commonredist.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { app } from "electron";
|
||||
import path from "node:path";
|
||||
import cp from "node:child_process";
|
||||
import { registerEvent } from "../register-event";
|
||||
import { logger } from "@main/services";
|
||||
|
||||
const installScriptPath = app.isPackaged
|
||||
? path.join(process.resourcesPath, "commonredist", "install.bat")
|
||||
: path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
"..",
|
||||
"resources",
|
||||
"commonredist",
|
||||
"install.bat"
|
||||
);
|
||||
|
||||
const installCommonRedist = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||
cp.execFile(installScriptPath, (error) => {
|
||||
if (error) {
|
||||
logger.error(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
registerEvent("installCommonRedist", installCommonRedist);
|
||||
@@ -295,6 +295,7 @@ contextBridge.exposeInMainWorld("electron", {
|
||||
ipcRenderer.invoke("showItemInFolder", path),
|
||||
getFeatures: () => ipcRenderer.invoke("getFeatures"),
|
||||
getBadges: () => ipcRenderer.invoke("getBadges"),
|
||||
installCommonRedist: () => ipcRenderer.invoke("installCommonRedist"),
|
||||
platform: process.platform,
|
||||
|
||||
/* Auto update */
|
||||
|
||||
1
src/renderer/src/declaration.d.ts
vendored
1
src/renderer/src/declaration.d.ts
vendored
@@ -234,6 +234,7 @@ declare global {
|
||||
showItemInFolder: (path: string) => Promise<void>;
|
||||
getFeatures: () => Promise<string[]>;
|
||||
getBadges: () => Promise<Badge[]>;
|
||||
installCommonRedist: () => Promise<void>;
|
||||
platform: NodeJS.Platform;
|
||||
|
||||
/* Auto update */
|
||||
|
||||
@@ -185,6 +185,10 @@ export function SettingsGeneral() {
|
||||
})
|
||||
}
|
||||
/>
|
||||
|
||||
<Button onClick={() => window.electron.installCommonRedist()}>
|
||||
{t("install_common_redist")}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user