Registering files (dll, ocx, exe)
Posted 27 November 2003 - 18:21
does someone know the difference between register a file and share it ?
Because I have some files to copy in WINSYSDIR but for some of these files, I have to only register them, for other I have to share them, and twice for the rest.
In the XCopyFile function, it says "Always use SELFREGISTER together with the SHAREDFILE option, combining them with the bitwise OR operator".
But does this matter if I use only one option ?
In fact, I would have prefered to use XCopyFile with COMP_UPDATE_VERSION ONLY, and then register the files with regsvr32.exe.
The reason is that I want to uninstall these files by a different project, and with DeleteFile function, I can not unregister the files. But I could do it with regsvr32.exe /u.
I saw there were the UseDLL functions too.
I would like to have your opinion.
Posted 03 December 2003 - 15:58
SHAREDFILE: Is a indication if this file is shared with other installations/applications. If you use SHAREDFILE a ref.count will be added to the registry [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs] when the ref.count is 0 the file will be uninstalled.
Normally I would not suggest you to use regsvr32 instead of SELFREGISTER (Selected in the "File Groups" view). If you use regsvr32 you will have to unregister the files as well during uninstallation.
You should not use the UseDLL function for this. Use LaunchApp function instead.
Posted 02 February 2004 - 16:48
--> Please where in the registry ? and which entries ?
So, when you register a new dll file, an entry is created in the registry and the count is set to one.
If you want to update this file, by overwriting the existing file, do you need to unregister it and to re-register it afterwards ?
I mean, is the entry is just a link with the complete name of the file (with the path) and the count, or is there more than that ?
Posted 03 February 2004 - 08:49
Posted 03 February 2004 - 18:57
For the uninstall, how to unregister AND unshare ?
To unregister, there is regsvr32 /u of course, but to unshare, do I need to do count -1, and if count=0 then I can delete the file ?
Posted 04 February 2004 - 13:16
During update you should unregister the old version and re-register the new version if the registry information (CLSIds etc.) have changed.