Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows::regsvr32 files getting registered multiple times. template code that runs on unless doesn't always find registered control #11

Open
schnitty opened this issue Sep 14, 2016 · 0 comments

Comments

@schnitty
Copy link

I have a legacy piece of software that I am supporting that needs to register some OCX controls and DLL files. When using the windows::regsvr32 class some of my controls are registered on every puppet agent run.

I have had a bit of a look at the code and can see the powershell that is being used in the erb template for finding the CLSID entries in the registry. It would seem what is defined there isn't broad enough to find some controls that are registered with the regsrvr32 utility as it would seem that it isn't always consistent on where it puts it.

In my searching through the registry I found the CLSID in different spots for different controls.

msvbvm50.dll -- runs every time

HKLM\Software\Classes\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Classes\Wow6432Node\Interface\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Classes\Wow6432Node\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Wow6432Node\Classes\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

TeeChart.ocx -- only runs the first time -- unless statement correctly detects it

HKCR\Wow6432Node\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Classes\Wow6432Node\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Wow6432Node\Classes\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

TSGACAL.OCX -- runs every time

HKCR\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKCR\Wow6432Node\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKCR\Wow6432Node\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Classes\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Classes\Wow6432Node\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Wow5432Node\Classes\TypeLib\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

COMCTL32 -- only runs the first time -- unless statement correctly detects it

HKCR\Wow6432Node\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Classes\Wow6432Node\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
HKLM\Software\Wow6432Node\Classes\CLSID\{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

The only common element in those is:

HKLM:\SOFTWARE\Classes\*

So I have tested a bit of powershell that searches the registry for the CLSID from that path and returns exit 1 if it doesn't find a match and it works ok but of course takes a bit longer than a direct Test-Path.

I'm happy to make a pull request if you like to edit the erb template to run my updated powershell that does a broader search but thought I would raise this issue here first as it would have some performance impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant