Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Uninstall doesn't delete folders...


4 replies to this topic

ClydeMontreal

ClydeMontreal
  • Members
  • 15 posts

Posted 12 June 2003 - 22:18

I created a CA called SetDir. This CA is called to change one of my destination directory. (It is called after CostFinalize in InstallExecuteSequence) The folder is created successfully on install, but the problem comes on Uninstall. The uninstall won't delete the folder that is created by SetDir.

GeoffreyF67

GeoffreyF67
  • Members
  • 8 posts

Posted 12 June 2003 - 22:23

The method I use to create an empty folder that is associated with a component is to put an entry in the CreateFolders table. This folder gets removed on uninstall automatically as long as it's still empty.

G-Man

luke_s

luke_s
  • Full Members
  • 532 posts

Posted 13 June 2003 - 08:42

Windows Installer will only remove folder that it has knowledge of and this is why external folders created in custom actions do not get removed.
You can either create a dummy folder (like Geoffrey has said) or create another custom action to clean up these folders.

sk_jain2000

sk_jain2000
  • Members
  • 8 posts

Posted 10 July 2003 - 06:41

U can use this vb script to remove folders and files created at run time aswell...

Dim fso,sPath
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemobject")
sPath = Trim(session.property("INSTALLDIR"))
sPath = Left(sPath,Len(sPath)-1)
If fso.FolderExists(sPath) Then
FSO.deleteFolder sPath, True
End If
Set fso = Nothing

Cheers
Sunil

sk_jain2000

sk_jain2000
  • Members
  • 8 posts

Posted 11 July 2003 - 06:05

Example: Removedir=c:\program files\ToBeRemoved

Dim fso,sPath
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemobject")
sPath = Trim(session.property("Removedir"))
sPath = Left(sPath,Len(sPath)-1)
If fso.FolderExists(sPath) Then
FSO.deleteFolder sPath, True
End If
Set fso = Nothing

Cheers
Sunil Jain