Solved

Registry

Posted on 2003-11-05
5
261 Views
Last Modified: 2010-05-01
I am having couple of questions regarding registering a component in the registry.

Question 1:
In my development environment, I use component services to register a component and it works great. Now I use Package and Deployment Wizard(PDW) to create an installation version for the application. What I really want is that when I run the setup.exe (created by PDW), it should also register the component. I dont want the client to do it manually.

Condition1: Should be automatically registered when setup.exe is executed.
Condition2: My asp files should be able to use the component even when the machine is logged off. (Right now, I provide the user information in component services).


Question 2:
One of my asp pages uses Server.CreateObject to create an object using a component registered using component services. This object would then write some parameters to the registry. I should be able to do in such a way that any user who loggs on to the system should be able to read the value (which also would be from an asp page written by me). To summarize, the values I write to registry using asp should be accessable by all users.

TIA
Plumppudding
0
Comment
Question by:Plumppudding
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 9690730
1)
I havent used PDW in a long time, but I am pretty sure it is aware of which DLLs require self registration and it takes care of that for you once you include the file in your package.

Your asp files will be able to use the component if the IUSR_<machinename> account is given all necessary permissions to access that dll and any resources it requires.  Otherwise, you need to provide instructions to the client on how to create a COM+ package to assign an appropriate login's credentials to the component for it to run under


2)
Then you need to ensure you are writing to the HKLM hive.  This hive is system wide and identical across different logins.  Again, though, your component needs to have the permissions to do this.
0
 
LVL 1

Author Comment

by:Plumppudding
ID: 9814999
Hi Azra,

Sorry for responding so late.

I am now using an installer (Inno setup script) which registers my application using regserver.

The whole  application is installed and then I ran ConfigurationSetup.asp which takes in configuration parameters like logfile information, db information etc. After I click on Save, I read those values and call a method in my dll to add those configuration values in the registry.

  m_lngRetVal = RegCreateKey(lngRootKey, strRegKeyPath, lngKeyHandle)
  MsgBox m_lngRetVal

the message box shows 5. FYI, I installed the application as Administrator. The IIS website is configured to allow access to unauthenticated users.

To summarize, if I use regserver or regsvr32 to register my dll, I am not able to write to the registry with an Error number 5.

What am I missing?

TIA
Plumppudding
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 9815586
Was the DLL included into a COM+ package?  Even though the site is set to allow anonymous access, your dll, specifically, needs to ensure this is allowed for it as well.  If you right-click the dll (on a new NTFS system) you should be able to specify specific rights for it (ensure IUSR_<MachineName> user has all access rights).  Other issues are what system dlls your dll uses.  It can become quite frustrating pinpointing all folders/services that need to be configured to allow your dll the full access it needs.  If possible, I would configure it to be included in a COM+ package whereby you tell COM+ to give administrative rights to your dll, since it sounds like it needs fairly full access (esp. the ability to write to the registry).
0
 
LVL 1

Author Comment

by:Plumppudding
ID: 9819370
No my dll is not included in COM+ package. It was just registered using regsvr32. The dll has Full Control rights to Everyone.

Plumppudding
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 50 total points
ID: 9819570
Things you have to look at then are:

Does IUSR_<MachineName> have rights to access the registry?
Does IUSR_<MachineName> have rights to all areas the dll accesses (e.g., if it uses API it probably needs access rights to the system32 folder where the system dlls are located)?
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question