I've encountered a certain problem with leftovers after installation with inno setup.
I have set Flags: deleteafterinstall in [FILE] section, and it worked fine untill I added a some code that is renaming destination folder to different name durring installation, and since then Inno Setup is leaving all that files with that flag untouched which looks messy.
As a solution a created this simple batch file that I run in the end of installation via [CODE] section.
Clean_Up.bat:
del /s /f *.rej
del /s /f *.orig
del /s /f sed*
del /s /f *.patch
del /s /f *.exe
del /s /f *.bat
I'm copying this batch that way:
[FILE]
Source: "{#CompPath}\BatchFiles\Clean_Up.bat"; DestDir: "{app}\subfolder"; Flags: deleteafterinstall
I'm launching it with this:
[RUN]
Filename: "{app}\res_mods\Clean_Up.bat"; flags: runhidden;
The problem is that this batch is suppose to clean up also .batch files, and the result is that CleanUp.bat is also being removed and this is unwanted.
I wanted to solve this by copying it to {app} instead of {app}\subfolderand edit batch file to this:
del /s /f subfolder\*.rej
del /s /f subfolder\*.orig
del /s /f subfolder\sed*
del /s /f subfolder\*.patch
del /s /f subfolder\*.exe
del /s /f subfolder\*.bat
However it's giving me error: The system cannot find the file specified.
Can someone advise me how to make it work? I think the best way would be to rewrite this batch in pascal code and place in the code section, but I don't know how.
res_mods? - Martin Prikryl