Windows: Programmatically create compatibility mode registry key for DVD or CD

351 Views Asked by At

I'm looking to programmatically run through an installation disc and set the compatibility mode for hundreds of exe's & msi's. But I've run into a snag.

For files not on ROM the registry key created is:

HKCU\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers
D:\MyDirectory\MyFile.exe   REG_SZ   ~ WIN7RTM

But for files on ROM like a DVD or CD the registry key created is:

HKCU\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers
SIGN.MEDIA=<SomeHexValue> <LocalPath>   REG_SZ   ~ WIN7RTM

I'm looking to find out how the "SomeHexValue" is calculated. There is one archived post at msdn where it is suggested that the hex value is based on file size (then later retracted). But that is not the case for me on Server2019 or Server2016 as two different files with different names and sizes have the same hex value.

Anybody have an ideas here? I'm currently thinking is has something to do with the local path. Am hoping someone has run into this before. Pickings on the net seem very slim.

0

There are 0 best solutions below