Skip to content

Commit

Permalink
Merge pull request #10 from lu2000luk/main
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
lu2000luk authored Apr 22, 2024
2 parents 7b9ccf1 + 7658f54 commit c248338
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 69 deletions.
22 changes: 0 additions & 22 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tauri-build = { version = "1.5.1", features = [] }
serde_json = "1.0"
winreg = "0.52"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.6.1", features = [ "http-all", "shell-all", "dialog-all", "fs-all"] }
tauri = { version = "1.6.1", features = [ "shell-open", "path-all", "http-all", "devtools", "dialog-all", "fs-all"] }
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1.25", features = ["full"] }

Expand Down
Binary file added src-tauri/icons/128128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src-tauri/icons/128x128.png
Binary file not shown.
Binary file removed src-tauri/icons/[email protected]
Binary file not shown.
Binary file modified src-tauri/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src-tauri/icons/Square107x107Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square142x142Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square150x150Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square284x284Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square30x30Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square310x310Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square44x44Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square71x71Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/Square89x89Logo.png
Binary file not shown.
Binary file removed src-tauri/icons/StoreLogo.png
Binary file not shown.
Binary file modified src-tauri/icons/icon.ico
Binary file not shown.
Binary file modified src-tauri/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 10 additions & 6 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"distDir": "../build"
},
"package": {
"productName": "etbrocket",
"version": "0.1.0"
"productName": "ETB Rocket",
"version": "0.8.8"
},
"tauri": {
"allowlist": {
Expand All @@ -18,15 +18,18 @@
},
"fs": {
"all": true,
"scope": ["**", "**/*", "/**/*"]
"scope": ["**", "**/*", "/**/*","$RESOURCE/*"]
},
"shell": {
"all": true
"open": true
},
"http": {
"all": true,
"request": true,
"scope": ["https://*", "http://*"]
},
"path": {
"all": true
}
},

Expand All @@ -41,7 +44,6 @@
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
Expand All @@ -54,7 +56,9 @@
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"resources": [
"resources/*"
],
"shortDescription": "",
"targets": "all",
"windows": {
Expand Down
55 changes: 15 additions & 40 deletions src/lib/components/loadercard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import { steamPath } from "$lib/settings";
import { writeBinaryFile, BaseDirectory, createDir } from '@tauri-apps/api/fs';
import { writeBinaryFile, copyFile, createDir } from '@tauri-apps/api/fs';
import { resolveResource } from '@tauri-apps/api/path'
import { getClient, ResponseType } from '@tauri-apps/api/http';
import { invoke } from "@tauri-apps/api"
Expand Down Expand Up @@ -39,6 +40,7 @@
installed = true;
} catch (e) {
console.error(e);
alert(e)
loading = "error";
}
}
Expand All @@ -52,7 +54,6 @@
let installed = false;
async function installUE4SS() {
const httpclient = await getClient();
const steam_game_loc = $steamPath+"/steamapps/common/EscapeTheBackrooms"
const basePath = steam_game_loc + "/EscapeTheBackrooms/Binaries/Win64/"
Expand All @@ -61,47 +62,21 @@
try {await createDir(basePath+"Mods")} catch {console.log("No directory was created!")}
const DLL = await httpclient.get(location.origin+"/UE4SS.dll", {
responseType: ResponseType.Binary
});
const DLLpath = await resolveResource('resources/UE4SS.dll')
const INIpath = await resolveResource('resources/UE4SS-settings.ini')
const DWMpath = await resolveResource('resources/dwmapi.dll')
const MODSpath = await resolveResource('resources/mods.txt')
console.log("DLL downloaded!")
const INI = await httpclient.get(location.origin+"/UE4SS-settings.ini", {
responseType: ResponseType.Binary
});
console.log("INI downloaded!")
const DWM = await httpclient.get(location.origin+"/dwmapi.dll", {
responseType: ResponseType.Binary
});
console.log("DWM downloaded!")
const MODS = await httpclient.get(location.origin+"/mods.txt", {
responseType: ResponseType.Binary
});
console.log("MODS downloaded!")
console.log("Paths resolved")
invoke("expand_scope", { folderPath: basePath+"Mods" })
await writeBinaryFile(basePath+"/UE4SS.dll", new Uint8Array(DLL.data));
console.log("DLL saved!")
await writeBinaryFile(basePath+"/UE4SS-settings.ini", new Uint8Array(INI.data));
console.log("INI saved!")
await writeBinaryFile(basePath+"/dwmapi.dll", new Uint8Array(DWM.data));
console.log("DWM saved!")
await writeBinaryFile(basePath+"Mods"+"/mods.txt", new Uint8Array(MODS.data));
await copyFile(DLLpath, basePath+"UE4SS.dll");
await copyFile(INIpath, basePath+"UE4SS-settings.ini");
await copyFile(DWMpath, basePath+"dwmapi.dll");
await copyFile(MODSpath, basePath+"Mods"+"/mods.txt");
console.log("MODS saved!")
console.log("Files copied")
alert("UE4SS installed!");
}
Expand All @@ -123,11 +98,11 @@
<Loading /> Installing...
</Button>
{:else if loading === "error"}
<Button click={() => {loading = true; installLoader()}} bg="error" >
<Button click={() => {installLoader()}} bg="error" >
<Error size={20} class="pr-1" /> Error
</Button>
{:else}
<Button click={() => {loading = true; installLoader()}} >
<Button click={() => {installLoader()}} >
<Download size={20} class="pr-1" /> Download
</Button>
{/if}
Expand Down
Binary file modified static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c248338

Please sign in to comment.