mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-22 03:45:51 +08:00
fix Windows build
- Updated README.md to include CMake command for installation. - Improved win-deploy.cmake to handle executable path issues and added detailed logging for deployment steps. - Introduced checks for runtime dependencies and optimized DLL copying logic to avoid unnecessary copies. - Added additional MinGW runtime DLLs required for GStreamer and FFmpeg. - Created idescriptor.rc for application versioning and resource management. - Updated resources.qrc to include application icon. - Modified AppsWidget to improve UI for install and download actions. - Adjusted dnssd_service.h to conditionally include headers based on platform. - Enhanced install_ipa.cpp with additional includes for better compatibility. - Updated main.cpp to set up environment variables for GStreamer on Windows. - Improved mainwindow.cpp to add a no devices detected page and integrate dependency checks. - Cleaned up mainwindow.ui by removing unnecessary layout elements. - Implemented check_deps.cpp and check_deps.h for verifying required dependencies on Windows. - Created diagnose_dialog.cpp and diagnose_dialog.h for a dialog to display dependency checks. - Developed diagnose_widget.cpp and diagnose_widget.h to manage and display dependency items. - Enhanced sshterminalwidget.cpp to improve terminal handling on Windows. - Updated welcomewidget.cpp to refine UI layout and spacing for better aesthetics.
This commit is contained in:
+40
-2
@@ -1,17 +1,55 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QStyleFactory>
|
||||
#include <QtGlobal>
|
||||
#include <stdlib.h> // For getenv
|
||||
|
||||
#ifdef WIN32
|
||||
#include "platform/windows/check_deps.h"
|
||||
#endif
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
#ifdef WIN32
|
||||
// This setup MUST be done before the QApplication object is created.
|
||||
QString appPath = QCoreApplication::applicationDirPath();
|
||||
QString gstPluginPath =
|
||||
QDir::toNativeSeparators(appPath + "/gstreamer-1.0");
|
||||
QString gstPluginScannerPath =
|
||||
QDir::toNativeSeparators(appPath + "/gstreamer-1.0/gst-plugin-scanner");
|
||||
|
||||
// Add the application's directory to the PATH so GStreamer plugins can find
|
||||
// their dependencies (e.g., FFmpeg DLLs).
|
||||
const char *oldPath = getenv("PATH");
|
||||
QString newPath = appPath + ";" + QString(oldPath);
|
||||
qputenv("PATH", newPath.toUtf8());
|
||||
|
||||
qputenv("GST_PLUGIN_PATH", gstPluginPath.toUtf8());
|
||||
qDebug() << "GST_PLUGIN_PATH=" << gstPluginPath;
|
||||
printf("GST_PLUGIN_PATH=%s\n", gstPluginPath.toUtf8().data());
|
||||
qputenv("GST_REGISTRY_REUSE_PLUGIN_SCANNER", "yes");
|
||||
qDebug() << "GST_REGISTRY_REUSE_PLUGIN_SCANNER=yes";
|
||||
printf("GST_REGISTRY_REUSE_PLUGIN_SCANNER=yes\n");
|
||||
qputenv("GST_PLUGIN_SYSTEM_PATH", gstPluginPath.toUtf8());
|
||||
qDebug() << "GST_PLUGIN_SYSTEM_PATH=" << gstPluginPath;
|
||||
printf("GST_PLUGIN_SYSTEM_PATH=%s\n", gstPluginPath.toUtf8().data());
|
||||
qputenv("GST_DEBUG", "GST_PLUGIN_LOADING:5");
|
||||
qDebug() << "GST_DEBUG=GST_PLUGIN_LOADING:5";
|
||||
printf("GST_DEBUG=GST_PLUGIN_LOADING:5\n");
|
||||
qputenv("GST_PLUGIN_SCANNER_1_0", gstPluginScannerPath.toUtf8());
|
||||
qDebug() << "GST_PLUGIN_SCANNER_1_0=" << gstPluginScannerPath;
|
||||
printf("GST_PLUGIN_SCANNER_1_0=%s\n", gstPluginScannerPath.toUtf8().data());
|
||||
#endif
|
||||
QCoreApplication::setOrganizationName("iDescriptor");
|
||||
// QCoreApplication::setOrganizationDomain("iDescriptor.com");
|
||||
QCoreApplication::setApplicationName("iDescriptor");
|
||||
// QCoreApplication::setApplicationVersion(IDESCRIPTOR_VERSION);
|
||||
|
||||
QApplication::setStyle(QStyleFactory::create("macOS"));
|
||||
// QApplication::setStyle(QStyleFactory::create("Windows"));
|
||||
#ifndef __APPLE__
|
||||
QApplication::setStyle(QStyleFactory::create("Fusion"));
|
||||
#endif
|
||||
|
||||
MainWindow *w = MainWindow::sharedInstance();
|
||||
w->show();
|
||||
|
||||
Reference in New Issue
Block a user