This project aims to detect the installation of BaiduNetdisk (a cloud storage service) on Windows operating systems, check for executable files and folders related to the application, and generate a log file with the findings. Additionally, this documentation also explains the functionality for removing accents from text in the generated log.
The main script performs the following actions:
- Installation Detection: Checks common directories where BaiduNetdisk might be installed.
- Executable Check: Looks for the main application executable in the found directories.
- Additional Folder Check: Verifies the presence of configuration, cache, log, and resource folders associated with BaiduNetdisk.
- Accent Removal: Normalizes and removes accents from all text entries in the generated log.
- Log Generation: Generates a log file in the
C:\Windows\Temp\directory with the gathered information.
Removes accents and special characters from a given text. Uses Unicode normalization to remove accented characters.
Parameters:
text(str): Input text that may contain accents.
Returns:
- The text with accents removed.
Detects if BaiduNetdisk is installed on the system and checks for executables and folders related to the application.
Performed Tasks:
- Checks for common installation folders of BaiduNetdisk.
- Looks for the main BaiduNetdisk executables.
- Checks for the existence of configuration, cache, log, and resource folders.
- Saves a log file with the results.
Steps:
- Checks for the presence of common directory paths.
- Searches for executables like
BaiduNetdisk.exeorBaiduNetdiskApp.exe. - Checks for other related folders (Config, Cache, Logs, Resources).
- If found, generates a log file in the
C:\Windows\Temp\directory with a description of the findings. - If log saving fails, an error message is displayed.
The script uses the following libraries:
os: For file and path manipulation on the system.unicodedata: For accent removal from characters.
To run the script, follow the steps below:
- Clone or download the project repository.
- Make sure you have a configured Python environment.
- Run the script in a terminal or command prompt:
python baidunetdisk_detector.pyAfter execution, a log file will be generated in C:\Windows\Temp\Baidu_Detector.txt with the findings related to the BaiduNetdisk installation.
The generated file may contain information such as:
Folder found: C:\Program Files\BaiduNetdisk
Executable found: C:\Program Files\BaiduNetdisk\BaiduNetdisk.exe
Configuration folder found: C:\Program Files\BaiduNetdisk\Config
Cache folder found: C:\Program Files\BaiduNetdisk\Cache
Logs folder found: C:\Program Files\BaiduNetdisk\Logs
Resources folder found: C:\Program Files\BaiduNetdisk\Resources
If BaiduNetdisk is not found, the log will be empty or contain only a failure message.
If an error occurs during execution, such as failure to save the log or access folders, the following message will be shown in the console:
Error saving log: [Error message]
This script is useful for detecting BaiduNetdisk installations on a Windows system and checking for the presence of its associated files and folders. It simplifies system administration, especially when checking for specific applications without the need for a graphical interface.