When uninstalling the App my msi leaves a folder behind and i wanna know if there is any other way of deleting that folder instead of writing a Vbscript in custom actions?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
I suspect that this is because the application is creating files in that folder that your MSI didn't include. It should be obvious that an uninstaller won't, by default, remove objects which it didn't install. You could try creating and installing a 'dummy' file which hopefully the app would overwrite. Not all apps are happy about that, though. Alternatively, your authoring tool should have an option to remove files on uninstall. Finally, if it doesn't, you need to manipulate entries in the RemoveFiles table.
Answered 11/07/2007 by: VBScab
Red Belt

Please log in to comment
0
If this left behind folder is an empty folder then add it using the CreateFolder table and it will be removed during uninstall (if it's empty).
Otherwise you will have to use the RemoveFile table as Ian suggested or have a custom action removing the folder and its content.
Answered 11/07/2007 by: AngelD
Red Belt

Please log in to comment
0
You could also create a simple custom action to force the removal of the directory upon uninstall only.
Answered 11/07/2007 by: Coriolus
Orange Belt

Please log in to comment
0
I would suggest creating a custom action. use this vbscript.

dim filesys, folder1
set filesys = CreateObject ("Scripting.FileSystemObject")
set folder1 = filesys.GetFolder("c:\program files\APPNAME\")
folder1.Delete

G[:)][:)]DLuck!
Answered 11/07/2007 by: fsubzwari
Senior Yellow Belt

Please log in to comment
0
i get this error after uninstalling

ERROR 1720 : There is a problem with this windows installer package. A script is required for this install to complete could not be run. Custom action deleting folder script error , Microsoft VBScript runtime error.Path not found Line 3 , Column 1.

This is how my custom action looks like

dim filesys, folder1
set filesys = CreateObject ("Scripting.FileSystemObject")
set folder1 = filesys.GetFolder("c:\program files\APPNAME\")
folder1.Delete

Install exec seq= AfterInstallFinalize
InstallExec Cond=REMOVE="ALL"
Answered 11/08/2007 by: chichora2003
Orange Belt

Please log in to comment
0
As the error states, the directory path could not be found.
So if the directory exist you would use the bellow instead without the trailing '\'
set folder1 = filesys.GetFolder("c:\program files\APPNAME")

When you get the code working add
On Error Resume Next
Answered 11/08/2007 by: AngelD
Red Belt

Please log in to comment
0
One of the problems with using properties in CAs is that paths are resolved with trailing backslash but many tools don't like them. If you're using a property to determine the folder name, you'll need tp add some code to strip the trailing backslash. Make sure you test for one first, though!
Answered 11/09/2007 by: VBScab
Red Belt

Please log in to comment
0
Hi Coriolus

Can you tell me what should i put in the custom action ?
Answered 11/09/2007 by: chichora2003
Orange Belt

Please log in to comment
0
Angel i 've tried without the backslash it doesn't work still same error . Can some of you guyz tell me how to do the CreateFolder technique in the table?

Thanks guys
Answered 11/09/2007 by: chichora2003
Orange Belt

Please log in to comment
0
Here is an example for the "C:\Program Files\MY PACKAGE\EMPTY" directory
Replace "{C506A086-DBD1-4936-8DA2-E9BF08F27A1E}" with your own Component GUID (ComponentId column)

Component table
Component ComponentId Directory_ Attributes Condition KeyPath
CreateFolder {C506A086-DBD1-4936-8DA2-E9BF08F27A1E} EMPTY 0

CreateFolder table
Directory_ Component_
EMPTY CreateFolder

Directory table
Directory Directory_Parent DefaultDir
INSTALLDIR ProgramFilesFolder MYPACK~1|MY PACKAGE
EMPTY INSTALLDIR EMPTY

FeatureComponents table
Feature_ Component_
Complete CreateFolder
Answered 11/09/2007 by: AngelD
Red Belt

Please log in to comment
0
Did you try moving your CA up in the sequence order? Preferably right before InstallFinalize instead of after?
Answered 11/09/2007 by: danr29
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity