fix: don't change mode for owner but for current user

This commit is contained in:
Oskar Manhart 2024-11-01 12:23:11 +01:00
parent 2dafe2d7a1
commit b18efc4497

View File

@ -1,5 +1,5 @@
diff --git a/setup.sh b/setup.sh
index 6aa9b574..66b2e920 100755
index 6aa9b574..9fbefe65 100755
--- a/setup.sh
+++ b/setup.sh
@@ -48,8 +48,8 @@ readonly SYS_BIN_PATH="/usr/local/bin" # UNIX path to 'bin' dir
@ -120,11 +120,46 @@ index 6aa9b574..66b2e920 100755
# Configure the Windows RDP session application launcher.
waConfigureWindows
@@ -1687,6 +1687,7 @@ function waUninstall() {
$SUDO rm -f "${BIN_PATH}/winapps-setup"
@@ -1682,18 +1682,15 @@ function waUninstall() {
local DESKTOP_FILE_NAME="" # Stores the name of the '.desktop' file for the application.
local BASH_SCRIPT_NAME="" # Stores the name of the application.
- # Remove the 'WinApps' bash scripts.
- $SUDO rm -f "${BIN_PATH}/winapps"
- $SUDO rm -f "${BIN_PATH}/winapps-setup"
-
# Remove WinApps configuration data, temporary files and logs.
+ chmod -R o+rw "$USER_APPDATA_PATH"
+ chmod -R +rw "$USER_APPDATA_PATH"
rm -rf "$USER_APPDATA_PATH"
# Remove application icons and shortcuts.
$SUDO rm -rf "$APPDATA_PATH"
# Store '.desktop' files containing "${BIN_PATH}/winapps" in an array, returning an empty array if no such files exist.
- readarray -t WINAPPS_DESKTOP_FILES < <(grep -l -d skip "${BIN_PATH}/winapps" "${APP_PATH}/"* 2>/dev/null || true)
+ readarray -t WINAPPS_DESKTOP_FILES < <(grep -l -d skip "@out@/bin/winapps" "${APP_PATH}/"* 2>/dev/null || true)
# Remove each '.desktop' file.
for DESKTOP_FILE_PATH in "${WINAPPS_DESKTOP_FILES[@]}"; do
@@ -1714,7 +1711,7 @@ function waUninstall() {
done
# Store the paths of bash scripts calling 'WinApps' to launch specific applications in an array, returning an empty array if no such files exist.
- readarray -t WINAPPS_APP_BASH_SCRIPTS < <(grep -l -d skip "${BIN_PATH}/winapps" "${BIN_PATH}/"* 2>/dev/null || true)
+ readarray -t WINAPPS_APP_BASH_SCRIPTS < <(grep -l -d skip "@out@/bin/winapps" "${BIN_PATH}/"* 2>/dev/null || true)
# Remove each bash script.
for BASH_SCRIPT_PATH in "${WINAPPS_APP_BASH_SCRIPTS[@]}"; do
@@ -1735,10 +1732,9 @@ function waUninstall() {
done
# Print caveats.
- echo -e "\n${INFO_TEXT}Please note that your WinApps configuration and the WinApps source code were not removed.${CLEAR_TEXT}"
- echo -e "${INFO_TEXT}You can remove these manually by running:${CLEAR_TEXT}"
+ echo -e "\n${INFO_TEXT}Please note that your WinApps configuration and the WinApps package were not removed.${CLEAR_TEXT}"
+ echo -e "${INFO_TEXT}You can remove your config manually by running:${CLEAR_TEXT}"
echo -e "${COMMAND_TEXT}rm -r $(dirname "$CONFIG_PATH")${CLEAR_TEXT}"
- echo -e "${COMMAND_TEXT}rm -r ${SOURCE_PATH}${CLEAR_TEXT}\n"
# Print feedback.
echo -e "${SUCCESS_TEXT}UNINSTALLATION COMPLETE.${CLEAR_TEXT}"