Edit Ini function

Got a problem you cannot solve? Try here.
djm
Posts: 34
Joined: Thu Feb 01, 2007 4:39 pm

Edit Ini function

Postby djm » Mon Feb 12, 2007 6:08 pm

I've been unable to get this to work.

I need to update basically an empty ini file that looks like this:

Code: Select all

#Linux/unix-style comment


I have the following "edit ini" line in MSICode:

Code: Select all

~InstallAware Clipboard Data~
~Edit INI File~
~{ACA7DAF8-8673-4132-8559-E2234B746166}~
~$PROGRAMFILES$\\Product X~
~my.cfg~
~0~
~System~
~Target~
~foobar~


While it's not actually a .ini file, it has the same structure with the exception of the comment type. My question is, how strict is the 'edit ini' function about the format of the file. Can I expect that it would just look at a file with or without [headings] and name/value pairs and either add or update them correctly? Or is it looking for a specific format?

Let's say I just wanted to CREATE a new "ini" file. What would the file have to be bootstrapped with so that 'edit ini' worked on it?

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

Postby MichaelNesmith » Tue Feb 13, 2007 1:30 am

Did you try Edit INI File on this file?
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

djm
Posts: 34
Joined: Thu Feb 01, 2007 4:39 pm

Postby djm » Tue Feb 13, 2007 2:06 pm

Yes, and it didn't make the modifications.

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

Postby MichaelNesmith » Tue Feb 13, 2007 11:05 pm

Then your only recourse seems to be to use Write to Text File.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

djm
Posts: 34
Joined: Thu Feb 01, 2007 4:39 pm

Postby djm » Wed Feb 14, 2007 7:51 pm

I've been trying to get this working because I'd would otherwise have to write some kind of update/write mechanism to control the contents of the configuration file.

Even with this simple test, I cannot get the edit ini function working, which is very strange indeed. Has anyone been able to get "edit ini" working? Here's my very simple test case. I'm just trying to do a Line->Create or Update.

Code: Select all

~InstallAware Clipboard Data~
~Edit INI File~
~{86E84FD5-E3BE-4439-82E4-6090ABF41AB7}~
~C:\\Program Files\\Product X~
~setup.ini~
~0~
~Startup~
~Name1~
~Value1~


And here is the file I'm operating on:

Code: Select all

; setup.ini
[Startup]
LDXV=8


The file does not change when I run this against it.

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

Postby jimo » Thu Feb 15, 2007 9:10 am

I have tried to break the eidt ini file function and can not do it.

Are you providing the whole story?

I can change the value of the LDXV key in the ini file with out fail.
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com

djm
Posts: 34
Joined: Thu Feb 01, 2007 4:39 pm

Postby djm » Fri Feb 16, 2007 5:57 pm

I'm providing all the info I have. I've even created a more simple example.

Code: Select all

~InstallAware Clipboard Data~
~Edit INI File~
~{86E84FD5-E3BE-4439-82E4-6090ABF41AB7}~
~C:~
~foo.ini~
~0~
~System~
~Key~
~2~


foo.ini looks like this:

Code: Select all

; test file
[System]

Key=1


Can you get Key to change from 1 to 2 with the 'edit ini' function as defined above? If you can, I'm at a complete loss. Is there any other debugging info I can provide or gather on this? Is there some hidden log that would tell me how 'edit ini' is reacting to that line? I don't have any other information.

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

Postby MichaelNesmith » Sun Feb 18, 2007 4:17 pm

You are testing after calling Apply Install right? That's the only other issue I can think of...
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

djm
Posts: 34
Joined: Thu Feb 01, 2007 4:39 pm

Postby djm » Tue Feb 20, 2007 2:57 pm

MichaelNesmith wrote:You are testing after calling Apply Install right? That's the only other issue I can think of...


My original test was after Apply Install, but then I moved up a simple test case very early in the install using my final example in this post. I'm guessing this won't work at all then if it comes before Apply Install? It generates no error that I can see. Where would I find this information in the doc/help?
Thanks.

djm
Posts: 34
Joined: Thu Feb 01, 2007 4:39 pm

Postby djm » Tue Feb 20, 2007 4:34 pm

So I just tried moving that simple test case below the Apply Install and it doesn't work there either. I guess I'll try something else.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 47 guests