7 Commits

Author SHA1 Message Date
Maarten van Heusden
efd2b31b4a feat: add readme 2024-01-22 19:11:59 +01:00
Maarten van Heusden
2f78f34e56 feat: finalize steam deck support 2024-01-22 19:03:15 +01:00
Maarten van Heusden
0d821c049c Merge branch 'master' into steamdeck-dotnet 2024-01-22 17:38:10 +01:00
Maarten
c8bbf72453 Merge branch 'master' into steamdeck-dotnet 2024-01-22 10:40:01 +01:00
Maarten
4e8e0b9048 feat: finish local dotnet support + downloader 2024-01-22 10:34:16 +01:00
Maarten
19e3c9dec2 refactor: refactor download utility 2023-12-26 18:45:06 +01:00
Maarten van Heusden
9db1769df2 feat(unfinished): add experimental steamdeck .net downloader 2023-12-26 13:10:26 +01:00
5 changed files with 123 additions and 142 deletions

114
README.md
View File

@@ -1,107 +1,13 @@
# SteamDepotDownloaderGUI for steam-deck
<h1 align="center">SteamDepotDownloaderGUI
**This branch houses the Steam Deck-compatible version of SteamDepotDownloaderGUI**
Code is pretty messy, but it (should) work.
<h4 align="center">A graphical wrapper for DepotDownloader, designed to make downloading older versions of Steam games easy. built using <a href="https://www.electronjs.org" target="_blank">Electron</a>.
<br><br>
<a href="https://www.youtube.com/watch?v=H2COwT5OUOo" target="_blank"><b>Tutorial</b></a> ~
<a href="https://www.youtube.com/watch?v=ogiDAuH3VdY" target="_blank"><b>Subnautica</b></a>
</h4>
<hr>
<p align="center"><a href="https://github.com/mmvanheusden/SteamDepotDownloaderGUI/releases/latest"><img src="https://img.shields.io/github/downloads/mmvanheusden/SteamDepotDownloaderGUI/total?color=orange&label=downloads" alt="Download count badge"></a><a href="https://img.shields.io/github/last-commit/mmvanheusden/SteamDepotDownloaderGUI?color=crimson"><img src="https://img.shields.io/github/last-commit/mmvanheusden/SteamDepotDownloaderGUI?color=crimson" alt="Last contribution badge"></a><a href="https://github.com/mmvanheusden/SteamDepotDownloaderGUI/releases/latest"><img src="https://img.shields.io/badge/Download -ffbd03?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAABd0lEQVRoge2XwUrDQBCGPz3Ee++2UBSvdsGbeLHeFX0lPQhei+8g2AfwSVREK+LJ1oqHUGjRQ7Z0laRJNtldKPPBwoTM7D9/sks2IAiCsKrsAK/AC7DtSmTd1cTAKbAJtIAzVyIuDURGvOFKxKUBL4iB0IiB0IiB0IiB0IiB0IiB0IiB0IgBoA08Ak+AKpCvdO6AGn416zBwDGyRGLljuQmlc9pAEzipKl6HgVtgpOMGSYOdlLyOvtfQ1yPgpgb9WlDAEPjRYwj0jet+yv0iy80ru8AHiyazxiewF6jHXPJMeG3+CoiBy5J1/5dTlWVzAXwD5yXrAJho4YlFbdqesFnzsa6PLWr/PD0bFPAA3GO/YXN7WMspLpLnktweVvooMTPiKDPLHabmLCtpmYF3I96v3E55Doz4zWaCaxYb6Bno4udNRMCR1pzr92wmagFfZH+UfI0xycHPim5gE2Pg0Lb5OU2SVzgAph6anmqtHhWevCAIgh9+AdLMtu/CZhHJAAAAAElFTkSuQmCC" alt="Download latest release badge"></a><a href="https://img.shields.io/endpoint?url=https%3A%2F%2Fhits.dwyl.com%2Fmmvanheusden%2Fsteamdepotdownloadergui.json&color=lightblue"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fhits.dwyl.com%2Fmmvanheusden%2Fsteamdepotdownloadergui.json&color=lightblue" alt="Visitor count badge"></a><a href="https://liberapay.com/barbapapa"><img src="https://img.shields.io/badge/Donate-black?logo=liberapay" alt="Donation badge"></a><a href="https://www.codefactor.io/repository/github/mmvanheusden/steamdepotdownloadergui/badge/master"><img src="https://www.codefactor.io/repository/github/mmvanheusden/steamdepotdownloadergui/badge/master" alt="CodeFactor badge"></a></p>
<p align="center">
<img alt="Screenshot of the downloader interface" src="screenshot.png"
style="max-width: 60%;"/>
</p>
## Features
* **Cross platform**
- Windows
- <s>macOS</s> (in development™)
- Linux
* **Cross terminal**
- Gnome Terminal
- Konsole
- xfce4-terminal
- Terminator
- Terminology
- xterm
- Kitty
- LXTerminal
- Tilix
- Deepin Terminal
- cool-retro-term
- Manual: produce a script that can be copy pasted into a terminal of choice
* **Support for anonymous downloads**
## Download
### Windows:
* If you haven't already, install [.NET SDK 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) on your computer.
Then, download the [latest Windows build](https://github.com/mmvanheusden/SteamDepotDownloaderGUI/releases/latest)
### **Linux:**
#### Arch Linux:
* An official [AUR package](https://aur.archlinux.org/packages/steamdepotdownloadergui-appimage) has been made. this can be installed using `yay -S steamdepotdownloadergui-appimage`.
#### Other Linux distros:
* **You'll need `unzip`, .NET SDK 6.0.**
* **Ubuntu:**
`sudo apt install unzip dotnet-sdk-6.0`
* **Fedora:**
`sudo dnf install unzip dotnet-sdk-6.0`
* There are several options, AppImage, and a `.zip`, for both x64 and arm64.
[Download latest release](https://github.com/mmvanheusden/SteamDepotDownloaderGUI/releases/latest)
## How to use
#### Tutorials:
* https://www.youtube.com/watch?v=H2COwT5OUOo How to download older versions of Steam games. rollback steam games tutorial
* https://www.youtube.com/watch?v=ogiDAuH3VdY How to download older versions of Subnautica tutorial
---
**Enter everything you normally would in the DepotDownloader console and select your OS/terminal and click download**
## Credits
This software makes use of the following projects:
- [**DepotDownloader**](https://github.com/SteamRE/DepotDownloader/)
- [Electron](https://www.electronjs.org/)
- [Node.js](https://nodejs.org/)
- [Primer CSS](https://primer.style/css/)
- [follow-redirects](https://github.com/follow-redirects/follow-redirects)
- [Hubut Sans](https://github.com/github/hubot-sans) under [license](https://github.com/github/hubot-sans/blob/05d5ea150c20e6434485db8ffd2277ed18a9e911/LICENSE)
## Donate
Donations can be made through Liberapay :)
<a href="https://liberapay.com/barbapapa">
<img src="https://img.shields.io/badge/Donate-black?logo=liberapay&style=for-the-badge"
alt="Donation badge">
</a>
## On Electron
Computer resources are not an all-you-can-eat buffet. The executables weigh on average 103 MB.
That's why in the future, this project is fully switching to a [different](https://tauri.app/) (multi-platform) toolset. Nothing will change for the user.
## Contribute
If you would like to contribute to SteamDepotDownloaderGUI, please make sure to follow
the [contributing instructions and guidelines](contributing.md).
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to keep code clean and cross-platform compatible.
![forthebadge](https://forthebadge.com/images/featured/featured-built-with-love.svg)
1. To use, download the build from [**Here**]()
and run it.
2. Now open the file and click on the gear icon.
3. Click "Auto Download .NET" and wait for it to finish.
4. Should be good to go!
**If any issues arise, please join the [support Discord](discord.com/invite/3qCt4DT5qe) and ask there. **

View File

@@ -11,7 +11,8 @@ const {
forceTerminals,
generateRunScript,
createCommandWithTerminal,
platformpath
platformpath,
findDotnet
} = require("./utils")
const electron = require("electron")
const {sep} = require("path")
@@ -32,7 +33,7 @@ function submitForm() {
document.getElementById("dotnetwarning").hidden = true
document.getElementById("dotnetwarning2").hidden = true
document.getElementById("emptywarning").hidden = true
console.info("dotnet found in PATH")
console.info("dotnet is installed and the form is filled in. 🙌")
// create variables for the form values
const username = document.getElementById("username").value
const password = document.getElementById("password").value
@@ -126,19 +127,19 @@ function openRelevantPage(target) {
}
break
case "issues":
console.debug("Opened GitHub issues page")
console.debug("Opened GitHub issues page 🐞")
void electron.shell.openExternal("https://github.com/mmvanheusden/SteamDepotDownloaderGUI/issues/new")
break
case "steamdb":
console.debug("Opened SteamDB instant search page")
console.debug("Opened SteamDB instant search page 🔍")
void electron.shell.openExternal("https://steamdb.info/instantsearch/")
break
case "donate":
console.debug("Opened donation page")
console.debug("Opened donation page 💰")
void electron.shell.openExternal("https://liberapay.com/barbapapa/")
break
case "instructions":
console.debug("Opened instructions page")
console.debug("Opened instructions page 📚")
void electron.shell.openExternal("https://github.com/mmvanheusden/SteamDepotDownloaderGUI/#how-to-use")
break
default:
@@ -163,6 +164,7 @@ function fillDefaultValues() {
// [0]: Windows, [1]: macOS [2]: Linux [3]: manual
if (process.platform.toString().includes("linux")) {
document.getElementById("default-os").innerText = "Linux"
document.getElementById("down-dotnet").ariaDisabled = "false"
} else if (process.platform.toString().includes("win")) {
document.getElementById("default-os").innerText = "Windows"
} else if (process.platform.toString().includes("darwin")) {
@@ -257,6 +259,15 @@ ipcRenderer.on("ready", async () => {
console.log("No terminals found in PATH. Continuing with default values") // when no terminals are found on the system, or when linux is not used.
}
await findDotnet().then(() => {
console.log("dotnet found in PATH/local directory!")
document.getElementById("dotnet-found").innerText = "Yes"
}).catch((error) => {
console.log(error)
console.log("dotnet not found in PATH!")
document.getElementById("dotnet-found").innerText = "No"
})
await toggleFormAccessibility(false) //enable the form again
await validateChoice() // updates the 'enabled/disabled' html value of the terminal dropdown.
@@ -278,8 +289,22 @@ platformpath(): ${platformpath()}
ready = false
})
async function downloadDotnetAuto() {
document.getElementById("down-dotnet").ariaDisabled = "true"
await download("https://download.visualstudio.microsoft.com/download/pr/5226a5fa-8c0b-474f-b79a-8984ad7c5beb/3113ccbf789c9fd29972835f0f334b7a/dotnet-sdk-8.0.100-linux-x64.tar.gz")
console.log("Finished downloading dotnet tarball")
await runCommand(`mkdir -p ${platformpath()}/dotnet`)
await runCommand(`tar -xvf ${platformpath()}/dotnet-sdk-8.0.100-linux-x64.tar.gz -C dotnet`)
console.log("Finished extracting dotnet tarball")
await findDotnet() // to make it use the newly downloaded dotnet
document.getElementById("down-dotnet").ariaDisabled = "false" // so the button can be pressed again for whatever reason
}
// Add event listeners to the buttons
window.addEventListener("DOMContentLoaded", () => {
document.getElementById("down-dotnet").addEventListener("click", () => {
if (document.getElementById("down-dotnet").ariaDisabled === "false") downloadDotnetAuto()
})
document.getElementById("dotnetalertbtn").addEventListener("click", () => openRelevantPage("dotnet"))
document.getElementById("smbtn1").addEventListener("click", () => openRelevantPage("issues"))
document.getElementById("smbtn2").addEventListener("click", () => openRelevantPage("steamdb"))

View File

@@ -175,7 +175,7 @@
</div>
</div>
<div class="settings-surrounding" id="settings-surrounding">
<div class="settings-content mx-auto" id="settings-content">
<div class="settings-content" id="settings-content">
<label class="version-info" id="version-info">UNKNOWN</label>
<h3><b>Settings</b></h3>
<hr>
@@ -263,6 +263,20 @@
type="text"/>
</div>
</div>
<hr>
<h4><b>Experimental settings</b></h4>
<div class="form-group">
<div class="form-group-header">
<label for="os-dropdown">Automatically download dotnet binary</label><br>Linux only. Works for Steam Deck<br>system-wide dotnet has priority over local dotnet.
</div>
<div class="form-group-body" >
<div aria-disabled="true" class="btn" type="button" id="down-dotnet">
Auto Download .NET
</div>
Found: <span class="Counter"><code id="dotnet-found" >none</code></span>
</div>
</div>
</form>
</div>
</div>

View File

@@ -14,7 +14,7 @@
/* The grey part */
.settings-surrounding {
display: none;
display: block;
position: fixed;
z-index: 1;
left: 0;
@@ -31,19 +31,28 @@
overflow: auto;
/*noinspection CssUnresolvedCustomProperty*/
background-color: var(--bgColor-default, var(--color-canvas-default));
margin: 5%;
padding: 25px;
margin-top: 5px;
margin-left: auto;
margin-right: auto;
padding: 13px 20px 13px;
border: 1px solid #b4dede;
width: 90vw; /* 90vw -> 90% */
height: 90vh; /* 90vh -> 90% */
height: 97vh; /* 90vh -> 90% */
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 20px rgba(0, 0, 0, 0.1);
}
/* Hide the stupid scrollbar */
.settings-content::-webkit-scrollbar {
display: none;
}
.hide {
display: none;
}
hr {
margin-top: 6px;
margin-bottom: 6px;
border: 0;
height: 1px;
background: #0d1117 linear-gradient(to right, #0d1117, #ccc, #0d1117);

View File

@@ -1,4 +1,5 @@
var defaultTerminal = ""
let dotnetPath = ""
/**
* Checks if all required fields are filled and if dotnet is installed in the system path.
@@ -11,6 +12,7 @@ var defaultTerminal = ""
* `noDotnet` -> `dotnet` has not been found in the path.
*/
function preDownloadCheck() {
const {exec} = require("child_process")
return new Promise((resolve, reject) => {
// Check if all fields are filled
const formInputs = document.forms["theform"]
@@ -27,30 +29,16 @@ function preDownloadCheck() {
}
// Check if dotnet is found, depending on the platform
if (process.platform.toString().includes("win")) {
// Windows
const {exec} = require("child_process")
const command = "dotnet.exe --version"
exec(command, function (error) {
if (error) {
reject("noDotnet")
} else {
resolve(true)
}
})
} else {
// Others
// macOS seems to be broken.
const {exec} = require("child_process")
const command = "dotnet --version"
exec(command, function (error) {
if (error) {
reject("noDotnet")
} else {
resolve(true)
}
})
}
// uses dotnetPath, which was populated by findDotnet().
// dotnet / dotnet.exe -> installed in system path
// ./dotnet/dotnet -> installed in local path. (for steam deck)
exec(`${dotnetPath} --version`, function (error) {
if (error) {
reject("noDotnet")
} else {
resolve(true)
}
})
})
}
@@ -279,13 +267,13 @@ async function generateRunScript(username, password, appid, depotid, manifestid,
if (process.platform.includes("linux")) {
// if linux, write a bash script.
let content = `#!/usr/bin/env bash
dotnet ${platformpath().replaceAll(" ", "\\ ")}${sep}depotdownloader${sep}DepotDownloader.dll ${userpass} -app ${appid} -depot ${depotid} -manifest ${manifestid} -dir ${finalPath}${sep} -max-servers 50 -max-downloads 16
${dotnetPath} ${platformpath().replaceAll(" ", "\\ ")}${sep}depotdownloader${sep}DepotDownloader.dll ${userpass} -app ${appid} -depot ${depotid} -manifest ${manifestid} -dir ${finalPath}${sep} -max-servers 50 -max-downloads 16
`
await fs.writeFileSync(`${platformpath()}${sep}run.sh`, content)
await fs.chmodSync(`${platformpath()}${sep}run.sh`, "755") // make it executable
console.log(`Writing:
--------
dotnet ${platformpath().replaceAll(" ", "\\ ")}${sep}depotdownloader${sep}DepotDownloader.dll ${userpass} -app ${appid} -depot ${depotid} -manifest ${manifestid} -dir ${finalPath}${sep} -max-servers 50 -max-downloads 16
${dotnetPath} ${platformpath().replaceAll(" ", "\\ ")}${sep}depotdownloader${sep}DepotDownloader.dll ${userpass} -app ${appid} -depot ${depotid} -manifest ${manifestid} -dir ${finalPath}${sep} -max-servers 50 -max-downloads 16
to ${platformpath()}${sep}run.sh.
`)
@@ -377,6 +365,44 @@ const forceTerminals = async () => {
} else return false
}
// checks if dotnet is found in either system path, or for linux in local path. (for steam deck)
function findDotnet() {
const {exec} = require("child_process")
const {existsSync} = require("fs")
return new Promise((resolve, reject) => {
let command
if (process.platform.toString().includes("win")) {
command = "dotnet.exe"
} else {
command = "dotnet"
}
exec(`${command} --version`, (error) => {
console.log(error)
if (error !== null) { // if there was an error
if (process.platform.toString().includes("linux")) console.log("Dotnet not found in system, trying to detect local dotnet installation..")
if (process.platform.toString().includes("linux") && existsSync(`${platformpath()}/dotnet/dotnet`)) {
exec(`${platformpath()}/dotnet/dotnet --version`, (error) => {
if (error !== null) { // if there was an error
console.log("no dotnet found at all 🙀")
reject("noDotnet")
} else { // if there was no error
dotnetPath = `${platformpath()}/dotnet/dotnet`
console.log("Local dotnet installation found. path: " + dotnetPath)
resolve(true)
}
})
} else {
console.log("no dotnet found at all")
reject("noDotnet")
}
} else {
dotnetPath = command
resolve(true)
}
})
})
}
module.exports = {
preDownloadCheck,
download,
@@ -387,5 +413,6 @@ module.exports = {
platformpath,
forceTerminals,
generateRunScript,
createCommandWithTerminal
createCommandWithTerminal,
findDotnet
}