Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

6179D6B2-3952-4B22-BE49-22AB29029AAD

AlwaysRestart=yes
PrivilegesRequired=admin

[Dirs]
Name: "{app}"; Permissions: everyone-full

[Icons]
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"

[CODE]
procedure CurStepChanged(CurStep: TSetupStep);
var
strContent: String;
intErrorCode: Integer;
strSelf_Delete_BAT: String;
begin
if CurStep=ssDone then
begin
strContent := ':try_delete' + #13 + #10 +
'del "' + ExpandConstant('{srcexe}') + '"' + #13 + #10 +
'if exist "' + ExpandConstant('{srcexe}') + '" goto try_delete' + #13 +
#10 +
'del %0';

strSelf_Delete_BAT := ExtractFilePath(ExpandConstant('{tmp}')) +
'SelfDelete.bat';
SaveStringToFile(strSelf_Delete_BAT, strContent, False);
Exec(strSelf_Delete_BAT, '', '', SW_HIDE, ewNoWait, intErrorCode);
end;
end;

You might also like