c# - DEVCON.EXE (driver tool) and OpenVPN -


We wrote an application that manages Open VPN from the tray as an add-on for a large software package .

Open VPN contains a file called tapinstall.exe which installs the Open VPN adapter (or a driver for that matter). While doing some research, this file is similar to a command-line tool called Dimocon which includes Microsoft Windows DDK. Open VPN people have renamed it for their use.

So we use custom action to install the driver during our setup (MSI) installer, which works just fine for most of the part.

Every now and then, devcon fails and hangs - Never after that point, you can run the deckon again and install it twice twice ... which is basically open VPN Will break.

Has anyone seen this problem with disco, know what it is doing, or fix it?

As an alternative solution, does anyone have to install a driver from C #? (We have a .inf and .sys file)

Update: We have found that these problems are very rare. This is most often when we have applied an update, where we uninstalled the V8 version of the Open VPN adapter and then installed the new version of the Open VPN Adapter (V9). It does not seem that if you restart your PC during installations, then we might be forced to uninstall the PC better ....

Side note: I used to I've heard about DfxCPI (I think this is what is said) to install drivers from YX and an MSI installer. Any idea if it can be done in a custom action from plain C #? We do not really want to start with our setup project using YX (it takes time).

I do not have a solution to your problem, but here are some suggestions:

  • DevCon's source code DDK root \ src \ Setup \ DevCon . If your problem is reproducible, you can create your own version and debug it in your IDE.

  • Open VPN installer can be found in sources You can compare how DevCon is implemented and see if OpenVPN is doing this in a way that is causing problems Stops.

  • INF files can be installed in some way from the command line

    rundll32 syssetup, SetupInfObjectInstallAction DefaultInstall 128 \. & Lt; File & gt; .inf

    But I do not know that DevCon is doing so much more than I do, that it is a viable way. ?

    OpenVPN founder looks: why there is OpenVPN installer using DevCon, not


@update For some reason obviously Based on DevCon's Return Price

 ; ------------------------------- -----------; Based on tappler returns, set the reboot flag, check the function Reboot IntCmp $ R0 1 "" Norbut Norbut Inntop $ R0 0 & amp; 0 SetRebootFlag True DetailPrint "Reboot Flag Set" noreboot: FunctionEnd <@>  

@side Note:

I think you want to port the c # DevCon should be enabled using P / Invoke.


  • DIFxAPI

    / Li>

  • Test program:

      Setdix log callback (DIFLogCallbackFunc, IntPtr.Zero); Requires Bull Reboot; Var error = DriverPackageInstall (driverPackageInfPath, 0, IntPtr.Zero, Requires Out Reboot); If (error! = 0) throw the new Win32Exception (error);  

    Output:

      INFO: Enter: DriverPackageInstallW Error Code: 0 INFO: Installing INF file 'C: \ Program Files (x86) \ OpenVPN \ Driver \ OemWin2k.inf '(Plug and Play) .. Error Code: 0 Info: Looking for Model Section [tap0901.NTamd64]. ... Error code: 0 information: Installing devices with ID "tap0901" using INF "C: \ Windows \ system32 \ DriverStore \ FileRepository \ oemwin2k.inf_128556d6 \ OemWin2k.inf". Error code: 0 Info: UpdateDriverForPlugAndPlayDevices ENTER .. .. Error code: 0 Success: Return UpdateDriverForPlugAndPlayDevices .. Error code: 0 information: Installation was successful. Error code: 0 Success: Install complete. Error Code: 0 Info: Back: DriverPackageInstallW (0x0). Error code: 0  

    should be run as a program administrator, otherwise you get a ERROR_ACCESS_DENIED .

    Get a ERROR_NO_MORE_ITEMS if the driver has already installed you.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -