how does the .RGS file works
Asked Answered
C

1

12

In the .rgs file, there are some registry info, and I want to know how does the info in .rgs file added into regetry?

I have a project AAA and it will generate the file AAA.DLL, and there is a file xxx.rgs which contains the registry info, and the AAA.DLL is built, then it will be deployed to another machine B, so I don't know how the registy info can be added on machine B, do I need register AAA.dll using regsvr32 command?

Cariecaries answered 28/9, 2010 at 8:3 Comment(0)
C
14

Usually your code calls CComModule::UpdateRegistryFromResource() which in turn passes control to a special mechanism implemented in ATL which does the job - parses the resource that was produced by embedding the .rgs file into the module and edits the registry. ATL comes with sources so you can just read how it is done.

Capsize answered 28/9, 2010 at 8:8 Comment(6)
Also it lloks like using ATL is the only intended way to use .rgs files: #1594783Capsize
I have a project AAA and it will generate the file AAA.DLL, and there is a file xxx.rgs which contains the registry info, and the AAA.DLL is built, then it will be installed in another machine B, so I am wondering how the registy info added in machine B, do I need register AAA.dll using regsvr32 command?Cariecaries
@Carlos_Liu: Your DLL project will usually have an .rc file that will contain a reference to that .rgs file. When the DLL is compiled the .rgs file contents is emdebbed as a resource. Later you call regsvr32, it loads the DLL, runs DllRegisterServer() which in turn calls CComModule::UpdateRegistryFromResource(), which loads the .rgs file contents from the resources of that DLL, parses it and modifies the registry.Capsize
so on machine B, I need to register it by using regsvr32.exe command, right? Is there any other ways to register that DLL?Cariecaries
regsvr32 is the standard way of registering in-proc COM servers, you hould stick to it unless you have real reasons against it. Do you have real reasons against it?Capsize
You should be able to use Registration-free COM (a.k.a. side-by-side assemblies) to avoid using regsvr32. It's not very well documented though.Bearded

© 2022 - 2024 — McMap. All rights reserved.