tylerszabo / RGB-Fusion-Tool

A command line tool for calling Gigabyte's RGB Fusion SDK
GNU General Public License v3.0
184 stars 21 forks source link

Error: System.DllNotFoundException: Unable to load DLL 'GvLedLib.dll' #40

Open shifatul-i opened 6 years ago

shifatul-i commented 6 years ago

MB Z370 Gaming 7

Note: Recently uninstalled App Center & RGB Fusion

CMD RGBFusionTool.exe --list

Error

C:\Users\Denocyte\Downloads\RGBFusionTool_v0.9.3>RGBFusionTool.exe --list
Zone 0: A_LED
Zone 1: A_LED
Zone 2: A_LED
Zone 3: A_LED
Zone 4: A_LED
Zone 5: NA
Zone 6: NA
Zone 7: D_LED_TYPE_2
Zone 8: D_LED_TYPE_2
Usage: RGBFusionTool.exe [OPTION]... [[LEDSETTING] | [ZONE LEDSETTING]...] [
peripherals GVSETTING]
Set RGB Fusion motherboard LEDs

Options:
  -v, --verbose
.
.
.

Error: System.DllNotFoundException: Unable to load DLL 'GvLedLib.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at GvLedLibDotNet.Raw.GvLedLibv1_0Impl.dllexp_GvLedInitial(Int32& iDeviceCount, Int32[] iDeviceIdArray)
   at GvLedLibDotNet.Raw.GvLedLibv1_0Impl.GvLedInitial(Int32& iDeviceCount, Int32[] iDeviceIdArray)
   at GvLedLibDotNet.Raw.GvLedLibv1_0Wrapper.Initialize()
   at GvLedLibDotNet.RGBFusionPeripherals.<.ctor>b__3_0()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at GvLedLibDotNet.RGBFusionPeripherals.get_Devices()
   at RGBFusionTool.Application.Main(String[] args)

Files image

tylerszabo commented 6 years ago

What are the hashes of the files?

Powershell:

    @("GLedApi.dll", "GLedApiDotNet.dll", "layout.ini", "Mono.Options.dll", "RGBFusionTool.exe", "ycc.dll", "GvLedLib.dll", "GvLedLibDotNet.dll", "GvDisplay.dll", "GvBiosLib.dll") | % { Get-FileHash -Algorithm SHA256 -Path $_ }

In addition if you could look at use the Dependencies tool on GvLedLib.dll that can show if there's a missing DLL (and then I can look about packaging it).

shifatul-i commented 6 years ago

image

It is not listing my RGB Ram anymore but it used to do before when RGB Fusion was installed. Now it throws an error message when I run RGBFusionTool.exe --list

tylerszabo commented 5 years ago

Okay, those are all the right files. in that case could you definitely use Dependencies on GVLedLib.dll to find out what's missing.

tylerszabo commented 5 years ago

I took another look with Dependencies on my end and it seems that the GvLedLib has a dependency on Visual C++ Redistributable for Visual Studio 2012. It's possible that gets installed with Gigabyte's RGB Fusion app.

shifatul-i commented 5 years ago

Already installed 😕 image

tylerszabo commented 5 years ago

In that case could you use Dependencies to tell me what you're missing?

WheatTail commented 5 years ago

Hi. I have the same issue. I've used Dependencies and figured out that it's mfc110ud.dll and MSVCR110D.dll are missing. Google says that vcredist 2012 contains it BUT i've installed both (x86 and x64) and the didn't appear. I've tryed to download dll directly and put it into RGBFusion folder but it didn't work. default default default

WheatTail commented 5 years ago

Okay, mfc110d now checked as exist but msvcr110d still not. I've deleted vcredist 2012, installed it again, downloaded this dll manually - no success. default

WheatTail commented 5 years ago

Soo strange. Dependencies still say "MSVCR110D.dll is missing", but PS C:\Users\Amon\Desktop\rgbft> .\RGBFusionTool.exe --list Zone 0: A_LED Zone 1: A_LED Zone 2: A_LED Zone 3: A_LED Zone 4: A_LED Zone 5: NA Zone 6: NA Zone 7: D_LED_TYPE_2 Zone 8: D_LED_TYPE_2 Peripheral 0: Mouse_Pad_AORUS_P7 Peripheral 1: 20481 PS C:\Users\Amon\Desktop\rgbft> --list works propely (almost). 20481 - is ??? it's 5001 device, have no idea. In list no 5xxx devices. But how to control peripherals? There's no example in your readme.

With latest DLL's from official RGB Fusion (hey they're newer than in SDK) GvLedLib.dll, GvDisplay.dll GvIllumLib.dll (new GvLedLib dependence on it) your program affect M5 mouse too. But --list shows 3 peripherals when i have only two: PS C:\Users\Amon\Desktop\rgbft> .\RGBFusionTool.exe --list Zone 0: A_LED Zone 1: A_LED Zone 2: A_LED Zone 3: A_LED Zone 4: A_LED Zone 5: NA Zone 6: NA Zone 7: D_LED_TYPE_2 Zone 8: D_LED_TYPE_2 Peripheral 0: Mouse_Pad_AORUS_P7 (my P7) Peripheral 1: 12291 (my M5) Peripheral 2: 20481 (???)

Also your digital-a works as official RGB Fusion Digital Wave on MB. And digital-a if official RGB Fusion works different way.

BenLiyanage commented 5 years ago

The 20481 is your ram. Same on my box.

BenLiyanage commented 5 years ago

I am having this same problem when trying to compile and build the source code. There are no missing dependencies when I load the GvLedLib.dll into the dependency viewer that you referenced. Any tips on building this project?

tylerszabo commented 5 years ago

@BenLiyanage perhaps GLedApi.dll? The .NET DLLs depend on .NET 4.6.

tylerszabo commented 5 years ago

@WheatTail I saw some additional IDs in the example files that weren't in the documentation so it might be related to those. Setting the LEDs there will need more work - peripheral support is a bit awkward. I'm debating pulling it out of the main releases and extending that in a separate branch because of the problems it's causing (especially with dependencies). I've reached out to Gigabyte to ask if they can package with the missing dependencies but they went silent.

WheatTail commented 5 years ago

@BenLiyanage , uh? But my RAM is just Crucial Ballistix Elite, not an AORUS RGB RAM, it haven't LEDs at all.

@tylerszabo , i've forked your project and add my M5 correct recognizing, also add color cycle mode for peripheral using your ColorCycleGvLedSetting.cs file by adding parser for it and it's work as in official RGB Fusion. Now trying to add pulse mode but it works... Weird. Ignoring color settings. I need to work on it. I also submit a ticket in support and they're silent too. SDK guide is just a crap.

BenLiyanage commented 5 years ago

The DLL's do not show up in the bin/debug folder. If I copy them there manually it also does not work. When I use the pre-compiled distribution everything works fine.

BenLiyanage commented 5 years ago

@WheatTail my ram is a corsair model. It's possible that 0x5001 is a grab bag for ram.

BenLiyanage commented 5 years ago

@tylerszabo Visual Studio says I have 4.7 installed. That should be sufficient correct?

BenLiyanage commented 5 years ago

I have figured out my issue--I needed to copy these two DLLs into the build directory also:

Are these supposed to be compiled into the project some how? Where do they come from if they are not coming from the SDK?

tylerszabo commented 5 years ago

@BenLiyanage I had to pull them from other releases because the officially packaged ones were missing dependencies. Glad you got the compile working. Dependencies are certainly an issue with this project. I think it's probably time I prioritize issue #25.

@WheatTail - cool, if you get it working and write some test coverage for it please submit a PR :)

WheatTail commented 5 years ago

@BenLiyanage , okay, probably RGB Fusion detects RAM all time have it LEDs or not. GvDistplay.dll and GvBios.dll you can get by installing latest official RGB Fusion BUT you also need GvIllumLib.dll, don't forget it

@tylerszabo , color cycle works pretty nice at this time but strange dependece from speed parameter. Than more speed - than slower P7 colors change and faster (till some point, 11 i guess) M5, and vice versa: than lower speed - than faster P7 LEDs color change and slower M5. But i have the same issue with official RGB Fusion. Probably it depends from M5 firmware. Without documentation it's a bit complicated. I've submit another ticket to Gigabyte techsupport and they say that this 35 crappy guide is all they have. I don't believe them... But it can explain why their own RGB Fusion tool so bad.

Emu1981 commented 5 years ago

I am having the same issues with the "Unable to load DLL 'GvLedLib.dll". The issue appears to be that Gigabyte links the GvLedLib.dll file against debug versions of the DLLs which are not installed with the standard VC++ redistributible packages.
The RGBFusion app from Gigabyte actually installs the relevant files into SysWOW64 and it looks like it is installing them alongside the Visual C++ 2008 redistributible. I have attached a zip containing the two files that were installed with the RGBFusion app. They are digitally signed by Microsoft and anyone who downloads them should double check to make sure that the signature is still intact.

RGBFusion VC debug DLLs.zip

.

tylerszabo commented 5 years ago

Fantastic find! @Emu1981. That d is sneaky. Thanks also for checking the signatures. I'll bundle them in future releases. I'll keep this open until such a bundle is released and confirmed to work.

ericnewton76 commented 5 years ago

Wow this is really awesome... you kinda stole my thunder because I had some grand schemes when I found gigabyte's sdk.

Did you find a way to package the dependencies effectively? The project might warrant a full installshield installation and a more robust dependency check.

You might also run into gigabyte complaining about redistribution, but that can be solved by dependency checker including a link to a page on this repo which can then get you to the "right" sdk dlls to download.

I'm going to look into this more sometime this weekend and see if I can help out.

Btw, see if https://github.com/commandline/commandlineparser works for command line parsing. I admin that project and noticed you were doing your own parsing and tests for parsing. Sorry for the off topic paragraph, lol...

Emu1981 commented 5 years ago

Well, I did some more digging and it turns out that, technically, Gigabyte is breaching the software license for Visual Studio by distributing the debug versions of the DLLs. Gigabyte needs to sort out their build environment so that the DLLs are not linked and they need to fix their app so that they are not distributing the files without the license to do so. I sent them a message regarding this but I have not gotten a response to it yet.

h0useRus commented 5 years ago

I've got new SDK B19.0311.1, but faced with same issue, and @Emu1981 doesn't work for me :(

UPD. I checked and it require GVILLUMLIB.DLL which is not in SDK

image