Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. installer scripting Settings operation
QtWS25 Last Chance

installer scripting Settings operation

Scheduled Pinned Locked Moved Installation and Deployment
ifwsettingsremoveregistrycomponent
3 Posts 2 Posters 4.7k 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.
  • G Offline
    G Offline
    GoranShekerov
    wrote on last edited by
    #1

    Hi,
    I want to remove windows registry keys using the qt installer framework, while uninstalling?
    Does anyone succeeded in removing a settings key from the (registry in windows) using the Settings operation in component script?

    I've used:
    [code]
    component.addOperation("Execute", "cmd /C echo do nothing", "UNDOEXECUTE", "cmd /C @TargetDir@\CleanWindowsRegistry.bat /f");
    [/code]

    where CleanWindowsRegistry.bat consists of
    [code] reg delete HKEY_CURRENT_USER\Software\SugarTrumpet\player /f [/code]

    This works for administrator user but if the uninstaller is used from standard windows user the bat is executed with administrator privileges and does not removes the registry folder.

    I think much cleaner, multi-platform, way is to use the Settings operation,
    something like [code] component.addOperation("Settings", "HKEY_CURRENT_USER\Software\SugarTrumpet", "remove", "player", "0"); [/code]
    But it's not working.

    Except the ifw manual, I can't find more detailed information or any example about the operations and possible argument in component scrip?

    Everything best, Goran.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      GoranShekerov
      wrote on last edited by
      #2

      Hi,
      finally I found a solution :)
      Instead of using the component, in the controller script constructor i connected the "uninstallationStarted" signal:

      [code]
      function Controller()
      {
      // default constructor
      installer.uninstallationStarted.connect(onUninstallationStarted);
      }

      onUninstallationStarted = function()
      {
      installer.performOperation("Execute", "cmd /C reg delete HKEY_CURRENT_USER\Software\SugarTrumpet\player /f");
      }

      [/code]

      So the performed operation ("deleting the registry key") is executed at the very beginning of uninstallation process with currently logged user credentials. After that the uninstaller asks for administrators permission and continues the un-installation process as under administrator.
      Everything bets, Goran.

      U 1 Reply Last reply
      0
      • G GoranShekerov

        Hi,
        finally I found a solution :)
        Instead of using the component, in the controller script constructor i connected the "uninstallationStarted" signal:

        [code]
        function Controller()
        {
        // default constructor
        installer.uninstallationStarted.connect(onUninstallationStarted);
        }

        onUninstallationStarted = function()
        {
        installer.performOperation("Execute", "cmd /C reg delete HKEY_CURRENT_USER\Software\SugarTrumpet\player /f");
        }

        [/code]

        So the performed operation ("deleting the registry key") is executed at the very beginning of uninstallation process with currently logged user credentials. After that the uninstaller asks for administrators permission and continues the un-installation process as under administrator.
        Everything bets, Goran.

        U Offline
        U Offline
        user2301
        wrote on last edited by
        #3

        @GoranShekerov
        Tried the above code to stop and remove the windows service while uninstalling from QT installer. But did not work

        function Controller()
        {
        installer.uninstallationStarted.connect(onUninstallationStarted);
        }

        onUninstallationStarted = function()
        {
        if (installer.isUninstaller()) {
        installer.performOperation("Execute", "@TargetDir@/platform/tools/Server/testServer.exe", "stop");
        console.log("Server stopped")
        installer.performOperation("Execute", "@TargetDir@/platform/tools/Server/testServer.exe", "remove");
        console.log("Server removed")
        }
        }

        1 Reply Last reply
        0

        • Login

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