Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to update the file's modified date on install?


4 replies to this topic

RothmansUA

RothmansUA
  • Full Members
  • 24 posts

Posted 13 July 2010 - 11:28

Hi all,

Could not find any quick solution for the task that I have.
I need all the files which are installed by my IS 2009 Basic MSI installation to get the current "Date Modified" timestamp, i.e. the time of the installation and not of the file creation. (The "Date Created" can remain same as by original files)

Is there a mechanism in the Windows Installer or IS to perform such a trivial task? Or the only way is to write yet another buggy custom action? smile.gif

Thanks.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 July 2010 - 13:08

There's no built in functionality in Windows Installer for this purpose.

RothmansUA

RothmansUA
  • Full Members
  • 24 posts

Posted 13 July 2010 - 13:20

OK, I know now that the Windows Installer uses Modified==Created eqality to determine whether the file was changed by the user for the non-versioned files.

That leads me to supiction that there is no built in way to affect the modificatino time on installation.

If I write a "touch" custom action, could this cause problems during future product upgrades? Or, as I hope, there always be a wrokaround, like having RemoveExistingProducts run before anything else in the Execute sequence?

Here is some background on my problem.
My installation installs a web server instance with static (say HTML) content files.
Client browsers who access static files via the web server cache them.
If the application is upgraded the clients don't see new versions of the HTML files since browser updates its cache only in case if the timestamp of the static file is newer than the timestamp of the cached one.
In case if somebody accesses the HTML file before installation upgrade she doesn't see the new file version in browser without clearing its cache.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 July 2010 - 16:23

I guess it depends on how which dates your custom action would "touch". As long as the modified date never gets newer (more recent) than the create date, the files should be updated by Windows Installer.
In addition I recommend you create hash values for the files (InstallShield by default does this automatically for you).


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 21 July 2010 - 09:34

Using timestamps to indicate versions was a great idea in 1985, but now we're 25 years ahead. Don't use a timestamp for this, that will include dependencies on file system, time zones etc.etc.

QUOTE

Here is some background on my problem.
My installation installs a web server instance with static (say HTML) content files.
Client browsers who access static files via the web server cache them.
If the application is upgraded the clients don't see new versions of the HTML files since browser updates its cache only in case if the timestamp of the static file is newer than the timestamp of the cached one.
In case if somebody accesses the HTML file before installation upgrade she doesn't see the new file version in browser without clearing its cache.


Your solution does not work in this scenario. Since browsers have no access to the file system of the webserver, it cannot determine whether time/date stamp of the files on the file system changed anyway.
You may want to consider to reduce the cache time to an acceptable length (eg. 1 hour) or to rename all the changed files.