Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to delay app autostart or make sure drivers (Qt dll's) are loaded on Windows startup?

How to delay app autostart or make sure drivers (Qt dll's) are loaded on Windows startup?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 985 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • michalosM Offline
    michalosM Offline
    michalos
    wrote on last edited by michalos
    #1

    Hi,
    My app is set to start automatically with Windows (autostart).
    In 99% of cases it works correctly, but once in a while I get an error, that the Qt .dll's couldn't been found (Qt5WinExtras.dll, Qt5Widgets.dll, and such).
    How can I set the app to load the drivers correctly in 100% of cases?

    Is there a way to postpone the app, so that it searches for the drivers affter the system is loaded?

    Or is there a different solution?

    jsulmJ 1 Reply Last reply
    0
    • michalosM michalos

      Hi,
      My app is set to start automatically with Windows (autostart).
      In 99% of cases it works correctly, but once in a while I get an error, that the Qt .dll's couldn't been found (Qt5WinExtras.dll, Qt5Widgets.dll, and such).
      How can I set the app to load the drivers correctly in 100% of cases?

      Is there a way to postpone the app, so that it searches for the drivers affter the system is loaded?

      Or is there a different solution?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @michalos What drivers do you mean? Those Qt DLLs are not drivers.
      Shared libraries are loaded by the loader (system component) when your app is started.
      If you get such error messages then probably the environment isn't set up properly yet (environment variables not set yet properly).
      How did you deploy your app and how do you start it?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • michalosM Offline
        michalosM Offline
        michalos
        wrote on last edited by
        #3

        @jsulm Thank You for Your answer.
        My mistake, I meant Qt shared libraries.
        I use InnoSetup to copy my exe file and all shared libraries to a location of user choice. Than, from the app, I use QSettings to alter the registry, and add my app in the Windows Registry "CurrentVersion\Run".

        QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
                settings.setValue(QApplication::applicationName(), QCoreApplication::applicationFilePath().replace('/', '\\'));
        

        I am the main user of the app right now, and as far, the problem occurred only on my pc, but I am afraid, that it can happen on the clients pc as well.

        1 Reply Last reply
        0
        • hskoglundH Online
          hskoglundH Online
          hskoglund
          wrote on last edited by
          #4

          Hi, I had the same problem, the autostart feature of Windows is a bit random, sometimes the network isn't up and running etc. I solved it as you suggest (a delay) by creating a separate non-Qt Win32 console program that just sleeps for 10 seconds and then launches the real program.

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved