[Project_owners] nsIWindowsRegKey.writeStringValue failing on Windows Vista

eric.jung at yahoo.com eric.jung at yahoo.com
Fri Apr 27 06:36:05 PDT 2007


You should be writing to HKCU, not HKLM.


----- Original Message ----
From: Brian King <brian at mozdev.org>
To: project_owners at mozdev.org
Sent: Friday, April 27, 2007 6:57:56 AM
Subject: [Project_owners] nsIWindowsRegKey.writeStringValue failing on Windows Vista

This is no doubt due to tightened user access on Vista, but I am even 
running as a user with Admin rights.

Anyone know a workaround?

Code:

var registry = Components.classes["@mozilla.org/windows-registry-key;1"].
                createInstance(Components.interfaces.nsIWindowsRegKey);
registry.open(registry.ROOT_KEY_LOCAL_MACHINE,
                "Software\\Microsoft\\Windows\\CurrentVersion\\Run",
                registry.ACCESS_WRITE | registry.ACCESS_READ);
registry.writeStringValue("MyApp", '"c:\foo"');

Exception:

[Exception... "Component returned failure code: 0x80004005 
(NS_ERROR_FAILURE) [nsIWindowsRegKey.writeStringValue]"  nsresult: 
"0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: 
chrome://<snipped>/file.js :: functionX :: line 81"  data: no]

-- 
Brian King
www.mozdev.org - free project hosting for the Mozilla community
_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070427/b7747ede/attachment.html 


More information about the Project_owners mailing list