Solved

Registry

Posted on 2003-11-05
5
255 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
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now