Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance uninstallation script and improve comments #4

Merged
merged 2 commits into from
Aug 19, 2023
Merged

Enhance uninstallation script and improve comments #4

merged 2 commits into from
Aug 19, 2023

Conversation

relvinarsenio
Copy link
Contributor

Summary of Changes:

  • Added delayed expansion to enable variable modification within blocks
  • Corrected variable usage and calculations
  • Improved error handling and folder removal process

Details of Changes:

  1. Added Delayed Expansion:

    • Enabled delayed expansion using setlocal enabledelayedexpansion
    • This allows variables to be updated and accessed within loops and blocks
  2. Corrected Variable Usage and Calculations:

    • Corrected variable usage for counting removal operations
    • Changed set /a b=!a! + 1 to set /a b=!b! + 1 for accurate counting
  3. Improved Error Handling and Folder Removal:

    • Added error handling for Spotify uninstallation process
    • Utilized a loop to remove Spotify data folders: "%appdata%\Spotify" and "%localappdata%\Spotify"
    • Changed the variable a to b for counting removal operations consistently
    • Improved deletion process of "SpotifyUninstall.exe" if it exists
  4. Output Messages:

    • Improved output messages to provide better feedback:
      • If no removals were performed: "Spotify not found"
      • If removals were performed: "Spotify removed"

These changes ensure the script's functionality, accuracy, and clarity.
I've tested this script on my computer and successfully executed it without errors.

Please review and merge these changes if they meet the desired improvements.

Details of Changes:
- Added delayed expansion using `setlocal enabledelayedexpansion` to allow variables to be updated within loops and blocks.
- Corrected variable usage for accurate counting of removal operations.
- Improved error handling during Spotify uninstallation process.
- Utilized a loop to remove Spotify data folders from both AppData roaming and local AppData.
- Improved deletion process for "SpotifyUninstall.exe" if present.
- Enhanced comments to provide clearer explanations of code sections.
This commit enhances the script by improving variable naming. Specifically, I've replaced the variable 'a' with 'actions' to better reflect its purpose in tracking uninstallation tasks. These changes make the code more understandable and maintainable.
@relvinarsenio
Copy link
Contributor Author

Details of Changes:

  1. Improved Script Functionality:

    • Utilized clearer variable naming, e.g., changed 'a' to 'actions', to enhance code clarity.
  2. Enhanced Output Messages:

    • Adjusted the output messages to accurately reflect the result of the uninstallation process.
    • If no uninstallation actions were performed: "Spotify is not installed or not found"
    • If uninstallation actions were performed: "Spotify has been successfully uninstalled"

@amd64fox amd64fox merged commit 8a597ec into amd64fox:main Aug 19, 2023
@amd64fox
Copy link
Owner

Looks good, thanks

@relvinarsenio relvinarsenio deleted the patch-2 branch August 19, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants