Please help me create a plugin to delete one entry from ini file

For all users, who don`t speak german

Moderatoren: Chris, Sven H

aliquis
Anfänger
Beiträge: 2
Registriert: 24.04.2012, 23:32

Please help me create a plugin to delete one entry from ini file

Beitrag von aliquis » 24.04.2012, 23:43

I have a program called mp3DirectCut. It's in C:\Program Files\mp3DirectCut. An in this folder there is mp3DirectCut.ini and I have to manually delete file_recent=, because it saves recent files. I tried setting it to 0, but it keeps saving them anyway. There's nothing in the registry.
Unfortunalely the plugin I created for ClearProg doesn't work. ClearProg detects the plugin, but it doesn't remove this entry.
Below is what I did.

[mp3DirectCut]
Info=mp3DirectCut Recently Open Files
Check=$ProgramFilesDir$\mp3DirectCut\mp3DirectCut.ini
Path1=$ProgramFilesDir$\mp3DirectCut\mp3DirectCut.ini
IniFile1=$ProgramFilesDir$\mp3DirectCut\mp3DirectCut.ini|file_recent

What did I do wrong?

Benutzeravatar
Sven H
Administrator
Beiträge: 1983
Registriert: 13.08.2003, 00:00
Wohnort: Brandenburg
Kontaktdaten:

Beitrag von Sven H » 25.04.2012, 19:37

Hello

Here you can find any examples for use of plugin-function:
http://www.clearprog.de/programme/clear ... #Beispiele

Under Point 10.) you can find the help for delete an entry in an ini-file.

Syntax:
IniFile1=Path\ini-name.ini|Section|Key

The Key file_recent must placed in an section in the ini (a value for example "[Last]").
In Your Code i missed the section-value (without "[" and "]" - only the value between).

The Path1-Row is also not correct.
This row is not nessesary.

[mp3DirectCut]
Info=mp3DirectCut Recently Open Files
Check=$ProgramFilesDir$\mp3DirectCut\mp3DirectCut.ini
IniFile1=$ProgramFilesDir$\mp3DirectCut\mp3DirectCut.ini|Section|file_recent




Greets Sven

Gast

thanks, it works!

Beitrag von Gast » 25.04.2012, 23:13

Thank You very much! Now it works! I don't speak German, so I didn't figure out this section thing in [].

The ini file looks like this:

[mp3DirectCut]
unicode=1
file_recent=

So I changed the plugin and it looks (and works) like this:

[mp3DirectCut]
Info=mp3DirectCut Recently Open Files
Check=$ProgramFilesDir$\mp3DirectCut\mp3DirectCut.ini
IniFile1=$ProgramFilesDir$\mp3DirectCut\mp3DirectCut.ini|mp3DirectCut|file_recent

Thanks again!

aliquis
Anfänger
Beiträge: 2
Registriert: 24.04.2012, 23:32

Beitrag von aliquis » 25.04.2012, 23:18

I wrote the post above, I just forgot to login. Thanks again.

Antworten