Page 1 of 1

Edit Ini function

Posted: Mon Feb 12, 2007 6:08 pm
by djm
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?

Posted: Tue Feb 13, 2007 1:30 am
by MichaelNesmith
Did you try Edit INI File on this file?

Posted: Tue Feb 13, 2007 2:06 pm
by djm
Yes, and it didn't make the modifications.

Posted: Tue Feb 13, 2007 11:05 pm
by MichaelNesmith
Then your only recourse seems to be to use Write to Text File.

Posted: Wed Feb 14, 2007 7:51 pm
by djm
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.

Posted: Thu Feb 15, 2007 9:10 am
by jimo
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.

Posted: Fri Feb 16, 2007 5:57 pm
by djm
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.

Posted: Sun Feb 18, 2007 4:17 pm
by MichaelNesmith
You are testing after calling Apply Install right? That's the only other issue I can think of...

Posted: Tue Feb 20, 2007 2:57 pm
by djm
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.

Posted: Tue Feb 20, 2007 4:34 pm
by djm
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.