MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Extract Binary at Install Time[Next]: Update Hosts File
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->File and Directory->Unversioned files

Unversioned files

An unversioned file is one that doesn't contain a version number (just about anything that is not an executable).

Windows Installer will not normally overwrite a newer version of a versioned file with and older version, but for an unversioned file it doesn't care about the timestamp of the file, if its "unchanged" it will happily overwrite a newer version with an older version. This can create a number of issues, some examples:

  1. You have a reason why the older can't be used.

  2. You require the existing file whether older or newer to be overwritten even when modified.

You can determine whether a file is unversioned or not by looking at the "Version" column of the "File" table table using "ORCA" or similar. The generated HTML also reports the version number (if one exists). A modified file is one whose "create" and "modify" date/times are different.

Solutions

These are some possible solutions:

  1. Version Lying
    You use the macro "FILE_VERSION_FOR_UNVERSIONED_FILES" to ensure that any file you add has a version. Recording a version number for a file which doesn't have one is called "version lying". The version number you use could match the MSI version name. This trick has some draw backs so read the information documented for the "File" command.

    This technique would be useful where you always want the latest file installed, the installation of an older version of your product will not overwrite it.

    Note that if your file is versioned but it is incorrect then there are programs which you could use to update (patch) the version number in the binary so there is no need to lie (look for "StampVer.exe").

  2. Delete Existing Before File Installation
    You could use the RemoveFile command or remove parameter when adding files so that the file is removed before it gets installed (effectively always overwritten).

    This technique would be useful where you always want the file in the product being installed to be installed.

  3. Companion Files
    This is a way of associating unversioned files with a versioned one.

    This technique would be useful where you have data files associated with a binary.


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Extract Binary at Install Time[Next]: Update Hosts File


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.