Link to home
Start Free TrialLog in
Avatar of Plumppudding
Plumppudding

asked on

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
Avatar of AzraSound
AzraSound
Flag of United States of America image

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.
Avatar of Plumppudding
Plumppudding

ASKER

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
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).
No my dll is not included in COM+ package. It was just registered using regsvr32. The dll has Full Control rights to Everyone.

Plumppudding
ASKER CERTIFIED SOLUTION
Avatar of AzraSound
AzraSound
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial