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

Replacing a data file


1 reply to this topic

Rubio

Rubio
  • Members
  • 4 posts

Posted 26 October 2005 - 11:30

From what I understand data files (files that don't contain version information) can be replaced only if the file date is newer than that of the existing file. Now, I made a test project that copies a data file to the target directory. Then I modified the data file and added it to the MSI to refresh it. Then I installed the app again, but the data file was not updated. I then thought that maybe I need to invoke an upgrade install, so I changed the minor version number and tried again. No change.

1. How can I be sure that a data file replaces an existing file?
2. What if the user has modified the data file in his system after I have made changes to my MSI? Is there any way to ensure that an existing data file is always, no matter what, replaced by the file in the MSI?

I'm using InstallShield X, and I want to use MSI, because our customers want to use advertised and administrative installs. Also, using MSI databases instead of Basic MSI projects produces smaller install packages (quick downloading is a priority). But, compared to the InstallScript projects that I've used previously, using MSI, in InstallShield at least, seems overly complicated. It doesn't help that the InstallShield documentation is more or less useless. Am I better off switching to Wise or some other tool?

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 26 October 2005 - 12:55

Data files are only replaced if the file creation date matches the file modify date. This indicates that the file has not been changed since installed. You could delete the existing file prior to installing the upgrade - this should install the new file even if the old file has changed. Another way is to set REINSTALLMODE = amus, but this will force install all files in the whole MSI package possibly downgrading system files.

You could use a custom action before InstallInitialize to delete the file in question, but it is probably easier to use an entry in the RemoveFile table. Check the SDK. You should set the file to be removed on install. Something like this:

FileKey = TheFile
Component = TheComponent
FileName = File.txt
DirProperty = INSTALLDIR
InstallMode = 1

Make sure to test thoroughly!
Regards
-Stein Åsmul