Announcement

Collapse
No announcement yet.

SetupData.GetFileList(ARCHIVE_LIST) .IsInstalling problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SetupData.GetFileList(ARCHIVE_LIST) .IsInstalling problems

    Hi,

    in my installation there is a file 'TheFile' that has the overwrite flag set to 'Overwrite if existing file is older'. I try to detect if the file actually has been installed by using the .IsInstalling flag from the table returned by SetupData.GetFileList(ARCHIVE_LIST)

    The problem is that also when TheFile isn't installed the .IsInstalling flag is true.

    When this happens the following is written to the log file:
    ...
    ...
    [04/07/2017 09:58:58] Skipped Archive file: TheFile (Reason: Existing file overwrite setting)
    ...
    ...
    ...
    [04/07/2017 09:59:02] ******************** OnPostInstall() ********************
    [04/07/2017 09:59:02] TheFile: Checking if installed;
    [04/07/2017 09:59:02] -Installed, setting license

    ...
    ...

    Is this by design, is it a bug or is my code wrong? Is there any other way to tell if a file actually has been installed or not?

    Here is the code I use to check the .IsInstalling flag:
    Code:
    fileList = SetupData.GetFileList(ARCHIVE_LIST)
    if(fileList ~= nil) then
        for nIndex, PropTable in pairs(fileList) do
            if (PropTable.FileName == "TheFile") then
                printlog("TheFile: Checking if installed;");
                if(PropTable.IsInstalling == true) then
                    printlog("    -Installed, setting license\r\n");
                    ....
                else
                    printlog("    -Not installed\r\n");
                end
                break
            end
        end
    end
    Thanks
    Christian

  • #2
    The "IsInstalling" field tells you only that, at the end of the install, the file will be found installed on the target computer. If you need to figure out if files were replaced, you could use File.GetCRC(), retrieve the file date or the version info in the On Pre Install event script and compare the data with the value retrieved in On Post Install(). If the values differ, the file was updated...

    Ulrich

    Comment


    • #3
      Thank you Ulrich, I will try that.

      Comment


      • #4
        Originally posted by Ulrich View Post
        The "IsInstalling" field tells you only that, at the end of the install, the file will be found installed on the target computer. If you need to figure out if files were replaced, you could use File.GetCRC(), retrieve the file date or the version info in the On Pre Install event script and compare the data with the value retrieved in On Post Install(). If the values differ, the file was updated.
        I have discovered the same thing. The way that it works now, IsInstalling is pretty useless. It should reflect whether the file was actually replaced or not. Please consider this fix for the next version. Or add another value to GetFileList that tells whether the file was actually replaced.

        Comment

        Working...
        X