custom action fails uninstall process - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

custom action fails uninstall process

Hi,
on windows 7 with UAC disabled I experience uninstall failure if some custom action added as an attached vbscript, running a command from cmd to uninstall a driver:

Function RemoveWFPDriver()
WriteToLog("removing driver")
ReturnCode = WFPRun("rundll32 syssetup,SetupInfObjectInstallAction DefaultUninstall 128 .\tcpredirector.inf")
WriteToLog("Return Code (2): " & ReturnCode)
RemoveWFPDriver = ReturnCode
End Function

(the WFPRun function is as follows and it works ok during installation:
Function WFPRun(ByVal cmd)
Set shell = CreateObject("WScript.Shell")
shell.CurrentDirectory = Session.Property("CustomActionData") & "bin"
WFPRun = shell.Run(cmd, 1, true)
Set shell = Nothing
End Function
)

In the log I can see that the failure happens on the custom action delete.resources under RemoveFolders entry. If I exclude the action, related to RemoveWFPDriver, then uninstall works ok (obviously the driver does not get uninstalled then).
Both install scripts are attached.
Attachments
Client_without_uninstall_action.aip
(172.11 KiB) Downloaded 285 times
Client_with_uninstall_action.aip
(172.59 KiB) Downloaded 297 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: custom action fails uninstall process

Hi,

The custom action is set as "Deferred with no impersonation", so there is no problem with privileges on the machine.

Most likely the custom action has a return code different from success. You will need to debug the two functions
in order to see where is the problem.

An easy way to debug VBScript custom actions is by placing calls for the function "MsgBox" in your code.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: custom action fails uninstall process

Hello Bogdan,

I already tried to debug - both custom actions work ok separately (when another one is excluded from the aip script). However, when they are both present in the script, the following thing happens on uninstall:
1. driver uninstalls ok
2. an attempt is taken to remove the product folder, this tries to remove all the subfolders, but fails to remove one subfolder which contains my driver's .sys and .inf files. I tried to put those files in different folders, and always that folder end up being locked - I cannot remove it, even manually, - looks like some process (msiexec?) is still using it. If I exclude the custom action from the RemoveFolders (which does product folder removing), all the subfolders in the product folder are getting removed anyway, except the subfolder, containing my .sys/.inf files, but I want that subfolder to be removed as well as the product folder.

Thanks,
Alex.
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: custom action fails uninstall process

Also - I tried to put the .sys and .inf files into system32 folder - the driver uninstall is still ok (and these files get removed after uninstall), but in my product folder there is still one subfolder left with one file in it, having no relation to the driver at all :?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: custom action fails uninstall process

Hello,

To remove all the unwanted folders, you can try our Uninstall Cleanup Wizard from the Files and Folders page.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
doolav
Posts: 23
Joined: Mon Dec 13, 2010 1:29 pm

Re: custom action fails uninstall process

Fixed this one!
"Historically" we used to add all new custom actions in the same vbs file. I just created a new vbs for my install/uninstall driver custom actions, and it all works now.
Still interested in comments as of why is it like this?

Thanks,
Alex.

Return to “Common Problems”