Lovely-XPP / OCUpdater

Utility for hackintosh user to update OpenCorePkg and main kexts
3 stars 1 forks source link

OCUpdater detects VirtualSMC wrong version and always offers an upgrade #3

Closed perez987 closed 1 year ago

perez987 commented 1 year ago

Good night.

All existing kexts in my EFI folders are well detected by OCUpdater with the right version but VirtualSMC is detected as 0.3.1 instead of the right 1.3.1 and the script always says that there is an update available. I type UA, kext is updated, no error message but, after that, it shows again version 0.3.1 and update available. I can't find 0.3.1 nowhere.

OCUpdater outputs this about VirtualSMC in the kexts info:

VirtualSMC
     [Remote Version]  1.3.1 (2022-08-06 14:34:12)
     [Local Version]   0.3.1 (2021-11-07 12:01:24)
     [Installed Kexts]   
           SMCRadeonGPU.kext
           SMCSuperIO.kext
           SMCProcessor.kext
           VirtualSMC.kext
     [Status]  Update Available

But VirtualSMC really is 1.3.1, as seen in file info:

vsmc info

And also in Contents/Info.plist:

vsmc info plist
perez987 commented 1 year ago

Noticed that removing the specific code for the kext:

           # VirtualSMC
            if kext0[0:3].upper() == 'SMC' or kext0.upper() == 'VIRTUALSMC':
                try: 
                    local['VirtualSMC']['kexts'].append(kext)
                except:
                    plist_name = os.path.join(kext_full, 'Contents/Info.plist')
                    with open(plist_name, 'rb') as pl:
                        plist = load(pl)
                        ver = plist['CFBundleVersion']
                        pl.close()
                    time = self.get_time(plist_name)
                    local['VirtualSMC'] = {'time': time, 'version': ver, 'kexts': [kext]}
                continue

keeping only the generic code:

            # in kexts_list: save time and kext name
            plist_name = os.path.join(kext_full, 'Contents/Info.plist')
            with open(plist_name, 'rb') as pl:
                plist = load(pl)
                ver = plist['CFBundleVersion']
                pl.close()
            time = self.get_time(plist_name)
            local[kext0] = {'time': time, 'version': ver, 'kexts': [kext]}
        return local

VirtualSMC version is ok and OCUpdater doesn't offer any update and seems to run fine.

Lovely-XPP commented 1 year ago

Sorry about that, I will check the code later. The specific code is needed, because VirtualSMC is not a kext, but a package with many kexts. So I need to collect the local kext that have installed before, so that update the kexts only installed.

perez987 commented 1 year ago

Last code has fixed this, now VirtualSMC version is ok and it says Kexts: Up-to-date. Thanks.

VirtualSMC
     [Remote Version]  1.3.1 (2022-08-06 14:34:12)
     [Local Version]   1.3.1 (2022-11-10 19:39:16)
     [Installed Kexts]   
           SMCRadeonGPU.kext
           SMCSuperIO.kext
           SMCProcessor.kext
           VirtualSMC.kext
     [Status]  Up-to-date
Lovely-XPP commented 1 year ago

Thanks for your feedback :)