-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from moval0x1/1-enchantments-suggestions
1 enchantments suggestions
- Loading branch information
Showing
24 changed files
with
679 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<security> | ||
<requestedPrivileges> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Directories] | ||
Dir1=C:\\Users\\Public\\ | ||
Dir2=C:\\Windows\\Temp\\ | ||
Dir3=C:\\Users\\%USERNAME%\\AppData\\Local\\Temp\\ | ||
Dir4=C:\\Users\\%USERNAME%\\AppData\\Roaming\\ | ||
Dir5=C:\\Users\\%USERNAME%\\AppData\\Local\\ | ||
Dir6=C:\\ProgramData\\ | ||
Dir7=C:\\Users\\%USERNAME%\\Documents\\ | ||
[LogFile] | ||
Path=file_monitor_log.txt | ||
[Permissions] | ||
Bkp=permissions_backup.txt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@echo off | ||
rem Resolve the current directory where the script is located | ||
set SCRIPT_DIR=%~dp0 | ||
set BUILD_DIR=%SCRIPT_DIR%build\Desktop_Qt_6_8_0_MSVC2022_64bit-Release | ||
set QT_BIN_DIR=C:\Qt\6.8.0\msvc2022_64\bin | ||
set TARGET_DIR=C:\qtRelease | ||
set EXECUTABLE_NAME=NoDelete.exe | ||
set CONFIG_NAME=config.ini | ||
set TARGET_EXECUTABLE=%TARGET_DIR%\%EXECUTABLE_NAME% | ||
|
||
rem Ensure TARGET_DIR exists | ||
if not exist "%TARGET_DIR%" mkdir "%TARGET_DIR%" | ||
|
||
rem Delete all files from TARGET_DIR | ||
echo Cleaning target directory... | ||
del /q "%TARGET_DIR%\*" | ||
|
||
rem Copy executable from BUILD_DIR to TARGET_DIR | ||
echo Copying executable... | ||
copy "%BUILD_DIR%\%EXECUTABLE_NAME%" "%TARGET_DIR%" | ||
copy "%BUILD_DIR%\%CONFIG_NAME%" "%TARGET_DIR%" | ||
|
||
rem Run windeployqt | ||
echo Running windeployqt... | ||
"%QT_BIN_DIR%\windeployqt.exe" --no-quick-import --no-translations --no-system-d3d-compiler "%TARGET_EXECUTABLE%" | ||
|
||
echo Deployment completed. | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,55 @@ | ||
#ifndef WINDOWSMANAGEMENT_H | ||
#define WINDOWSMANAGEMENT_H | ||
|
||
#include <string> // For std::wstring | ||
#include <QLabel> | ||
#include <windows.h> | ||
#include <aclapi.h> | ||
#include <string> | ||
#include <iostream> | ||
#include <fstream> | ||
#include <filesystem> | ||
#include <vector> | ||
#include <unordered_map> | ||
|
||
#include <QLabel> | ||
#include <QListView> | ||
#include <QFileInfo> | ||
#include <QStandardItemModel> | ||
#include <QString> | ||
#include <QSettings> | ||
#include <QProcessEnvironment> | ||
#include <Qpoint> | ||
#include <QMenu> | ||
#include <QProcess> | ||
|
||
class WindowsManagement { | ||
|
||
class WindowsManagement { | ||
public: | ||
static std::unordered_map<std::wstring, PACL> originalDACLs; | ||
|
||
explicit WindowsManagement(std::atomic<bool>& runningFlag); | ||
|
||
static std::vector<std::string> LoadDirectoriesFromIni(QLabel* lblMsg, const QString &filePath, const std::string §ionName); | ||
static void AddItemsToList(QListView* lstDirectories, std::vector<std::string> &lst); | ||
static void ClearAllPermissions(QLabel* lblMsg, const std::wstring& folderPath); | ||
static void ListUsersAndPermissions(QLabel* lblMsg, const std::wstring& folderPath); | ||
static void ModifyPermissions(QLabel* lblMsg, const std::wstring& folderPath, const std::wstring& userName); | ||
static bool ModifyFoldersPermissions(QLabel* lblMsg, const std::wstring& folderPath); | ||
|
||
void WatchDirectoryAsync(const std::wstring& directory); | ||
static bool SaveOriginalPermissions(QLabel* lblMsg, const std::wstring& folderPath); | ||
static bool SetNoDeletePermissions(QLabel* lblMsg, const std::wstring& folderPath); | ||
static void RestoreOriginalPermissions(QLabel* lblMsg); | ||
|
||
static void ShowContextMenu(QListView* lstDirectories, const QPoint &pos); | ||
|
||
std::wstring stringToWString(const std::string& str); | ||
|
||
private: | ||
std::atomic<bool>& running; | ||
static QString ExpandEnvironmentVariables(const QString &path); | ||
|
||
static DWORD GetSecurityDescriptor(const std::wstring& folderPath, PSECURITY_DESCRIPTOR& pSD, PACL& pOldDACL); | ||
static DWORD SetCustomDACL(const std::wstring& folderPath, PACL pNewDACL = nullptr); | ||
|
||
void WatchDirectory(const std::wstring& directory); | ||
|
||
}; | ||
|
||
#endif // WINDOWSMANAGEMENT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef UTIL_H | ||
#define UTIL_H | ||
|
||
#include <QString> | ||
#include <QLabel> | ||
#include <QCoreApplication> | ||
#include <mutex> | ||
|
||
class Util | ||
{ | ||
// Global mutex for logging | ||
static std::mutex logMutex; | ||
|
||
public: | ||
static void setMessage(QLabel* label, const QString& message, const QString& color); | ||
static std::wstring stringToWString(const std::string &str); | ||
static void LogEvent(const std::wstring& message); | ||
static std::wstring escapeBackslashes(const std::wstring& path); | ||
|
||
static inline const QString CONFIG_PATH = "/config.ini"; | ||
}; | ||
|
||
#endif // UTIL_H |
Oops, something went wrong.