Hey Guys,

i made a custom action to delete 2 folders under c:\program file that is laid by the msi. When i delete the package manually my custom action works but when i push it through the SMS it doesn't work. This is how my VB script looks like in the custom action.

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("C:\Program Files\Test1 2007")
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("C:\Program Files\Test2 2007")
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
Here... Add this function and just call it

fnFolderDelete ("C:\Program Files\Test1 2007")

Function fnFolderDelete(Path)
Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
If oFSO.FolderExists(Path) Then
oFSO.DeleteFolder Path,TRUE
End If
Set oFSO = nothing

End Function
Answered 10/25/2007 by: gmorgan618
Blue Belt

Please log in to comment
0
If it works 'manually', it should work in deployment.
- Are you logging the install? If so, has the Custom Action run?
- Where is your CA running, i.e. in which sequence?

On a point of order...you don't need to create the objFSO object again:

Dim objFSO
Const strFolder1 = "C:\Program Files\Test1 2007"
Const strFolder2 = "C:\Program Files\Test2 2007"
Set objFSO = CreateObject("Scripting.FileSystemObject")
With objFSO
If .FolderExists(strFolder1) Then
.DeleteFolder(strFolder1)
End If
If .FolderExists(strFolder2) Then
.DeleteFolder(strFolder2)
End If
End With
Set objFSO = Nothing
Answered 10/25/2007 by: VBScab
Red Belt

Please log in to comment
0
This is how my custom action looks like

Install Exec Seq= After InstallFinalize
Install Exec Con=REMOVEALL
Answered 10/25/2007 by: chichora2003
Orange Belt

Please log in to comment
0
Thanks VBSCAB it worked i had to change my condition to REMOVE="ALL" instead of REMOVEALL.

Thanks for the support again
Answered 10/25/2007 by: chichora2003
Orange Belt

Please log in to comment
0
yes i knew it!!

actually if the VBScript was running, it was only the MSI that had the problem! thanks to VBScab! [:)]
this person rocks!

However, it would be better if you included Folder deletion directly in the MSI rather than running the VBScript, unless there is any specific reason!

Merci!
Answered 10/29/2007 by: matrixtushar
Purple Belt

Please log in to comment
0
The following sections describe how to use record mode on Windows.
Using Record Mode
To record a new response file:
At the command prompt, use the cd command to change to the directory that contains the OUI executable file (setup.exe) for your installation.
Enter the following command:
setup -record -destinationFile <response_file_name> (on Windows)
Replace the <response_file_name> with the complete path for the new response file. For example:
setup -record -destinationFile C:\response_files\install_oracle910 (on Windows)
Use the OUI user interface to select your installation options. These will be recorded.
When OUI displays the Summary page, you can either continue with the installation or exit.
OUI saves your new response file using the path and file name you specified on the command line.
Answered 11/01/2007 by: chichora2003
Orange Belt

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