/build/static/layout/Breadcrumb_cap_w.png

VBScript Uninstalling MSI Issue

I am creating 2 Custom Actions in Installshield.
1)AddNetworkDrive= This is basically just adding Network drives
2)DeleteNetworkDrive= This Custom action Delete Network Drive if its mapped already.


1)AddNetworkDrive Custom Action Vbscript looks like this

Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "H:", "\\allan\xyz"
objNetwork.MapNetworkDrive "I:", "\\allan\xyz"
objNetwork.MapNetworkDrive "J:", "\\allan\xyz"
objNetwork.MapNetworkDrive "K:", "\\allan\xyz"

Install Exec Sequence= After InstallInitialize
Install Exec Condition= "NOT Installed"

2)DeleteNetworkDrive Custom Action has the following script

Set oShell = CreateObject("WScript.Shell")
Set oNetwork = CreateObject("WScript.Network")
dr = "H:"
oNetwork.RemoveNetworkDrive dr, True, True
drv = "I:"
oNetwork.RemoveNetworkDrive drv, True, True
dr = "J:"
oNetwork.RemoveNetworkDrive dr, True, True
drv = "K:"
oNetwork.RemoveNetworkDrive drv, True, True

Install Exec Sequence= After InstallFinalize
Install Exec Condition= REMOVE="ALL"

Upon Uninstalling the msi i get the following error
ERROR 1720.There is a problem with this windows Installer package. Custom action AddNetworkDrive script error -2147024811.

Any help guys with the error?

0 Comments   [ + ] Show comments

Answers (5)

Posted by: AngelD 15 years ago
Red Belt
0
If you sequence the vbscript custom action in deferred execution the local system account will be executing the CA which does not have network access. So that should be the main problem why you get the error.
Posted by: chichora2003 15 years ago
Orange Belt
0
I have a Immediate Execution in my custom action. I removed "" Install Exec Condition= NOT Installed
this works fine only if i don't have the drives mapped already.
Posted by: anonymous_9363 15 years ago
Red Belt
0
SHOCK! A script with ZERO error-trapping!

You can go the brain-dead way and add an 'On Error Resume Next' and simply ignore any errors or you could add a test for the drive's existence before trying to remove it.
Posted by: shweta_kar 15 years ago
Blue Belt
0
if you are adding the CA in Immediate then make sure that you place it before InstallIntialize or after InstallFinalize.it should work
Posted by: anonymous_9363 15 years ago
Red Belt
0
if you are adding the CA in Immediate then make sure that you place it before InstallIntialize or after InstallFinalize.it should workNot without adding some error-trapping it won't...
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ