Registry aren't fully deleting when uninstalling

1.1k views Asked by At

Inno Setup isn't deleting the full registry key. Here is what I have done:

[Registry]
Root: HKLM; SubKey: SOFTWARE\EA Games\Need for Speed Most Wanted-2012; ValueType: string; ValueName: GDFBinary; ValueData: {app}\GDFBinary_en_US.dll; Flags: uninsdeletekey
Root: HKLM; SubKey: SOFTWARE\EA Games\Need for Speed Most Wanted-2012; ValueType: string; ValueName: DisplayName; ValueData: Need for Speed Most Wanted-2012; Flags: uninsdeletekey
Root: HKLM; SubKey: SOFTWARE\EA Games\Need for Speed Most Wanted-2012; ValueType: string; ValueName: Locale; ValueData: en_US; Flags: uninsdeletekey
Root: HKLM; SubKey: SOFTWARE\EA Games\Need for Speed Most Wanted-2012; ValueType: string; ValueName: Install Dir; ValueData: {app}; Flags: uninsdeletekey

These part isn't deleting when uninstalling: \EA Games\Need for Speed Most Wanted-2012 folder in registry

Root: HKLM; SubKey: SOFTWARE\EA Games\Need for Speed Most Wanted-2012 

(Need for Speed Most Wanted-2012 game is only for hint).

Anybody please help.

2

There are 2 answers

5
Martin Prikryl On BEST ANSWER

Your code, as it is, automatically deletes the HKLM\SOFTWARE\EA Games\Need for Speed Most Wanted-2012. The HKLM\SOFTWARE\EA Games is not deleted.

If you want to delete even the HKLM\SOFTWARE\EA Games, you have to add an explicit code for it:

Root: HKLM; SubKey: SOFTWARE\EA Games; Flags: uninsdeletekeyifempty

(This should be placed before your other entries).

The entry will delete only empty key SOFTWARE\EA Games. If other subkeys are created (not by the installer), the key won't be deleted. If you want to delete the EA Games key unconditionally, replace uninsdeletekeyifempty with uninsdeletekey.

1
lalit kishor kumawat On

Some time after installing software if we apply any offline patch in such case previous un-installer got replaced by new. so in such case we have to remove these registry key manually as follows:

usDone: 
   begin
       if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{078ABE12-583D-43e6-96D6-5D092883DC82}_is1') then
       begin
         RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{078ABE12-583D-43e6-96D6-5D092883DC82}_is1');
      end;