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

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
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.
Answered 12/15/2008 by: AngelD
Red Belt

Please log in to comment
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.
Answered 12/15/2008 by: chichora2003
Orange Belt

Please log in to comment
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.
Answered 12/16/2008 by: VBScab
Red Belt

Please log in to comment
0
if you are adding the CA in Immediate then make sure that you place it before InstallIntialize or after InstallFinalize.it should work
Answered 12/16/2008 by: shweta_kar
Blue Belt

Please log in to comment
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...
Answered 12/16/2008 by: VBScab
Red Belt

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