Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Append a value to INI entry


8 replies to this topic

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 28 June 2006 - 13:16

I am repackaging a vendor setup which writes to an INI. Unfortunately, my capture saw this activity as adding all new entries to the INI. I have isolated the entries I'm interested in but I still have a problem in that the app in question appends its driver name to the end of an existing value. For example:

[TheSection]
TheEntry="Value1,Value2"

becomes:

[TheSection]
TheEntry="Value1,Value2,Value3"

I want to avoid script/CA if possible.

When processing the INIFile table, does WI skip over existing entries or simply overwrite the whole entry? If so, I guess I have no choice but to go with script/CA...
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 July 2006 - 10:28

It depends on the value in the Action column of the INIFile table. For details see MSI Help.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 03 July 2006 - 10:13

Stefan,

Wouldn't it have been more useful, especially for someone coming here in the future, to simply say what the answer is? It is somehwat presumptive to think that folks have MSI help installed. I found the answer here:

http://msdn.microsof...ifile_table.asp

In the INIFile table, set the 'Value' to be the data you want to append and change the 'Action' from its default 0 to 3.

Note that, in the tool I use (Wise), any space between the '=' and the entry (even an existing one) is removed and a space is inserted after the comma which gets added before the new value is appended. That is:

[TheSection]
TheEntry = "Value1,Value2"

becomes:

[TheSection]
TheEntry ="Value1,Value2, Value3"

This may or may not cause issues with certain apps which do not trim spaces from INI data. Guess which camp my app fell into? In the end, I had to resort to script because of that. One day, these clowns will get it right...
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 04 July 2006 - 10:30

Hi VBScab. Helping someone to help themselves is generally the best type of help. As to the availability of the MSI SDK help: I have yet to see a deployment tool that does NOT install a copy of the SDK help.
Regards
-Stein Åsmul

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 04 July 2006 - 10:47

QUOTE

Helping someone to help themselves is generally the best type of help.


Agreed. It would be beyond anyone to say something like "The page 'Creating and editing INI files' in the MSI.CHM file (installed with the Platform SDK) says..."? The requestors get the info he asked for and a pointer to a file/product which will be useful in future (and potentially saves him/her coming here and going through this torture.)

QUOTE

I have yet to see a deployment tool that does NOT install a copy of the SDK help.


...except, of course, in corporate deployments where tools are repackaged by, say, an Engineering or Desktop Group who are terrified that some other department (say, Packaging/Deployment) will take over their function, so seek to keep the available toolset restricted.

But that never happens, of course. laugh.gif

Edited by VBScab, 04 July 2006 - 10:53.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 July 2006 - 10:49

QUOTE (VBScab @ 2006-07-03 11:13)
Wouldn't it have been more useful, especially for someone coming here in the future, to simply say what the answer is? It is somehwat presumptive to think that folks have MSI help installed.

In my opinion it's good practice to check the documentation first before posting a question in a forum. I pointed you to the right section of the documentation (granted, I could have also posted a link) in case you hadn't seen it. Also before editing the table I think it's good to read the full documentation about the table to understand any cross-references etc. I didn't see a point in copying the documentation to the forum. Also, this way I saved some time which I could spend answering other questions, while readers leanr to help themselves.

Edited by Stefan Krueger, 04 July 2006 - 10:56.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 July 2006 - 10:55

QUOTE (VBScab @ 2006-07-04 11:47)
QUOTE

I have yet to see a deployment tool that does NOT install a copy of the SDK help.


...except, of course, in corporate deployments where tools are repackaged by, say, an Engineering or Desktop Group who are terrified that some other department (say, Packaging/Deployment) will take over their function, so seek to keep the available toolset restricted.

But that never happens, right?

If you are serious about developing MSI setups I think you should have access to the documentation - either a local copy or online at MSDN.

I have a feeling that this discussion is becoming slightly off-topic. If anyone feels the need to discuss this further please open a new thread in the General > Non-Technical > About this Forum section. (This is a valid discussion, just in the wrong place)

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 04 July 2006 - 11:14

I think it's worth pointing out that I don't pose questions in forums lightly. Generally speaking, I have researched issues before posing questions. This time, like a fool, I was a) expecting native support in my tool's GUI (Wise Package Studio) for something as simple as appending an INI entry and cool.gif relying on that tool's documentation which is, shall we say, opaque concerning what I wanted to do UNTIL you go to the table editor. Once there, you can see the same info as I found on MSDN.

As mentioned earlier, the distro we get for WPS doesn't include the Platform SDK so we get no MSI Help file. Luckily, the Engineering Group here is too stupid to obscure their account details in their scripts so I now have everything I need.

I didn't ask for any documentation to be copied.

As for saving time, how longer is this sentence:

"In the INIFile table, set the 'Value' to be the data you want to append and change the 'Action' from its default 0 to 3."

than this one:

"It depends on the value in the Action column of the INIFile table. For details see MSI Help. "?

I make it 28 characters. I'll bet you made good use of the 1/2 second you saved.

In contrast, *I* took the time to advise people of a potential issue with how the INI entry gets rewritten by WI.

Look, I don't want to fall out with or upset anyone: suffice to say that I think a little understanding about why people post here is warranted.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 July 2006 - 12:14

QUOTE
Look, I don't want to fall out with or upset anyone

Nor do I smile.gif

As for the time saving: the sentence I've written I was able to write from memory. For the details I would have to look up the documentation myself, and I was leaving this task for you. Thanks for posting the link to the docs.