PDA

View Full Version : Completely overwrite .ini file



Henning
10-22-2002, 06:09 AM
I use Admin Studio 3.01 and have buildt a package with Author.

Scenario:
There is an ini file present on the computer when I start to install. I want the installation to completely overwrite the ini file, loosing all previous content, and create a new ini file with only the content installed from the package.

How do I do this:
- Can I somehow delete the previous ini file from the package before the installation starts?
- Can I use the REINSTALL and REINSTALLMODE parameters from command line or build these into the package?
- Do I have to use version control on the ini file?
- Or is there any other way to overwrite the existing ini file?


Help & tips needed! :)



Henning Evensen
IT-Consultant

TsungH
10-22-2002, 03:48 PM
One way is to have the INI file as a file in component, instead of using INIFile table. As long as the file has a newer (modified) timestamp, it should replace the one on system.

Henning
10-23-2002, 04:58 AM
I have tried that.

The problem is that if the ini file already present on the computer have a different/newer Modified time stamp than Created time stamp, it is considered a User Data file and is never replaced by Windows Installer.

I have discovered a possible solution by making the ini file a Companion file to another file containing a version number. This is done by adding the FileKey of the other file to the Version field of the ini file. However I don't quite understant how this Companion stuff works.. can anyone explain?
Where do I find the FileKey of a file?

nicholas_ong
10-23-2002, 06:34 AM
Henning, you're correct as that follows the versioning rules. Another method, though unorthodox is to insert a version into the file table for the ini file. This will trick the version checking into thinking that the incoming file has a version and will overwrite the existing non-versioned file.

TsungH
10-23-2002, 02:35 PM
One other option is to delete the INI file already on system using a Custom Action at the early stage in Execute Sequence.