Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Registry

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
Plumppudding
Asked:
Plumppudding
  • 3
  • 2
1 Solution
 
AzraSoundCommented:
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
 
PlumppuddingAuthor Commented:
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
 
AzraSoundCommented:
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
 
PlumppuddingAuthor Commented:
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
 
AzraSoundCommented:
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now