Last active
October 15, 2019 15:39
-
-
Save Bios-Marcel/da4ba579aa3f503c122fc3f726dd28f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Code] | |
function PrepareToInstall(var NeedsRestart: Boolean): String; | |
var | |
FileResult: TFindRec; | |
AppDir: string; | |
begin | |
if FindFirst(ExpandConstant('{app}\'), FileResult) then | |
begin | |
try | |
repeat | |
if (FileResult.Name = '.') or (FileResult.Name = '..') or (FileResult.Name = 'config') then | |
begin | |
Log('Deletion skipped: ' + FileResult.Name); | |
continue; | |
end; | |
Log('Delete: ' + ExpandConstant('{app}\' + FileResult.Name)); | |
DelTree(ExpandConstant('{app}\' + FileResult.Name), FileResult.Attributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY, True, True); | |
until not FindNext(FileResult); | |
finally | |
FindClose(FileResult); | |
end; | |
end; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment