I wanted to delete the files created during the application life time at the time of uninstall process and various places such as documents and settings, application data, program files etc so after a R&D i came to know how to delete files created by the application
[UninstallDelete]
Type: files; Name: "path to file\filename.extension";
Type: files; Name: "path to file\*"; //delete all files
example to delete files in documents and settings application data and app folder
Type: files; Name: "{userappdata}\yourappname\*";
below are the paths of different file structure in innosetup
{app}
The application directory, which the user selects on the Select Destination Location page of the wizard.
For example: If you used {app}\MYPROG.EXE on an entry and the user selected "C:\MYPROG" as the application directory, Setup will translate it to "C:\MYPROG\MYPROG.EXE".
{win}
The system's Windows directory.
For example: If you used {win}\MYPROG.INI on an entry and the system's Windows directory is "C:\WINDOWS", Setup or Uninstall will translate it to "C:\WINDOWS\MYPROG.INI".
{sys}
The system's System32 directory (System on Windows 95/98/Me).
For example: If you used {sys}\CTL3D32.DLL on an entry and the system's Windows System directory is "C:\WINDOWS\SYSTEM", Setup or Uninstall will translate it to "C:\WINDOWS\SYSTEM\CTL3D32.DLL".
{syswow64}
On 64-bit Windows, the system's SysWOW64 directory, typically "C:\WINDOWS\SysWOW64". This is the actual directory in which 32-bit system files reside. On 32-bit Windows, 32-bit system files reside in "System32" or "System", not in a separate SysWOW64 directory, so this constant will resolve to the same directory as {sys} if used there.
{src}
The directory in which the Setup files are located.
For example: If you used {src}\MYPROG.EXE on an entry and the user is installing from "S:\", Setup will translate it to "S:\MYPROG.EXE".
{sd}
System Drive. The drive Windows is installed on, typically "C:". On Windows NT platforms, this directory constant is equivalent to the SystemDrive environment variable.
{pf}
Program Files. The path of the system's Program Files directory. {pf} is equivalent to {pf32} unless the install is running in 64-bit mode, in which case it is equivalent to {pf64}.
{pf32}
32-bit Program Files. The path of the system's 32-bit Program Files directory, typically "C:\Program Files" on 32-bit Windows and "C:\Program Files (x86)" on 64-bit Windows.
{pf64}
64-bit Windows only: 64-bit Program Files. The path of the system's 64-bit Program Files directory, typically "C:\Program Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.
{cf}
Common Files. The path of the system's Common Files directory. {cf} is equivalent to {cf32} unless the install is running in 64-bit mode, in which case it is equivalent to {cf64}.
{cf32}
32-bit Common Files. The path of the system's 32-bit Common Files directory, typically "C:\Program Files\Common Files" on 32-bit Windows and "C:\Program Files (x86)\Common Files" on 64-bit Windows.
{cf64}
64-bit Windows only: 64-bit Common Files. The path of the system's 64-bit Common Files directory, typically "C:\Program Files\Common Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.
{tmp}
Temporary directory used by Setup or Uninstall. This is not the value of the user's TEMP environment variable. It is a subdirectory of the user's temporary directory which is created by Setup or Uninstall at startup (with a name like "C:\WINDOWS\TEMP\IS-xxxxx.tmp"). All files and subdirectories in this directory are deleted when Setup or Uninstall exits. During Setup, this is primarily useful for extracting files that are to be executed in the [Run] section but aren't needed after the installation.
{fonts}
Fonts directory. Normally named "FONTS" under the Windows directory.
{dao}
DAO directory. This is equivalent to {cf}\Microsoft Shared\DAO.
Shell Folder Constants
Inno Setup supports another set of directory constants, referred to as shell folder constants. They can be used in the same way as the other directory constants.
The "user" constants below refer to the currently logged in user's profile. "common" constants refer to the All Users profile.
Except where otherwise noted, shell folder constants work on all versions of Windows that Inno Setup supports, including Windows 95 and NT 4.0.
* = The "common" form of this constant is mapped to the "user" form if the logged-in user lacks administrative privileges, or if the operating system is Windows 95/98/Me.
{group}
The path to the Start Menu folder, as selected by the user on Setup's Select Start Menu Folder wizard page. On Windows NT platforms, this folder is created under the All Users profile unless the user installing the application does not have administrative privileges, in which case it is created in the user's profile.
{localappdata}
The path to the local (nonroaming) Application Data folder.
{sendto}
The path to the current user's Send To folder. (There is no common Send To folder.)
{userappdata} & {commonappdata}
The path to the Application Data folder.
{userdesktop} & {commondesktop} *
The path to the desktop folder.
{userdocs} & {commondocs}
The path to the My Documents folder (or on NT 4.0, the Personal folder).
{userfavorites} & {commonfavorites} *
The path to the Favorites folder. Usage of these constants requires a MinVersion setting of at least "4.1, 4". Only Windows 2000 and later supports {commonfavorites}; if used on previous Windows versions, it will translate to the same directory as {userfavorites}.
{userprograms} & {commonprograms} *
The path to the Programs folder on the Start Menu.
{userstartmenu} & {commonstartmenu} *
The path to the top level of the Start Menu.
{userstartup} & {commonstartup} *
The path to the Startup folder on the Start Menu.
{usertemplates} & {commontemplates} *
The path to the Templates folder. Only Windows 2000 and later supports {commontemplates}; if used on previous Windows versions, it will translate to the same directory as {usertemplates}.
to do the same thing during install time use the header code as[InstallDelete]


5 comments:
thanks a lot.
Great Help Dear ... thank you verymuch .
Keep sharing such information..
Hi There,
Is there also an option to determine if the windows system has its system dir in WINNT or Windows?
Is there a way not to delete all files.
tenkz, from Brazil!!
Post a Comment