This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to remove files and folders created by application during uninstall
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2010
08:12 PM
How to remove files and folders created by application during uninstall
Hi,
I have searched through the threads in this community, but still didn't find what I want. I guess there should be a very simple method to remove the files not created by the installer during uninstall, cuz this is a very common senario. Can anyone give me some idea?
Thanks,
I have searched through the threads in this community, but still didn't find what I want. I guess there should be a very simple method to remove the files not created by the installer during uninstall, cuz this is a very common senario. Can anyone give me some idea?
Thanks,
6 Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 28, 2010
07:21 AM
1) You can use RemoveFile table if you know name of file to delete.
(See msi help or MSDN)
2) Also you can use custom action.
(See msi help or MSDN)
2) Also you can use custom action.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 28, 2010
11:30 AM
Rouslan wrote:
1) You can use RemoveFile table if you know name of file to delete.
(See msi help or MSDN)
2) Also you can use custom action.
Thanks for your reply, Rouslan.
It looks like installscript custom action works for my senario. I will try these two method and post my results later
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 28, 2010
11:45 AM
Rouslan wrote:
1) You can use RemoveFile table if you know name of file to delete.
(See msi help or MSDN)
2) Also you can use custom action.
Rouslan, for the first method, how to set "Component" field in RemoveFile table? The file to be removed is not associated with any component, but generated by the application. Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 28, 2010
01:56 PM
Here's my solution:
senario: delete INSTALLDIR folder, all its subfolder and files during uninstallation
steps:
1. create an Installscript function:
#include "Ifx.h"
export prototype Fn_DeleteDir(HWND);
function Fn_DeleteDir(hMSI)
STRING strInstallDir;
NUMBER nSize;
begin
nSize = 256;
MsiGetProperty(hMSI,"INSTALLDIR",strInstallDir,nSize);
DeleteDir (strInstallDir, ALLCONTENTS);
end;
2. create a custom action to call above function, settings:
Function Name: Fn_DeleteDir
Return Processing: Synchronous
In-Script Execution: Immediate Execution
Execution Scheduling: Always execute
Install Exec Sequence: After InstallFinalize
Install Exec Condition: REMOVE = "ALL"
leave other settings by default
end steps.
My installscript code is not strong enough and I am not sure the custom action settings are appropriate, anyway it works as I expect.
reference:
http://community.flexerasoftware.com/showthread.php?t=193676&highlight=remove+files
senario: delete INSTALLDIR folder, all its subfolder and files during uninstallation
steps:
1. create an Installscript function:
#include "Ifx.h"
export prototype Fn_DeleteDir(HWND);
function Fn_DeleteDir(hMSI)
STRING strInstallDir;
NUMBER nSize;
begin
nSize = 256;
MsiGetProperty(hMSI,"INSTALLDIR",strInstallDir,nSize);
DeleteDir (strInstallDir, ALLCONTENTS);
end;
2. create a custom action to call above function, settings:
Function Name: Fn_DeleteDir
Return Processing: Synchronous
In-Script Execution: Immediate Execution
Execution Scheduling: Always execute
Install Exec Sequence: After InstallFinalize
Install Exec Condition: REMOVE = "ALL"
leave other settings by default
end steps.
My installscript code is not strong enough and I am not sure the custom action settings are appropriate, anyway it works as I expect.
reference:
http://community.flexerasoftware.com/showthread.php?t=193676&highlight=remove+files
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 29, 2010
01:41 AM
Ivan_mysammy wrote:
Rouslan, for the first method, how to set "Component" field in RemoveFile table? The file to be removed is not associated with any component, but generated by the application. Thanks
You can set any component. For examle:
FileKey: MyRandomKey123 (any uniq key for RemoveFile table)
Component_: MyExistingComponent (any existing component)
FileName: myFileToDelete.tmp (exact file name)
DirProperty: MYDIRECTORY (directory key from Directory table for your file location)
InstallMode: 2 (Remove only when the associated component (MyExistingComponent) is being removed)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 05, 2010
01:17 PM
Rouslan wrote:
You can set any component. For examle:
FileKey: MyRandomKey123 (any uniq key for RemoveFile table)
Component_: MyExistingComponent (any existing component)
FileName: myFileToDelete.tmp (exact file name)
DirProperty: MYDIRECTORY (directory key from Directory table for your file location)
InstallMode: 2 (Remove only when the associated component (MyExistingComponent) is being removed)
Thanks Rouslan, your method works!
