PDA

View Full Version : How to make ini chnages conditional



fiscal
11-07-2012, 02:12 AM
Hi,

I want to save three values in an ini file.

The first two are the current version number and release date. This should overwrite existing entries.

The third item records the data path. If the ini file does not exist, or there is no value, then a default path is entered by the installer. However, if a value exists already, I do not wish to overwrite it.

How do I do that? Is it a combination of dialog window, and some custom script? If so what would that script be?

Thanks

Tony

linder
11-07-2012, 02:44 AM
Tony,

No problem. See http://www.lindersoft.com/projects/TonyINI.zip and the attached screenshot.

It will create a 'test.ini' INI file and always writes the "Version" and "Date" to the [INFO] section.

[INFO]
Version=1.2.3.4
Date=2012-11-07

Then it checks if the "Path" entry has a value. If this is not the case, it writes a path value to the INI file.

[INFO]
Version=1.2.3.4
Date=2012-11-07
Path=C:\TEST

Note: If the Path value already exists, it will not update it.

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

--Helping You Build Better Installations
--SetupBuilder "point. click. ship"
--Create Windows 8 ready installations in minutes
--Official Comodo Code Signing and SSL Certificate Partner