Uploaded image for project: 'Qt Installer Framework'
  1. Qt Installer Framework
  2. QTIFW-3260

Commands in createOperations() executed in a wrong order

    XMLWordPrintable

Details

    • Windows

    Description

      Reproducer attached.
      The installscript.qs does not work as expected with IFW4.6, while it works with IFW4.1.
       
      Expected behavior:
          - The installer removes a sub folder in the installation target folder prior to unpacking the install contents.
       
      To achieve this, addOperation() function is called right before createOperations() in the installscript.
        With IFW4.1, the scipt works like : removing the subfolder -> unpacking the install contents
        With IFW4.6, the script works like : unpacking the install contents -> removing the sub folder
       
      InstallationLog.txt also shows this difference :
       
      IFW4.1 (see InstallationLog_V4_1.txt) :
      "Execute" (cmd.exe rmdir) is executed first, and then "Extract" is executed.


      [8427] Installing component The root component
      [8427] backup com.vendor.product operation: Execute
      [8427] - arguments: {0,1,2,3}, cmd.exe, /C, rmdir, /S, /Q, C:\Users\hiito\InstallationDirectory_4_1\addfiles
      [8427] Done
      [8428] perform com.vendor.product operation: Execute
      [8428] - arguments: {0,1,2,3}, cmd.exe, /C, rmdir, /S, /Q, C:\Users\hiito\InstallationDirectory_4_1\addfiles
      [8435] cmd.exe" started, arguments: "/C rmdir /S /Q C:\\Users\\hiito\\InstallationDirectory_4_1
      addfiles
      [8502] Done
      [8502] backup com.vendor.product operation: Extract
      [8502] - arguments: installer://com.vendor.product/0.1.0-1addfiles.7z, C:\Users\hiito\InstallationDirectory_4_1
      [8502] Done
      [8502] perform com.vendor.product operation: Extract
      [8502] - arguments: installer://com.vendor.product/0.1.0-1addfiles.7z, C:\Users\hiito\InstallationDirectory_4_1
      [8506] Done


       
       
      IFW4.6 (see InstallationLog_V4_6.txt) :
      "Extract" is executed first, and then "Execute" (cmd.exe rmdir) is executed.


      [15499] Preparing to unpack components...
      [15500] backup com.vendor.product concurrent operation: Extract
      [15500] - arguments: installer://com.vendor.product/0.1.0-1addfiles.7z, C:/Users/hiito/InstallationDirectory_4_6
      [15500] Started
      [15500] backup com.vendor.product concurrent operation: Extract
      [15500] - arguments: installer://com.vendor.product/0.1.0-1content.7z, C:/Users/hiito/InstallationDirectory_4_6
      [15500] Started
      [15505] Unpacking components...
      [15505] perform com.vendor.product concurrent operation: Extract
      [15505] - arguments: installer://com.vendor.product/0.1.0-1content.7z, C:/Users/hiito/InstallationDirectory_4_6
      [15505] Started
      [15506] perform com.vendor.product concurrent operation: Extract
      [15506] - arguments: installer://com.vendor.product/0.1.0-1addfiles.7z, C:/Users/hiito/InstallationDirectory_4_6
      [15506] Started
      [15610] Installing component The root component
      [15610] backup com.vendor.product operation: Execute
      [15610] - arguments: {0,1,2,3}, cmd.exe, /C, rmdir, /S, /Q, C:\Users\hiito\InstallationDirectory_4_6\addfiles
      [15610] Done
      [15610] perform com.vendor.product operation: Execute
      [15610] - arguments: {0,1,2,3}, cmd.exe, /C, rmdir, /S, /Q, C:\Users\hiito\InstallationDirectory_4_6\addfiles
      [15789] cmd.exe" started, arguments: "/C rmdir /S /Q C:\\Users\\hiito\\InstallationDirectory_4_6
      addfiles
      [16046] Done


       

      How to prepare Reproducer:

          Reproducer was prepared by modifying the "turorial" example included in IFW as follows:
       
        - Modifying config.xml:
            Adding below line:
              
            <StartMenuDir>Super App</StartMenuDir>
            <RemoveTargetDir>false</RemoveTargetDir> <---ADDED
            <TargetDir>@HomeDir@/InstallationDirectory_4_1</TargetDir>
       
        - Modifying installscript.qs:
            Adding following lines right before createOperations():
       
            <for IFW4.1>
              var strTargetDirWin = installer.value("TargetDir"); <-- ADDED
              component.addOperation("Execute", "{0,1,2,3}", "cmd.exe", "/C", "rmdir", "/S", "/Q", strTargetDirWin + "
      addfiles"); <--ADDED
              component.createOperations();
       
            <for IFW4.6>
              var strTargetDirWin = installer.toNativeSeparators(installer.value("TargetDir")); <-- ADDED
              component.addOperation("Execute", "{0,1,2,3}", "cmd.exe", "/C", "rmdir", "/S", "/Q", strTargetDirWin + "
      addfiles"); <--ADDED
              component.createOperations();
       
        - Preparing install contents:
            - Creating a folder "addfiles" in "tutorial\packages\com.vendor.product\data"
            - Creating a dummy file "aaa.txt" in addfiles folder.
       
        - Creating an installer 
            C:\Qt\Tools\QtInstallerFramework\4.1\bin\binarycreator.exe -c config\config.xml -p packages Setup_ifw411_ok.exe
       
            C:\Qt\Tools\QtInstallerFramework\4.6\bin\binarycreator.exe -c config\config.xml -p packages Setup_ifw461_ng.exe
       

      Execution Steps:

          1) Execute the installer. Check all contents are installed. (installcontent.txt & addfiles/aaa.txt)
          2) Create a dummy file "bbb.txt" in [installation target folder]/addfiles. Now you can see "aaa.txt" and "bbb.txt" there.
          3) Execute the uninstaller. Now you can see only "bbb.txt" in [installation target folder]/addfiles.
          4) Execute the installer again. The "addfiles" folder is removed and re-installed, and you can see only "aaa.txt" there.
       
        With IFW4.6, the folder "addfiles" is not existing after step1.
       
       

      Attachments

        1. tutorial_V4_6_NG.zip
          15.73 MB
        2. tutorial_V4_1_OK.zip
          9.81 MB
        3. InstallationLog_V4_6.txt
          3 kB
        4. InstallationLog_V4_1.txt
          5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kamartti Katja Marttila
            hitoshiito Hitoshi Ito
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes