Issue with Qt WebEngine, Missing DLLs, and Creating EXE Installer
-
Hello,
I’m facing issues when deploying my Qt application on Windows. The WPubViewer.exe is being created correctly, but the HTML content is not displaying. After running windeployqt ., it seems the necessary WebEngine DLLs are missing, specifically QtWebEngine.dll. I have QtWebEngineCore.dll and QtWebEngineProcess.exe, but WebEngine is not working.
Additionally, I would like to know how to create an EXE installer for my Qt application that will properly install all required dependencies.
Any help would be appreciated. Thanks!
-
@MyNameIsQt said in Issue with Qt WebEngine, Missing DLLs, and Creating EXE Installer:
QString htmlPath = QFileInfo(FILE).dir().absolutePath() + "/main.html";
How is this going to work?!
Either put the HTML file into a recourse file or deploy the HTML file together with the application and construct correct path at runtime using https://doc.qt.io/qt-6/qstandardpaths.html#locate -
Difficult to say what went wrong, without knowing exactly how the application was deployed.
Have you followed every step in the documentation? -
@Axel-Spoerl I can create an installer.exe using Inno Setup Compiler. However, the HTML, which is the main component of the application, is not displaying. I can't find Qt6WebEngine, is it no longer in use? How can I resolve the issue of the HTML not displaying?
The following DLLs are present:
Qt6Core.dll
Qt6Gui.dll
Qt6Network.dll
Qt6OpenGl.dll
Qt6Positioning.dll
Qt6Qml.dll
QmlModels.dll
QmlWorkerScript.dll
Quick.dll
Quick3DUtils.dll
QuickWidgets.dll
Qt6SerialPort.dll
Qt6Svg.dll
Qt6VirtualKeyboard.dll
Qt6WebChannel.dll
Qt6WebEngineCore.dll
Qt6WebEngineWidgets.dll
Qt6Widgets.dll
QtWebEngineProcess.exeThanks a lot.
-
@MyNameIsQt hi,
Did you run windeployqt before packing things with innosetup ?
These dlls alone are not all. There are plugins, QML files, etc.
-
This post is deleted!
-
@SGaist Yes, I ran windeployqt using Qt 6.8.2 (MSVC 2022 64-bit) before packaging the application.
I used windeployqt to deploy the necessary Qt libraries, plugins, QML files, and other dependencies required for the application to run correctly on the target system. This ensures that all the essential files are included for proper execution.
-
To clear thing up: are you able to start the application properly from the explorer once you have run windeployqt ?
-
Where are you loading your html from ?
-
@SGaist
What does it mean? Do you mean this?#include <QWebEngineSettings> #include <QWebEngineProfile> #include <QWebEnginePage> MyViewApplication::MyViewApplication(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MyViewApplication) , styleSheet() , windowSizeLabel(nullptr) , m_isCanvasLoaded(false) , webView(new QWebEngineView(this)) , channel(new QWebChannel(this)) , channelManager(new ChannelManager(this)) { setMinimumSize(960, 640); //setMinimumSize(960, 640); ui->setupUi(this); setCentralWidget(webView); QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); profile->setCachePath("C:/Users/user/Documents/Cache"); profile->setPersistentStoragePath("C:/Users/user/Documents/indexedDB"); webView->setPage(new QWebEnginePage(profile, webView)); webView->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true); webView->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true); webView->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); webView->page()->setDevToolsPage(new QWebEnginePage(this)); QString htmlPath = QFileInfo(__FILE__).dir().absolutePath() + "/main.html"; QFile file(htmlPath); if (file.exists()) { webView->load(QUrl::fromLocalFile(htmlPath)); } else { qDebug() << "Failed to load main.html. File not found."; } webView->page()->setWebChannel(channelManager->getChannel()); channelManager->registerObject("MyViewApplication", this); createStatusBar(); initResources(); showMaximized(); QAction *openDevToolsAction = new QAction("Open DevTools", this); connect(openDevToolsAction, &QAction::triggered, this, [this]() { QWebEngineView *devToolsView = new QWebEngineView(); devToolsView->setPage(webView->page()->devToolsPage()); devToolsView->resize(800, 600); devToolsView->show(); }); addAction(openDevToolsAction); openDevToolsAction->setShortcut(QKeySequence("F12")); }
main.cpp
#include "MyViewApplication.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MyViewApplication w; w.show(); return a.exec(); }
-
@MyNameIsQt said in Issue with Qt WebEngine, Missing DLLs, and Creating EXE Installer:
QString htmlPath = QFileInfo(FILE).dir().absolutePath() + "/main.html";
How is this going to work?!
Either put the HTML file into a recourse file or deploy the HTML file together with the application and construct correct path at runtime using https://doc.qt.io/qt-6/qstandardpaths.html#locate -