How to edit an installed ini file

Got a problem you cannot solve? Try here.
crustyzz
Posts: 28
Joined: Thu Mar 16, 2006 4:18 am
Location: France

How to edit an installed ini file

Postby crustyzz » Fri Mar 31, 2006 6:26 am

Hi,
I would like to edit an ini file wich will be installed. But I read I can't call Edit Ini file after the Apply Install command because this is a Windows Installer command.

Should I call Edit Ini File command before Apply install (in the DEFINE WEB MEDIA bloc ?) using SFXPATH valiable, to edit my ini file?

I would like something like that.

Code: Select all

Install Files E:\\MyLocalFilePath\\MyIniFile.opt to $TARGETDIR$\\MyDestDir\\MyIniFile.opt
...
Apply Install (get result into variable success)
If Varible MyCustomVariable Equals 1
  Edit INI File $TARGETDIR$\\MyDestDir\\MyIniFile.opt, [MySection] var=value1
else
    Edit INI File $TARGETDIR$\\MyDestDir\\MyIniFile.opt, [MySection] var=value2
End


But this doesn't work !

Can you help please ?

Thanks

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Fri Mar 31, 2006 9:21 am

Move your edits before the apply install but after the file installation.

As in:

Code: Select all

Install Files E:\\MyLocalFilePath\\MyIniFile.opt to $TARGETDIR$\\MyDestDir\\MyIniFile.opt
...
If Varible MyCustomVariable Equals 1
  Edit INI File $TARGETDIR$\\MyDestDir\\MyIniFile.opt, [MySection] var=value1
else
    Edit INI File $TARGETDIR$\\MyDestDir\\MyIniFile.opt, [MySection] var=value2
End
Apply Install (get result into variable success)
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com

crustyzz
Posts: 28
Joined: Thu Mar 16, 2006 4:18 am
Location: France

Postby crustyzz » Fri Mar 31, 2006 9:57 am

Thanks Jimo,

but this doen't work. I think it's because MyIniFile.opt isn't copied to local system until the script call Apply Install.

In fact the test "Does File exist $TARGETDIR$/../MyIniFile.opt" return FALSE before I call "Apply Install" but TRUE after.

:cry:

jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Postby jimo » Fri Mar 31, 2006 10:07 am

I use this all the time,

I install my ini files then use Edit INI File

Here is an excerpt from one of my functioning scripts

Code: Select all

Install Files E:\\MDDI_INSTALL\\DIR_ROOT\\Program Files\\MultiMedia Dental\\MDDI\\ctpCore.ini to $TARGETDIR$\\MDDI
Edit INI File $TARGETDIR$\\MDDI\\ctpCore.ini, [CONFIG] Practitioner=$CONFIG_PRACTICE_NAME$
Edit INI File $TARGETDIR$\\MDDI\\ctpCore.ini, [CONFIG] StatusTemplatePath=$MASTER_IMAGES_PATH$\\StatusTemplates
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com

crustyzz
Posts: 28
Joined: Thu Mar 16, 2006 4:18 am
Location: France

Postby crustyzz » Mon Apr 03, 2006 8:13 am

Thanks Jimo for your help.
That works !

BUT ... My Ini file contains a checksum :oops: and I would like to calculate the new checksum when the file will be copied, and Edit the file to update a value.

I'm developping a plugin in order to calculate the new check sum.
I hope I would be able to edit my ini file just after the last editions.

I saw a "File contains a checksum" check box in the file properties, but I don't know how to use it.

Does anybody know more about this option?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Apr 03, 2006 3:00 pm

The checksum option is for when you're installing files. From what I understand you are storing the INI checksum as part of the INI file itself, so that's not what you're looking for.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 188 guests