You are here

RegistryCleanupIfEmpty doesn't delete if default key is present.

7 posts / 0 new
Last post
Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
RegistryCleanupIfEmpty doesn't delete if default key is present.

Hi everyone,

As the title implies, [RegistryCleanupIfEmpty] doesn't delete if default key is present. At least that's what I'm thinking.
part of my ini file:

[RegistryCleanupForce]
1=HKCU\Software\developer\gamename

[RegistryCleanupIfEmpty]
1=HKCU\Software\developer

It removes the "gamename" out of developer. The only key is the default with no value assigned. (every reg folder seems to have one like that)
But it doesn't remove the developer.

Two possibilities, it still cares about the default value or it checks the cleanupIfEmpty before ite removes the "gamename".

Which one is it?
Can you guys help me with this?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
By design

The key's not empty if it's got that value. You need to take care of it yourself, e.g. with [RegistryValueBackupDelete].

Also please don't use [RegistryCleanupForce]. It's the wrong thing to do; it'll trash local settings. Use [RegistryKeys] instead/only.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
What if I don't want to

What if I don't want to backup these registry values? Shouldn't I use RegistryCleanupForce?

Anyway, I might want to backup those registry values.
ini file:

[RegistryKeys]
regfile=HKCU\Software\developer\gamename

[RegistryValueBackupDelete]
1=HKCU\Software\developer

Can I check somewhere if there's only the default value in that folder?
I mean if there are other games of thet developer I don't want to delete the folder, but when there's only the default value I do want to delete it.

How do I use that for the default value, is it just "1=HKCU\Software\developer\default" ?
since regedit says "standaard", dutch for default, so I don't know what's the universal name of that value.

Thanks for your time Smile

Yes, I set the working directory!

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
No; empty string

RegistryCleanupForce should probably be removed, as a matter of fact. If you don't want to save the key, use [RegistryKeys] with the INI key -. However, you do want to back them up, lest local data in the key be lost.

In [RegistryValueBackupDelete], use a trailing backslash to indicate the default value; HKCU\Software\developer would be key HKCU\Software, value developer, while HKCU\Software\developer\ is key HKCU\Software\developer, value empty string. (Calling it "Default" or "Standaard" is just the way it's shown visually; internally it's the empty value.)

Another option which may or may not be plausible, depending on the contents of the key, is to work with the HKCU\Software\developer rather than HKCU\Software\developer\gamename in [RegistryKeys].

Saving specific values is not supported in PAL at present, as I've never come across an app needing it; custom code could be written to achieve that end if desired.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
Ok, I edited my .ini file

Ok, I edited my .ini file like this.

[RegistryKeys]
regfile=HKCU\Software\developer\gamename

[RegistryValueBackupDelete]
1=HKCU\Software\developer

Now it works as it should Smile
Thanks for the explanation.

Yes, I set the working directory!

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Trailing slash

I think you meant to have a trailing slash on that last line?

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
yes ^^

yes, copy paste is bad... Smile

Yes, I set the working directory!

Log in or register to post comments