Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Failed 'nidaq' adaptor registration
Date: Thu, 10 Apr 2008 15:02:05 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 90
Message-ID: <ftla5d$4lf$1@fred.mathworks.com>
References: <fqrl08$l5r$1@fred.mathworks.com> <fr3e70$g2u$1@fred.mathworks.com> <fre2av$45l$1@fred.mathworks.com> <freb80$cmf$1@fred.mathworks.com> <frlmnj$1m8$1@fred.mathworks.com> <frlq6c$2rt$1@fred.mathworks.com> <ftj3af$eaj$1@fred.mathworks.com> <ftjaf8$sap$1@fred.mathworks.com> <ftjqq9$iaj$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1207839725 4783 172.30.248.38 (10 Apr 2008 15:02:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 10 Apr 2008 15:02:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 796075
Xref: news.mathworks.com comp.soft-sys.matlab:462220



Hi RC,

Under extremely rare circumstances, users with
Administrative privileges may not have permissions to modify
the registry under Vista.  Before proceeding you should
check the following:

1) Contact your IT department and/or verify that you
actually have administrative privileges.  Administrative
privileges are always required to register Data Acquisition
Toolbox adaptors.  

2) If you are using Windows Vista with User Account Control
(UAC) enabled, you need to verify that you are running
MATLAB in elevated mode.

3) Execute the following command in MATLAB.  

system(['regsvr32 '
fullfile(matlabroot,'toolbox','daq','daq','private','mwnidaqmx.dll')])

The dialog box should produce an error message saying the
"Return code was: 0x8007005".  This error code means
E_ACCESSDENIED.  If the command produced a different error,
then you have a different issue.

If you are confident that both of the above are satisfied,
the issue may be that users in the "Administrators" group do
not have permissions to modify or create the necessary
registry keys.  Each key in the registry has its own
permissions settings.

In order to resolve this issue, you need to track down the
individual keys for which you do not have permissions and
modify the permissions of those keys.  One way to do this is
to use Process Monitor.   Process Monitor is an advanced
monitoring tool for Windows that shows real-time file
system, Registry and process/thread activity.  Process
Monitor can be downloaded from:

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

After installing Process Monitor, start the application and
have it capturing events.  please have it monitor the
registering of DLL. You can then execute the following
command again:

   system(['regsvr32 '
fullfile(matlabroot,'toolbox','daq','daq','private','mwnidaqmx.dll')])

Then stop the event capture.  Process Monitor should have at
least one entry with an Access denied error.  The Process
monitor generates quite a lot of output in one second. Make
sure to stop monitoring quickly after the above command has
completed.

For example, you may see that you do not have permissions to
set the registry entry "HKCR\mwnidaqmx.adaptor.1".  Below is
the Process Monitor line where the error is reported.  The
output below was exported into CSV format.

"28381","3:10:18.6384469
PM","regsvr32.exe","1364","RegCreateKey","HKCR\mwnidaqmx.adaptor.1","ACCESS
DENIED","Desired Access: Set
Value","C:\WINDOWS\system32\regsvr32.exe","regsvr32
mwnidaqmx.dll"

This means that you can not set this specific key or perhaps
its parent key.  HKCR stands for "HKey_CLASSES_ROOT".  In
order to remedy the issue you will need to modify the
permissions in the registry.  Modifying the registry is
risky; therefore we recommend backing up the registry and
any critical data on the computer prior to proceeding.

What you need to do is run "regedit" (from Start->Run) and
then right-click the HKey_CLASSES_ROOT top level folder and
select "permissions".  If necessary change the permissions
on the key to grant local Administrators &#8216;Full Control&#8217;.
Below are some screen shots showing permissions from a good
entry.  If this key already has full control then search for
the subkey "mwnidaqmx.adaptor.1" and verify its permissions.
 Then try registering mwnidaqmw.dll again.  

This may not resolve the issue completely, as other keys may
also be affected.  You may need to repeat the process of
using Process Monitor to find what commands fail with the
"ACCESS DENIED" error message and adjust their permissions also.

Let us know how you make out,
Sherryl