Delete File After Install Inno Setup Tutorial
Download File > https://urlin.us/2sXtWw
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?
If you're trying to delete files created by that subinstall, then you should contact the vendors or check their documentation and see if there's a command line parameter you can pass to suppress installation of that item in the first place. There usually should be for optional things like desktop icons.
Firts I try to delete the original MSI package files if them exists in the [InstallDelete] section but that doesnt's delete the folder at all so then after that I extract a dummy file and folder in the same locations with the "deleteafterinstall" flag to delete them.
Instructs Setup to install the file as usual, but then delete it once the installation is completed (or aborted). This can be useful for extracting temporary data needed by a program executed in the script's [Run] section.
File is the "README" file. Only one file in an installation can have this flag. When a file has this flag, the user will asked if they would like to view the README file after the installation has completed. If Yes is chosen, Setup will open the file, using the default program for the file type. For this reason, the README file should always end with an extension like .txt, .wri, or .doc.
Windows' standard shared file reference-counting mechanism (located in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs) is used to keep track of how many applications depend on the file. Each time the file is installed, the reference count for the file is incremented. (This happens regardless of whether the installer actually replaces the file on disk.) When an application using the file is uninstalled, the reference count is decremented. If the count reaches zero, the file is deleted (with the user's confirmation, unless the uninsnosharedfileprompt flag is also specified).
When this flag is used and the file is in use at uninstall time, the uninstaller will queue the file to be deleted when the system is restarted, and at the end of the uninstallation process ask the user if they wants to restart. This flag can be useful when uninstalling things like shell extensions which cannot be programmatically stopped. Note that administrative privileges are required for this flag to have an effect.
When files with a .HLP extension (Windows help files) are uninstalled, the corresponding .GID and .FTS files are automatically deleted as well. Similarly, when a .CHM (HTML Help) file is deleted, any .CHW (generated index) file is automatically deleted.
The -c option is a little more tricky to explain. Suppose you opened an installationin a file manager and browsed to {app}\subdir\program.exe. Now if you copiedprogram.exe to another location, the entire directory tree ({app}\subdir\)would be created and program.exe would be extracted there. -c notifies innounpthat you are only interested in paths from the current directory and below, so that yourfile, program.exe, is extracted right where you intended to copy it, not severaldirectory levels deeper. Note that in order to avoid confusion, files must still bespecified by their full path names inside the installation.
Note that an installation can contain several identical files (possibly under different names). Inno Setupstores only one copy of such files, and by default innounp will also unpack one file. If you want to haveall files that could ever be installed anywhere, regardless of how many identical files this may get you,-a option will do it.
Describe the exact steps necessary to reproduce the bug. Say what are thepreconditions. Is the bug specific to some system settings? To a setup file youhave? (include the problem part of the installation script or a link to the compiledsetup, if it is small enough) To an IS version? To something else? Or does thebug occur regardless of these things?
Unless you are a die-hard fan of command line, you may like the idea of workingwith IS installations like with conventional archives in a file manager. Right nowtwo programs support this: FAR and Total Commander. Below are the instructionshow to integrate innounp into each.
If you have InstallExplorer installed (or another plug-in that handles IS,but you will need to adjust the settings accordingly), you might want to let itprocess all the other types of installations but keep IS installations for innounp.FAR does not provide a means of customizing the plug-in call order; however, anempirical study has shown that it loads plug-ins and applies them to files inlexical order. So the solution is to rename InstallExplorer's dll file from 6InstExpl.dllto e.g. zInstExpl.dll (and restart FAR).
Configuration made up by G