elbereth / DragonUnPACKer

Free/Open source game file resource explorer/unpacking tool made easy!
https://www.elberethzone.net/dragon-unpacker.html
178 stars 21 forks source link

Registry key is created in wrong place #179

Open halamix2 opened 5 years ago

halamix2 commented 5 years ago

Dragon UnPACKer creates HKEY_CURRENT_USER/DUP5.Packages key, this shouldn't be on such high level, I don't know for now when is it created, possibly during first launch. That key contains one empty key named DefaultIcon

Tested in 5.7.0

It looks like editing line 431 of DragonUnPACKer/common/lib_Utils.pas should fix that (I don't have Delphi so I cannot test it)

grep -Rni "DUP5\.Packages"
DragonUnPACKer/install/setup.iss:128:Root: HKCR; SubKey: DUP5.Packages; ValueData: ""; Flags: UninsDeleteKey DeleteKey;
DragonUnPACKer/common/lib_Utils.pas:430:    if Not(Reg.KeyExists('Software\Classes\DUP5.Packages\DefaultIcon')) then
DragonUnPACKer/common/lib_Utils.pas:431:      Reg.CreateKey('DUP5.Packages\DefaultIcon');
DragonUnPACKer/common/lib_Utils.pas:432:    if Not(Reg.KeyExists('Software\Classes\DUP5.Packages\shell\open\command')) then
DragonUnPACKer/common/lib_Utils.pas:433:      Reg.CreateKey('Software\Classes\DUP5.Packages\shell\open\command');
DragonUnPACKer/common/lib_Utils.pas:434:    if Reg.OpenKey('Software\Classes\DUP5.Packages\DefaultIcon',True) then
DragonUnPACKer/common/lib_Utils.pas:439:    if Reg.OpenKey('Software\Classes\DUP5.Packages',True) then
DragonUnPACKer/common/lib_Utils.pas:444:    if Reg.OpenKey('Software\Classes\DUP5.Packages\shell',True) then
DragonUnPACKer/common/lib_Utils.pas:449:    if Reg.OpenKey('Software\Classes\DUP5.Packages\shell\open\command',True) then
DragonUnPACKer/common/lib_Utils.pas:459:        if (Reg.ReadString('') <> 'DUP5.Packages') then
DragonUnPACKer/common/lib_Utils.pas:461:      Reg.WriteString('','DUP5.Packages');