The Kinetic Jump site navigation header requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

Welcome Guest Search | Active Topics | Log In | Register

I get an error reading the registry on my custom action dll in applife Options
jorgerubio
#1 Posted : Friday, April 04, 2008 3:18:44 PM
Rank: Advanced Member
Groups: Member

Joined: 9/18/2007
Posts: 31

Custom Action Code:

myRegKey = Registry.ClassesRoot;

myRegKey = myRegKey.OpenSubKey("\\CLSID\\" + guid + "\\InprocServer32\\");

 

String[] subkeyNames = myRegKey.GetSubKeyNames(); <--i get an error here.

 

myRegKey.Close();

 

 

The error is : System.NullReferenceException. When i ran this code manually it runs fine. I only get this error when applife is updating on Vista with UAC enable

 

Could be a problem with the privilege token?

Do the uplife service elevates itself to admin?

brianh
#2 Posted : Saturday, April 05, 2008 5:17:47 AM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 362
Location: Minnesota

Hello Jorge,

 

The AppLife Update Service executes your action list update under the security context of the Local System Account.  The local system account uses a system level token under Vista, which has permissions to the registry.

 

The line in your code sample:

 

myRegKey = myRegKey.OpenSubKey("\\CLSID\\" + guid + "\\inProcserver32\\");

 

is returning an null reference.  Remove the leading slashes and this line will behave properly.

 

myRegKey = myRegKey.OpenSubKey("CLSID\\" + guid + "\\inProcserver32\\");

 

You might ask why does the original line work except when running under the local system account.  I dont know that answer.  I have succesfully tested this with and without the AppLife Update Service under XP and Vista (32 bit).  The rest I have not tested, but would expect no issues.

 

Brian Haas
Kinetic Jump Software
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.