Removing Registry Key in Windows Vista - 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!

jm2008
Posts: 62
Joined: Tue Jul 08, 2008 10:24 am

Removing Registry Key in Windows Vista

Hi,

I'm trying to run this script from Uninstallation (Advanced Installer 6.8) but I am not able to remove the registry key:

Function RemoveCrystalRegistry
'On Error Resume Next
Const HKEY_CLASSES_ROOT = &H80000000

strComputer = "."
strKeyPath = "Installer\Products\334A4D1453680B74CA87BEE6B7E40113"

Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
DeleteSubkeys HKEY_CLASSES_ROOT, strKeypath
End Function

Sub DeleteSubkeys(HKEY_CURRENT_USER, strKeyPath)
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")

objRegistry.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubkeys
If IsArray(arrSubkeys) Then
For Each strSubkey In arrSubkeys
DeleteSubkeys HKEY_CURRENT_USER, strKeyPath & "\" & strSubkey
Next
End If
objRegistry.DeleteKey HKEY_CURRENT_USER, strKeyPath
End Sub

I'm testing on Windows 2008 with UAC enabled.

Do I have so set specific settings in Advanced Installer for this script??

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Removing Registry Key in Windows Vista

Hi,

Please note that on Vista the custom actions which need Administrator privileges should run as Deferred with no impersonation. This way they will run under the local system account with full privileges. Note that this option can be used only for custom actions scheduled between "InstallInitialize" and "InstallFinalize".

Let me know if the problem persists even when using this option.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jm2008
Posts: 62
Joined: Tue Jul 08, 2008 10:24 am

Re: Removing Registry Key in Windows Vista

Hi Cosmin,

Thanks for your reply,

I did what you said, But it still not removing the registry key!!!! Is there any workaround for this issue? I'm trying to remove key from HKEY_CLASSES_ROOT, does it need special handling?

Thanks,
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Re: Removing Registry Key in Windows Vista

Hi,

Have you tried to run the script outside Advanced Installer. Does it work in this case ?

If the problem still persist please sent the AIP file (or a small test project reproducing this behavior) to support at advancedinstaller dot com so we can take a look.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”