I need to delete some files after the installation finishes.
I was using the [Run]
section to call cmd
to delete the files but I wanted to improve the deletions by using Inno Setup code and not batch then I've seen the [InstallDelete]
section but this delete the files BEFORE the [Run]
section so... there is something I can do to delete the files after [Run]
section?
Here is my script:
#define InstallerName "VirtualBox-4.2.16-r86992-MultiArch_amd64.msi"
#define ExtensionName "Oracle_VM_VirtualBox_Extension_Pack-4.2.16-86992.vbox-extpack"
[Files]
Source: {tmp}\*; DestDir: {tmp}; Flags: deleteafterinstall recursesubdirs createallsubdirs ignoreversion
[Run]
Filename: {tmp}\{#InstallerName}; Parameters: "/passive /norestart ADDLOCAL=VBoxApplication INSTALLDIR=""{app}"""; StatusMsg: Instalando VirtualBox...; Flags: shellexec RunHidden WaitUntilTerminated
Filename: {tmp}\xml.exe; Parameters: "ed --inplace -N N=""http://www.innotek.de/VirtualBox-settings"" --update ""//N:ExtraDataItem[@name='GUI/UpdateDate']/@value"" --value never ""{%userprofile}\.virtualbox\virtualbox.xml"""; StatusMsg: Instalando VirtualBox...; Flags: RunHidden WaitUntilTerminated
Filename: {app}\VBoxManage.exe; Parameters: "extpack install --replace ""{tmp}\{#ExtensionName}"""; StatusMsg: Instalando Extension Pack...; Flags: RunHidden WaitUntilTerminated
Filename: {app}\virtualbox.exe; Description: {cm:LaunchProgram,VirtualBox}; Flags: shellexec postinstall unchecked skipifsilent nowait
[InstallDelete]
Name: {commondesktop}\Oracle VM VirtualBox.lnk; Type: files
Name: {commonstartmenu}\Programs\Oracle VM VirtualBox; Type: filesandordirs