Skip to content

Commit

Permalink
Fixed uninstall dialog not closing when finished and app not removed …
Browse files Browse the repository at this point in the history
…from the list
  • Loading branch information
Yaniv committed Dec 3, 2023
1 parent 5a03d5c commit 6ec2a05
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ const dependencies = {
"win32": [
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/adb/win32/adb.exe",
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/adb/win32/AdbWinApi.dll",
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/adb/win32/AdbWinUsbApi.dll"
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/adb/win32/AdbWinUsbApi.dll",
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/7zip/win32/7za.exe",
],
"linux": [
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/adb/linux/adb"
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/adb/linux/adb",
"https://raw.githubusercontent.com/trueicecold/quest-side-loader/main/client/tools/7zip/linux/7za",
]
};

Expand Down
11 changes: 10 additions & 1 deletion client/libs/adb.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ const installPackage = async (package_path, has_obb = false, has_install = false
else { // install.txt run
installDetails.state = "running_install";
let install_lines = fs.readFileSync(package_path, 'utf8');
install_lines = install_lines.trim();
install_lines = install_lines.split("\n");
for (let line_index = 0; line_index < install_lines.length; line_index++) {
line = install_lines[line_index].trim();
Expand Down Expand Up @@ -402,6 +403,10 @@ const createOBBFolder = async (packageName) => {
await shell("mkdir " + global.obbPath + packageName);
}

const removeDataFolder = async (packageName) => {
await shell("rm -rf " + global.dataPath + packageName);
}

const createOBBFolders = async (directories, packageName) => {
//recursive create folders before copying files, due to permissions error on quest 3
directories.forEach(async (item) => {
Expand All @@ -422,7 +427,11 @@ const getInstallProgress = async () => {
const uninstallPackage = async (packageName) => {
if (global.adbDevice) {
try {
await global.adbDevice.uninstall(packageName);
if (package && package.trim() != "") {
await global.adbDevice.uninstall(packageName);
await removeOBBFolder(packageName);
await removeDataFolder(packageName);
}
return {
status: 1
}
Expand Down
3 changes: 2 additions & 1 deletion client/public/scripts/installed_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const getInstalledPackages = async () => {
let uninstallRow = null;
let uninstallPackageName = null;
const showUninstallModal = async (row) => {
uninstallRow = $(row).data("package");
uninstallRow = row;
uninstallPackageName = $(row).data("package");
$("#uninstall_package_modal").modal("show");
$(".uninstall_package_name").html(uninstallPackageName);
Expand All @@ -30,6 +30,7 @@ const uninstallPackage = async () => {
$.post("/api/uninstall_package", { package: uninstallPackageName }, (data) => {
if (data) {
if (data.status) {
$("#uninstall_package_modal").modal("hide");
uninstallRow.remove();
}
else {
Expand Down
Binary file added client/tools/7zip/linux/7za
Binary file not shown.
Binary file added client/tools/7zip/win32/7za.exe
Binary file not shown.

0 comments on commit 6ec2a05

Please sign in to comment.