Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   problem with VISTA (http://www.outlookbanter.com/add-ins-outlook/60048-problem-vista.html)

sd[_2_] October 29th 07 03:48 PM

problem with VISTA
 
Hi All,
I have created one VSTo COM - addin for office 2007 in vb 2005. I have
seen that my code is not working if I access the hkey_Classes_Root or
hkey_local_machine through my code on windows VISTA. My code is
working fine on all OS except VISTA.
My code snippet for modifying HKEY_CLASSES_ROOT is as follows -
------------------------------------------------------------------------------------------------
Dim rk As Microsoft.Win32.RegistryKey
rk = Microsoft.Win32.Registry.ClassesRoot
With rk
.CreateSubKey(".asi",
Microsoft.Win32.RegistryKeyPermissionCheck.ReadWri teSubTree)
-------------- Error starting from this line
.OpenSubKey(".asi", True).SetValue("", "ASI.Document",
Microsoft.Win32.RegistryValueKind.String)
.CreateSubKey("ASI.Document\shell\open\command")
End With

------------------------------------------------------------------------------------------------
My user account is Administrator.
Also my trace file (trace.txt) is not generated if my addin's
directory is under "program files". If my addin's directory is not in
"Program files", then it is working fine!


Thanks,
Dhananjay


Vaelek December 6th 07 09:45 PM

problem with VISTA
 
Whether your account is administrator does not make you "Administrator" in
Vista's eyes. I've run into a number of permissions issues when working with
both the registry or modifying anything under \Program Files. I think you
need to elevate the priviledges in your code to get true Admin level rights.
Though I am not sure how to go about that.

"sd" wrote:

Hi All,
I have created one VSTo COM - addin for office 2007 in vb 2005. I have
seen that my code is not working if I access the hkey_Classes_Root or
hkey_local_machine through my code on windows VISTA. My code is
working fine on all OS except VISTA.
My code snippet for modifying HKEY_CLASSES_ROOT is as follows -
------------------------------------------------------------------------------------------------
Dim rk As Microsoft.Win32.RegistryKey
rk = Microsoft.Win32.Registry.ClassesRoot
With rk
.CreateSubKey(".asi",
Microsoft.Win32.RegistryKeyPermissionCheck.ReadWri teSubTree)
-------------- Error starting from this line
.OpenSubKey(".asi", True).SetValue("", "ASI.Document",
Microsoft.Win32.RegistryValueKind.String)
.CreateSubKey("ASI.Document\shell\open\command")
End With

------------------------------------------------------------------------------------------------
My user account is Administrator.
Also my trace file (trace.txt) is not generated if my addin's
directory is under "program files". If my addin's directory is not in
"Program files", then it is working fine!


Thanks,
Dhananjay




All times are GMT +1. The time now is 07:07 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com