Prevent maintenance tool from removing copied directories during uninstallation



  • For my IFW installer, I added operations to the default component to move some files and directories from the installation directory to another location. However, upon uninstallation, these files and directories are automatically deleted. How can I prevent this from happening? I want to remove everything in the installation directory as usual but for the files that I copied elsewhere I'd like them to remain. Below is my install script. I'd like to prevent the "My AAAT Projects" directory from being deleted upon uninstallation. Any help is very much appreciated!

    function Component()
    {
    }
    
    Component.prototype.createOperations = function()
    {
       component.createOperations();
    
       if (installer.value("os") === "win")
       {
          var appDataDir = installer.environmentVariable("AppData") + "/AAAT";
          if (appDataDir != "")
          {
             component.addOperation("Mkdir", appDataDir);
             component.addOperation("Move", "@TargetDir@/user_database", appDataDir + "/user_database");
          }
    
          // Copy models to user's My AAAT Projects directory
          component.addOperation("Mkdir", "@HomeDir@/Documents/My AAAT Projects");
          component.addOperation("CopyDirectory", "@TargetDir@/AAAT Baselines/", "@HomeDir@/Documents/My AAAT Projects/");
          component.addOperation("CopyDirectory", "@TargetDir@/Sample AAAT Projects/", "@HomeDir@/Documents/My AAAT Projects/");
    
          // Add Desktop and Start Menu shortcuts
          component.addOperation("CreateShortcut", "@TargetDir@/AAAT.exe", "@StartMenuDir@/AAAT.lnk");
          component.addOperation("CreateShortcut", "@TargetDir@/AAAT.exe", "@DesktopDir@/AAAT.lnk");
       }
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.