Avatar of eNarc
eNarc
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Delete Self

Hi, I'm making an uninstaller.

I've been able to delete everything though only thing I'm unable to delete is the exe itself..

is there away of deleting the exe?

could I open up command to delete the file?? or anything like that?

procedure RegisterUninstall(Name, Path: String);
var
  AReg: TRegistry;
begin
  AReg:= TRegistry.Create;
  AReg.RootKey:= HKEY_LOCAL_MACHINE;
  AReg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Uninstall', false);
  AReg.OpenKey(Name, true);
  AReg.WriteString('DisplayName', Name);
  AReg.WriteString('UninstallString', Path);
  AReg.Free;
end;

using the -uninstall paramstr

though the item in add and remove still stays there and the exe stays there also

anyway of deleting the exe and the entry in add and remove programs when removing.
DelphiPascal

Avatar of undefined
Last Comment
lomo74

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
VahaC

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
VahaC

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23