-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
6,667 additions
and
3,195 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,56 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(IGCITHelper VERSION 0.1 LANGUAGES CXX) | ||
|
||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
enable_language("RC") | ||
set (WIN32_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/IGCITHelper.rc) | ||
|
||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) | ||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) | ||
|
||
set(PROJECT_SOURCES | ||
main.cpp | ||
mainwindow.cpp | ||
mainwindow.h | ||
ExtractDumpsCompressThread.h | ||
|
||
mainwindow.ui | ||
igcithelper-resource.qrc | ||
) | ||
|
||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) | ||
qt_add_executable(IGCITHelper | ||
MANUAL_FINALIZATION | ||
${PROJECT_SOURCES} | ||
${WIN32_RESOURCES} | ||
) | ||
else() | ||
add_executable(IGCITHelper | ||
${PROJECT_SOURCES} | ||
${WIN32_RESOURCES} | ||
) | ||
endif() | ||
|
||
target_include_directories(IGCITHelper PRIVATE bit7z/include) | ||
target_link_libraries(IGCITHelper PRIVATE Qt${QT_VERSION_MAJOR}::Widgets ${CMAKE_SOURCE_DIR}/bit7z/lib/x64/${CMAKE_BUILD_TYPE}/bit7z.lib oleaut32) | ||
|
||
set_target_properties(IGCITHelper PROPERTIES | ||
WIN32_EXECUTABLE TRUE | ||
) | ||
|
||
install(TARGETS IGCITHelper | ||
BUNDLE DESTINATION . | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
|
||
if(QT_VERSION_MAJOR EQUAL 6) | ||
qt_finalize_executable(IGCITHelper) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,75 @@ | ||
#pragma once | ||
|
||
#include <QThread> | ||
#include <QColor> | ||
#include <QDir> | ||
#include <bit7z/bitarchivewriter.hpp> | ||
#include <bit7z/bitexception.hpp> | ||
|
||
class ExtractDumpsCompressThread: public QThread { | ||
Q_OBJECT | ||
|
||
private: | ||
QString outPath; | ||
bool cancelled = false; | ||
|
||
public: | ||
explicit ExtractDumpsCompressThread(QObject *parent = nullptr): QThread(parent) {} | ||
|
||
[[nodiscard]] | ||
bool isCancelled() const { return cancelled; } | ||
|
||
[[nodiscard]] | ||
QString getOutputPath() const { return outPath; } | ||
|
||
void setOutputPath(const QString &path) { outPath = path; } | ||
|
||
void run() override { | ||
try { | ||
bit7z::Bit7zLibrary lib {"7z.dll"}; | ||
bit7z::BitArchiveWriter bwriter {lib, bit7z::BitFormat::SevenZip}; | ||
uint64_t totalSz = 1; | ||
|
||
bwriter.setTotalCallback([&totalSz](uint64_t total_size) { | ||
totalSz = total_size; | ||
} | ||
); | ||
|
||
bwriter.setProgressCallback([this, &totalSz](uint64_t processed_size) { | ||
if (this->isInterruptionRequested()) { | ||
cancelled = true; | ||
return false; | ||
} | ||
|
||
emit progressUpdated(static_cast<int>((100.f * processed_size) / totalSz)); | ||
return true; | ||
} | ||
); | ||
|
||
if (QDir(R"(C:\AppCrashDumps)").exists()) | ||
bwriter.addDirectory(R"(C:\AppCrashDumps)"); | ||
|
||
if (QDir(R"(C:\Windows\Minidump)").exists()) | ||
bwriter.addDirectory(R"(C:\Windows\Minidump)"); | ||
|
||
if (QDir(R"(C:\Windows\LiveKernelReports\WATCHDOG)").exists()) | ||
bwriter.addDirectory(R"(C:\Windows\LiveKernelReports\WATCHDOG)"); | ||
|
||
bwriter.setCompressionLevel(bit7z::BitCompressionLevel::Max); | ||
bwriter.compressTo(outPath.toStdString()); | ||
|
||
emit resultReady(true, outPath); | ||
return; | ||
|
||
} catch (const bit7z::BitException &e) { | ||
emit logMessageWritten(e.what()); | ||
} | ||
|
||
emit resultReady(false, outPath); | ||
} | ||
|
||
signals: | ||
void resultReady(bool res, const QString &path); | ||
void logMessageWritten(const QString &msg); | ||
void progressUpdated(int progress); | ||
}; |
Oops, something went wrong.