Edit INI File - difference between Tag-Remove and Line-Remov

Got a problem you cannot solve? Try here.
Post Reply
moz
Posts: 8
Joined: Tue May 01, 2007 10:07 pm

Edit INI File - difference between Tag-Remove and Line-Remov

Post by moz »

The help on this says "Action: Choose the desired editing action from the drop down list".

I think it would be really useful to expand that a little, if nothing else explain what the difference between a line and a tag is in your view of INI files. Having to code up a sample and see what each option does is annoying.
Last edited by moz on Thu May 03, 2007 5:22 pm, edited 1 time in total.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

These are standard Windows Installer actions. Please review your Microsoft SDK documentation for Windows Installer, which contains the detailed explanation of these standard MSI actions.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
moz
Posts: 8
Joined: Tue May 01, 2007 10:07 pm

Post by moz »

The little test project I just built suggests that the "remove" actions have no effect and generate no error messages.

Is there some way to get debug output or at least error messages from running the installer?

And I assume Microsoft forbid you to distribute the SDK documentation or even link to it? Sorry if this sounds grumpy, but you advertise your product as making this stuff easy, and don't mention the need to have the Installer SDK installed.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Did you call Apply Install in your tests?

Our help file contains the command line switches you can pass to your setup, including switches that enable logging (/l=<path>).
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
moz
Posts: 8
Joined: Tue May 01, 2007 10:07 pm

Post by moz »

The lines immediately before the ini edits took effect, so I'm assuming that the INI Edits should.

Is it not possible to capture the log file and show it in the IDE when running in the debugger? Perhaps I'm a bit spoiled by Delphi, but that's the sort of thing I expect to have built in.

Right now I'm running the SDK installer to get the help file, and that will not run if InstallAware is loaded (and IA won't load if it's running) so I'll have to wait and see.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Please read the help topic titled "Classes of Commands" - that should clear up the confusion.

I've also looked up the info from the MS SDK docs for you:

Constant Hexadecimal Decimal Modification
msidbIniFileActionAddLine 0x000 0 Creates or updates a .ini entry.
msidbIniFileActionCreateLine 0x001 1 Creates a .ini entry only if the entry does not already exist.
msidbIniFileActionAddTag 0x003 3 Creates a new entry or appends a new comma-separated value to an existing entry.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
moz
Posts: 8
Joined: Tue May 01, 2007 10:07 pm

Post by moz »

Thanks for the SDK stuff - would I be right to assume that the "remove" entries work the same way, with key removing the whole line if there's an exact match, and tag removing the matching csv entry only?

So to remove a section/key value I need to:
- get ini file settings into a variable
- edit ini file with section/key/value and the "remove key" option

You know, progress dialogs that only shift every 10 minutes or so are really quite disconcerting. I keep wondering if the SDK installer has hung but it's just downloading 600MB over a slow link and only has ~20 visible increments. I want a numeric progress indicator!
moz
Posts: 8
Joined: Tue May 01, 2007 10:07 pm

Post by moz »

OK, I have a test project that installs a DeleteLines.ini file with this in it:

Code: Select all

[DeleteLines]
key=value
justkey=don't include this
tag=value
justtag=don't include this
The installer project has 5 lines added:

Code: Select all

  Edit INI File $TARGETDIR$\\DeleteLines.ini, [DeleteLines] key=value
  Edit INI File $TARGETDIR$\\DeleteLines.ini, [DeleteLines] justkey=
  Edit INI File $TARGETDIR$\\DeleteLines.ini, [DeleteLines] tag=value
  Edit INI File $TARGETDIR$\\DeleteLines.ini, [DeleteLines] justtag=
  Edit INI File $TARGETDIR$\\DeleteLines.ini, [NewSection] I=Added this
When I run the install I get the ini file, and it has "NewSection" and "I=Added this" added. So the edits are apparently being applied.

My goal was to see whether I can delete a line without knowing the value, just the key. But it appears form this test that I can't delete lines at all using the Edit INI File action.

Can you suggest what's going wrong, or what I can do to delete lines from ini files other than using Read From Text File/ Parse String/Replace/Set Variable/Write into Text File?
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Did you test for the delete actions at install time or uninstall time?
The changes happen at install time.

Also if you are installing the file that you are also deleting lines from, that won't work, because the file won't be installed yet at the time you are trying to delete from it - during the application of changes at Apply Install.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
moz
Posts: 8
Joined: Tue May 01, 2007 10:07 pm

Post by moz »

Michael, thanks, that was the problem. Since I'm trying to edit existing ini files this works for us, it was just my test that was failing. With the files already present before the install everything works properly.
Post Reply