|
#11
|
|||
|
|||
|
Hi all.
Could you please help me with the following: I have an installer for a mod, but if a person uninstalls a mod, the whole game is uninstalled as well. How can I make it so that only the mod files are deleted? I was thinking of keeping an install log and taking files from it to delete, but damn, that doesn't work right. (It doesn't delete files from the list and it doesn't log small files) I'll attach a sample code) Thank you in advance. Code:
Function InitializeUninstall(): Boolean;
begin
ULog := FileExists(ExpandConstant('{app}\INSTALL.LOG')); // you need to get the log now, it might not exist later
if ULog then // if there is a log file, create a sheet where we load the list of files
begin
unins_list := TStringList.Create;
unins_list.LoadFromFile(ExpandConstant('{app}\INSTALL.LOG'));
end;
Result := True;
end;
Procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
i : Integer;
begin
If CurUninstallStep = usPostUninstall then
if ULog then
begin
for i := 0 to unins_list.Count-1 do DeleteFile(unins_list:[i]); // delete files from the list - It doesn't work
unins_list.Free;
end;
end;
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup | REV0 | Conversion Tutorials | 129 | 21-05-2021 05:51 |
| INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup | REV0 | Conversion Tutorials | 51 | 26-03-2015 06:57 |
| Frequently Asked Questions | Joe Forster/STA | PC Games - Frequently Asked Questions | 0 | 29-11-2005 09:48 |