How to make an app - Andromo App Maker

Announcement

Collapse
No announcement yet.

Does File.Install set a new Modification Date for the file?

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

  • Does File.Install set a new Modification Date for the file?

    I have a file that is a Primer File, so it is saved in the TempLaunchFolder, then in On Post Install I copy it to my application directory with:

    File.Install("%TempLaunchFolder%\\filename", "%AppFolder%\\filename")

    However, it seems that the installed file then ends up with a modification date and time that is when the install happened, rather than the original file's modification date.

    This can cause a problem if I make an important change to the file, then before I release a new version including it, a user runs an existing update. That causes the modification date to be newer than the new file's, and thus when I do release an update with the new file included, and the user runs it, File.Install does nothing because the existing installed file is newer!

    Am I right in this interpretation? (Or perhaps it is the saving of Primer files that causes the date and time to be updated?) What is the best solution if so? Change the File.Install call to add the FILE_INSTALL_ALWAYS argument? Obviously that has its own dangers, particularly if for some reason a user re-runs an older installer that they have saved over top of a newer install.

    Thank you.
    Dan Cooperstock [email protected]
    416-423-7722

  • #2
    Oh dear. I just did a test. The installed primer file gets the current date and time as its WriteDate! That could be what is causing this problem. I would consider that to be a bug. Is there any way around this?
    Dan Cooperstock [email protected]
    416-423-7722

    Comment


    • #3
      And can I double-check: When File.Install's documentation talks about whether the file is the same or older etc., it is talking about the WriteDate, right?
      Dan Cooperstock [email protected]
      416-423-7722

      Comment


      • #4
        The original timestamp of primer files is not preserved when decompressed to the temporary folder. If this is for non-versioned files, then you cannot make a file date comparison.

        Ulrich

        Comment


        • #5
          Ulrich, is there a reason for not retaining the original timestamp when installing primer files? Since I need them as primer files, then also need them in the final application install directory, I would really like to have that original timestamp retained. If File.Install and File.Copy can do it (I assume they both do) why can't installing primer files do it? I suppose I could have the file both as a primer file and a regular installed file, but I assume that would cause two copies of it to be embedded in the installer, unnecessarily increasing its size.
          Dan Cooperstock [email protected]
          416-423-7722

          Comment


          • #6
            I have no insight why the primer files are handled differently, but I assume that restoring the file dates was not implemented as primer files are supposed to be just temporary, not parts of the installed product itself. If you need to preserve the file dates, you could add them in a zip archive instead. At runtime, you could unzip the archive and restore the original file dates, use those files and install them, without bundling two copies in the setup.

            Ulrich

            Comment


            • #7
              Is there some sort of plug in for unzipping files available for SetupFactory? I don't see any built-in functions.
              Dan Cooperstock [email protected]
              416-423-7722

              Comment


              • #8
                There is indeed.

                Click image for larger version

Name:	SCRN-2019-03-28-02.png
Views:	1
Size:	26.4 KB
ID:	302858
                Ulrich

                Comment

                Working...
                X