cydude
Posts: 16
Joined: Wed Mar 05, 2008 3:51 am

UAC prevents vbs script from deleting directory at uninstall

I have a vbs script that runs at uninstall and if a custom property is set, it deletes all subdirectories in the program folder using Scripting.FileSystemObject.DeleteFolder

This function does not work if the user is runing with UAC on. I've tried setting the execution option to "Deferred with no impersonation" but get the same results. Any ideas?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

If you are using a Deferred custom action then it cannot access installer properties directly. In order to pass the values of this type of properties you can use the Action Data field.

There is a similar discussion on the forum, please take a look:
http://www.advancedinstaller.com/forums ... php?t=3770

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
cydude
Posts: 16
Joined: Wed Mar 05, 2008 3:51 am

Can you comment to the main question which is why this script doesn't work when UAC is on, but works perfectly well when UAC is off? Thanks.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

How exactly does your custom actions fail? Does it give an error message? If so, what does this message states?

Can you please send us a copy of this custom action to support at advancedinstaller dot com so we can investigate it? Also, please send us the AIP which shows this behavior.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
cydude
Posts: 16
Joined: Wed Mar 05, 2008 3:51 am

I went ahead and followed your recommendations about using action data to pass the properties and chose "Deferred with no impersonation" and it worked. So my conclusion is that when UAC is active, custom actions must run with no impersonation to have the proper rights.

If you still want my script and aip please let me know. Thanks for all your help.

Return to “Common Problems”