cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Completely overwrite .ini file

CChong
By Level 11 Flexeran
Level 11 Flexeran
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
(4) Replies
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.
CChong
By Level 11 Flexeran
Level 11 Flexeran
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?
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.
One other option is to delete the INI file already on system using a Custom Action at the early stage in Execute Sequence.