Windows Driver : Install legacy hardware with command line tool - driver

Operation System: Windows Server 2016 R2
I have a RAMDisk driver can be installed with "Add Legacy Hardware Wizard" (hdwwiz.exe) successfully. From the output of devcon hwids *, the device can be seen as below.
ROOT\UNKNOWN\0000
Name: RAMDrive [ QSoft ] Enterprise (x64)
Hardware IDs:
ramdriv
However, I need complete the installation via Ansible, hence hdwwiz.exe cannot be used. It has to be done via command line without interaction.
I tried several approaches and none of them works.
Approach I : DevCon.exe (Windows Device Console)
C:\Ramdisk64_inst>devcon.exe install RAMDriv.inf ramdriv
Device node created. Install is complete when drivers are installed...
Updating drivers for ramdriv from C:\Ramdisk64_inst\RAMDriv.inf.
devcon.exe failed.
C:\Ramdisk64_inst>devcon.exe install RAMDriv.inf ROOT\UNKNOWN\0000
Device node created. Install is complete when drivers are installed...
Updating drivers for ROOT\UNKNOWN\0000 from C:\Ramdisk64_inst\RAMDriv.inf.
devcon.exe failed.
Here is the log from C:\Windows\INF\setupapi.dev.log
>>> [Device Install (UpdateDriverForPlugAndPlayDevices) - ramdriv]
>>> Section start 2018/12/20 07:10:35.670
cmd: C:\Ramdisk64_inst\devcon.exe install C:\Ramdisk64_inst\RAMDriv.inf ramdriv
ndv: INF path: C:\Ramdisk64_inst\RAMDriv.inf
ndv: Install flags: 0x00000001
! ndv: Unable to find any matching devices.
<<< Section end 2018/12/20 07:10:35.717
<<< [Exit status: FAILURE(0xe000020b)]
>>> [Device Install (UpdateDriverForPlugAndPlayDevices) - ROOT\UNKNOWN\0000]
>>> Section start 2018/12/20 07:11:50.687
cmd: devcon.exe install RAMDriv.inf ROOT\UNKNOWN\0000
ndv: INF path: C:\Ramdisk64_inst\RAMDriv.inf
ndv: Install flags: 0x00000001
! ndv: Unable to find any matching devices.
<<< Section end 2018/12/20 07:11:50.734
<<< [Exit status: FAILURE(0xe000020b)]
Approach 2 : DPInst.exe (Driver Package Installer)
C:\Ramdisk64_inst>dpinst.exe /PATH C:\Ramdisk64_inst /Q /C /LM
INFO: Option set: dumping log info to console.
INFO: Current working directory: 'C:\Ramdisk64_inst'
INFO: Running on path 'C:\Ramdisk64_inst'
INFO: No valid 'dpinst.xml' file provided.
INFO: Install option set: Running in quiet mode. Suppressing Wizard and OS popups.
INFO: Install option set: legacy mode on.
INFO: Found driver package: 'C:\Ramdisk64_inst\RAMDriv.inf'.
INFO: Preinstalling 'c:\ramdisk64_inst\ramdriv.inf' ...
INFO: ENTER: DriverPackagePreinstallW
INFO: Driver package is already preinstalled 'c:\ramdisk64_inst\ramdriv.inf'.
SUCCESS:c:\ramdisk64_inst\ramdriv.inf is preinstalled.
INFO: RETURN: DriverPackagePreinstallW (0xB7)
INFO: ENTER: DriverPackageGetPathW
INFO: RETURN: DriverPackageGetPathW (0x0)
INFO: ENTER: DriverPackageInstallW
WARNING:DRIVER_PACKAGE_LEGACY_MODE flag set but not supported on Plug and Play driver on VISTA. Flag will be ignored.
INFO: Installing INF file 'c:\ramdisk64_inst\ramdriv.inf' (Plug and Play).
INFO: Looking for Model Section [DiskDevice.NTamd64]...
INFO: No matching devices found in INF "C:\Windows\System32\DriverStore\FileRepository\ramdriv.inf_amd64_fcc99ac0622d865b\ramdriv.inf" on the Machine.
INFO: No drivers installed. No devices found that match driver(s) contained in 'C:\Windows\System32\DriverStore\FileRepository\ramdriv.inf_amd64_fcc99ac0622d865b\ramdriv.inf'.
INFO: RETURN: DriverPackageInstallW (0xE000020B)
INFO: No matching device was found for 'c:\ramdisk64_inst\ramdriv.inf'. Driver will be installed when plugged in.
INFO: Returning with code 0x100
Approach 3 : rundll32 calls SetupAPI
C:\Ramdisk64_inst>rundll32.exe setupapi.dll,InstallHinfSection DiskInstall 128 C:\Ramdisk64_inst\RAMDriv.inf
It ends without any error, but the driver is not installed.
Approach 4 : PnPUtil
C:\Ramdisk64_inst>pnputil.exe /add-driver C:\Ramdisk64_inst\RAMDriv.inf /install /subdirs /restart
Microsoft PnP Utility
Adding driver package: RAMDriv.inf
Driver package added successfully.
Published Name: oem7.inf
Driver package installed on matching devices.
Total driver packages: 1
Added driver packages: 1
It succeeded, but in fact driver is not installed.
None of them works. DpInst.exe says No matching devices found in INF, DevCon.exe says Unable to find any matching devices. It seems the same reason.
However the driver can be installed with hdwwiz.exe manually, does anyone know what is the secret inside hdwwiz.exe?

Legacy Drivers can´t be installed with pnputil and have to use LaunchINFSectionEx-Call
I tested the following and it works with several drivers from Windows 2000 up to Windows 10, 2012R2, 2016, 2019.
rundll32.exe advpack.dll,LaunchINFSectionEx ykmd.inf,Yubico64_Install.NT,,4,N
Pay attention to use the correct section
The correct section of the inf-File must be used, when there is no [DefaultInstall]-Section. This lacks in most answers. Look it up in your drivers inf-File and use the correct section (in my example "Yubico64_Install.NT"). Using the wrong section wont prompt an error. Im my example I use Quiet mode, no UI (4) and Never reboot (N) to install the driver automated via GPO. All options are documented in detail here:
https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa768006(v%3Dvs.85)

Related

Error when running Memgraph 2.1.1 on MacBook Air with M1

I want to run Memgraph 2.1.1 inside Docker. I have MacBook Air with M1. When I try to run it I get the error:
> docker run -p 7687:7687 memgraph/memgraph
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
You are running Memgraph v2.1.1
To get started with Memgraph, visit https://memgr.ph/start
qemu: uncaught target signal 6 (Aborted) - core dumped
In my docker log I can see also some errors:
memgraph#e01736c43b23:/usr/lib/memgraph$ cat /var/log/memgraph/memgraph_2023-02-13.log
[2023-02-13 11:16:17.124] [memgraph_log] [warning] Invalid license key string. To use Enterprise features please set it to a valid string using the following query:
SET DATABASE SETTING "enterprise.license" TO "your-license-key"
[2023-02-13 11:16:17.254] [memgraph_log] [warning] No snapshot or WAL file found. For more details, visit https://memgr.ph/durability.
[2023-02-13 11:17:50.221] [memgraph_log] [warning] Using non-secure Bolt connection (without SSL). For more details, visit https://memgr.ph/ssl.
[2023-02-13 11:18:03.589] [memgraph_log] [critical]
Assertion failed in file /memgraph/src/utils/async_timer.cpp at line 144.
Expression: 'timer_create(CLOCK_MONOTONIC, &notification_settings, &timer_id_) == 0'
Message: 'Couldn't create timer: (22) Invalid argument'
What can I do to start Memgraph in docker?
You will need to upgrade Memgraph to newer version. Support for M1 was added in Memgraph 2.2.

MikTex, package miktex-latex could not be installed

I "upgraded" from Windows 10 to Windows 11, and my MikTex developed problems. It still works, but gives this warning:
======================================================================
starting package maintenance...
installation directory: C:\Users\ccc31\AppData\Local\Programs\MiKTeX
package repository: https://mirror2.sandyriver.net/pub/ctan/systems/win32/miktex/tm/packages/
package repository digest: 01f4511dd3ba7934c7348b504d466b34
going to download 1262 bytes
going to install 4 file(s) (1 package(s))
downloading https://mirror2.sandyriver.net/pub/ctan/systems/win32/miktex/tm/packages/miktex-latex.tar.lzma...
0.00 MB, 0.03 Mbit/s
Unfortunately, the package miktex-latex could not be installed.
Please check the log file:
C:\Users\ccc31\AppData\Local\MiKTeX\miktex\log\pdflatex.log
======================================================================
I noticed from my settings file it says the OS is Windows 10. Here is a portion of my settings file:
ReportDate: 2023-01-31 16:00:55
CurrentVersion: 20.7
SetupDate: 2022-12-19 12:42:00
SetupVersion: 20.6.29
Configuration: Regular
GitInfo: d26133b / 2020-07-31 18:20:50
OS: Windows 10 Home, 64-bit, build 22621
SharedSetup: no
LinkTargetDirectory: C:\Program Files\MiKTeX\miktex\bin\x64
PathOkay: yes
LastUpdateCheck: 2023-01-31 15:48:30
LastUpdate: 2023-01-31 15:49:21
LastUpdateDb: 2023-01-31 15:50:42
SystemAdmin: yes
RootPrivileges: no
AdminMode: no
In trying to troubleshoot this problem, I noticed that I had Miktex in \Program Files and also in AppData\Local\Programs. I am a long time user of latexpdf, so it wouldn't surprise me to learn that I had installed it multiple times in multiple locations.
Any hints on how to diagnose the warning, and how to fix it? Thanks.

Unable to install SGX driver to intel i3 6100 CentOS 7 machine

I am trying to install the Intel SGX driver at Intel I3 6100 based CPU and I am not able to launch the enclave.
I am suspecting that it is happening due to my processor (i.e. Intel core i3). Same steps I perform at my another machine that came with I7 and it is working as expected.
Thing I tried at my end is :
First I tried to install the driver 1.7 and getting the device error.
========================================================
[root#local_host POC1]# ./sgx_linux_x64_driver_51b2884.bin
Unpacking Intel SGX Driver ... done.
Verifying the integrity of the install package ... done.
Installing Intel SGX Driver ...
/tmp/sgx-driver-d9jY01 ~/POC1
install -d /opt/intel/sgxdriver/package
install -d /opt/intel/sgxdriver/scripts
install package/* /opt/intel/sgxdriver/package
install scripts/* /opt/intel/sgxdriver/scripts
~/POC1
/opt/intel/sgxdriver/package ~/POC1
make -C /lib/modules/3.10.0-327.36.1.el7.x86_64/build SUBDIRS=/opt/intel/sgxdriver/package modules
make[1]: Entering directory `/usr/src/kernels/3.10.0-327.el7.x86_64'
CC [M] /opt/intel/sgxdriver/package/isgx_main.o
CC [M] /opt/intel/sgxdriver/package/isgx_page_cache.o
CC [M] /opt/intel/sgxdriver/package/isgx_ioctl.o
CC [M] /opt/intel/sgxdriver/package/isgx_vma.o
CC [M] /opt/intel/sgxdriver/package/isgx_util.o
LD [M] /opt/intel/sgxdriver/package/isgx.o
Building modules, stage 2.
MODPOST 1 modules
CC /opt/intel/sgxdriver/package/isgx.mod.o
LD [M] /opt/intel/sgxdriver/package/isgx.ko
make[1]: Leaving directory `/usr/src/kernels/3.10.0-327.el7.x86_64'
modprobe: ERROR: could not insert 'isgx': No such device
===========================================================
Second I tried to install the SGX 2.1.0 driver and driver install successfully but I am unable to launch enclave.
============================================================
./app
Info: Please make sure SGX module is enabled in the BIOS, and install SGX driver afterwards.
Error: Invalid SGX device.
Enter a character before exit ...
============================================================
Note : I verified at BIOS and SGX is enabled there.

Appium ANDROID_HOME env variable issues

Happy new year all, I'd gratefully appreciate if someone could help or shed some light into this issue.
I've just set up appium 1.7.2 server on MAC OS High Sierra v 10.13.2, running appium through below command.
appium -a 127.0.0.1 -p 4723 --log-level=debug
Below is my .bash_profile
n.nadarajah#EGHJ-MACRDV01 ~ $ cat ~/.bash_profile
# Setting PATH for Python 2.7
# The original version is saved in .bash_profile.pysave
ANDROID_HOME=/Users/n.nadarajah/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
ANDROID_PLATFORM_TOOLS=$ANDROID_HOME/platform-tools
ANDROID_TOOLS=$ANDROID_HOME/tools
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}:$JAVA_HOME:$ANDROID_HOME:
$ANDROID_PLATFORM_TOOLS:$ANDROID_TOOLS"
export PATH
Echoing $ANDRIOD_HOME env variable
n.nadarajah#EGHJ-MACRDV01 ~ $ echo $ANDROID_HOME
/Users/n.nadarajah/Library/Android/sdk
Below are the Appium logs on test execution.
n.nadarajah#EGHJ-MACRDV01 ~ $ appium -a 127.0.0.1 -p 4723 --log-l .
level=debug
info: Welcome to Appium v1.4.16 (REV
ae6877eff263066b26328d457bd285c0cc62430d)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {"address":"127.0.0.1"}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"capabilities":{"alwaysMatch":
{"platformName":"Android"},"firstMatch":
[{}]},"desiredCapabilities":{"deviceName":"Android
Emulator","app":"/Users/n.nadarajah/sites/Resilient-
QA/EndToEndTesting/apks/app-
debug.apk","platformName":"Android","automationName":"appium",
"appPackage":"com.resilientplc.smartnumbers.debug"}}
info: Client User-Agent string: Python http auth
info: [debug] No appActivity desired capability or server param.
Parsing from apk.
info: [debug] Using local app from desired caps:
/Users/n.nadarajah/sites/Resilient-QA/EndToEndTesting
/apks/app-debug.apk
info: [debug] Creating new appium session
a5cfbee9-bcd6-41af-a90c-0389ab244d2c
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_151
info: [debug] Checking whether adb is present
warn: The ANDROID_HOME environment variable is not set to the Android
SDK root directory path.
ANDROID_HOME is required for compatibility with SDK 23+.
Checking along PATH for adb.
info: [debug] executing cmd: which adb
info: [debug] Using adb from /Users/n.nadarajah/
Library/Android/sdk/platform-tools/adb
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
warn: The ANDROID_HOME environment variable is not set to the Android
SDK root directory path.
ANDROID_HOME is required for compatibility with SDK 23+.
Checking along PATH for aapt.
info: [debug] executing cmd: which aapt
error: Problem parsing package and activity from manifest: Error: Could
not find aapt. Please set the ANDROID_HOME environment
variable with the Android SDK root directory path.
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not
find aapt. Please set the ANDROID_HOME environment variable
with the Android SDK root directory path.
info: [debug] Error: Could not find aapt.
Please set the ANDROID_HOME environment variable with the
Android SDK root directory path.at ADB.<anonymous>
(/usr/local/lib/node_modules/appium
/node_modules/appium-adb/lib/adb.js:126:12)
at ChildProcess.exithandler (child_process.js:279:5)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Socket.stream.socket.on (internal/child_process.js:363:11)
at Socket.emit (events.js:159:13)
at Pipe._handle.close [as _onclose] (net.js:568:12)
info: [debug] Responding to client with error: {"status":33,"value":
{"message":"A new session could not be created.
(Original error: Could not find aapt. Please set the ANDROID_HOME
environment variable with the Android SDK root
directory path.)","origValue":"Could not find aapt. Please set the
ANDROID_HOME environment variable with the
Android SDK root directory path."},"sessionId":null}
info: <-- POST /wd/hub/session 500 164.317 ms - 344
Questions:
1. Why does appium cannot see the system environment variable?
I've tried appium server versions 1.7.2 & 1.7.1 & 1.6.2 & 1.4.16 the symptoms were the same.
Could someone help me out with this please.
Thanks
Niro
I've got to the bottom of this issue,
turns out I've missed another android env variable.
In the above case I've missed ANDROID_BUILD_TOOLS
At the point of writing this, below are the list of Env variables required for appium.
ANDROID_HOME=/Users/n.nadarajah/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/
Contents/Home/bin
ANDROID_PLATFORM_TOOLS=$ANDROID_HOME/platform-tools
ANDROID_TOOLS=$ANDROID_HOME/tools
ANDROID_BUILD_TOOLS=$ANDROID_HOME/build-tools/27.0.3
Append all the above env variables to $PATH
works for me in Mojave.
After editing ~/.bash_<profile or rc> I use:
source ~/.bash_<profile or rc>
It not only loads the new variables values, as reports any error on file as well.
here is the workin list of environment variables:
export ANDROID_HOME=/Users/user/Library/Android/sdk
export PATH=$ANDROID_HOME/:$PATH
export
PATH=$ANDROID_HOME/platform-tools/:$PATH
export
PATH=$ANDROID_HOME/tools/:$PATH export PATH=/usr/local/bin/:$PATH
launchctl setenv ANDROID_HOME /Users/user/Library/Android/sdk
works on highSierra, of course, tweak Your paths...
here I have installed android studio in default path.
First Set Android home: create a new System Variable
ANDROID_HOME : C:\Users\<user name>\AppData\Local\Android\Sdk
Add bellow three path in path system variables
C:\Users\<user name>\AppData\Local\Android\Sdk\platform-tools
C:\Users\<user name>\AppData\Local\Android\Sdk\tools
C:\Users\<user name>\AppData\Local\Android\Sdk\tools\bin

Can't get neo4j to start - conf/log4j.properties

I've just used homebrew to successfully install the latest neo4j (Community Edition 2.1.4) on my MacBook Pro - however, I've been unable to get the server to start.
My question seems similar to this though that question remains unresolved (and the suggestions haven't worked for me).
Just quickly: I have previously successfully installed and booted the trial of the Enterprise Edition (over a year ago) and I've since removed it. Pure speculation but I'm guessing that my issues could be related to this.
When I run neo4j start
I get
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Dneo4j.ext.udc.source=homebrew -Djava.awt.headless=true
Starting Neo4j Server...WARNING: not changing user
process [1368]... waiting for server to be ready.. Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
Then I inspect with neo4j console and get
WARNING: Max 256 open files allowed, minimum of 40 000 recommended. See the Neo4j manual.
Starting Neo4j Server console-mode...
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Dneo4j.ext.udc.source=homebrew -Djava.awt.headless=true
log4j:ERROR Could not read configuration file from URL [file:conf/log4j.properties].
java.io.FileNotFoundException: conf/log4j.properties (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at java.net.URL.openStream(URL.java:1037)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:459)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
at org.apache.commons.configuration.AbstractFileConfiguration.<init>(AbstractFileConfiguration.java:121)
at org.apache.commons.configuration.AbstractFileConfiguration.<init>(AbstractFileConfiguration.java:154)
at org.apache.commons.configuration.PropertiesConfiguration.<init>(PropertiesConfiguration.java:252)
at org.neo4j.server.configuration.PropertyFileConfigurator.loadPropertiesConfig(PropertyFileConfigurator.java:147)
at org.neo4j.server.configuration.PropertyFileConfigurator.<init>(PropertyFileConfigurator.java:67)
at org.neo4j.server.Bootstrapper.createConfigurator(Bootstrapper.java:220)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:98)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:62)
log4j:ERROR Ignoring configuration file [file:conf/log4j.properties].
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)
at org.apache.commons.configuration.ConfigurationUtils.locate(ConfigurationUtils.java:447)
at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:213)
at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:197)
at org.apache.commons.configuration.AbstractFileConfiguration.<init>(AbstractFileConfiguration.java:162)
at org.apache.commons.configuration.PropertiesConfiguration.<init>(PropertiesConfiguration.java:252)
at org.neo4j.server.configuration.PropertyFileConfigurator.loadPropertiesConfig(PropertyFileConfigurator.java:147)
at org.neo4j.server.configuration.PropertyFileConfigurator.<init>(PropertyFileConfigurator.java:67)
at org.neo4j.server.Bootstrapper.createConfigurator(Bootstrapper.java:220)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:98)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:62)
It seems conf/log4j.properties isn't created at all. I've then copied the contents of that file from my brothers successful installation which seems to remedy the first error though the second error persists with the same result when I try to start the server again.
I've also tried to install via direct download and get the same result.
Other details:
>> java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
>> sw_vers
ProductName: Mac OS X
ProductVersion: 10.9.4
BuildVersion: 13E28
I'm aware of the Max open files warning though don't believe that to be the issue.
Help would be much appreciated. Thanks in advance.
I've had some success – or, at least, I've got neo4j working now on my machine.
Following the suggestion in this google thread I removed slf4j-api-1.5.8.jar and slf4j-log4j12-1.5.8.jar from /Library/Java/Extensions and the server now boots.
I have no idea if this will have unexpected negative consequences but it definitely seems to solve my problem. Moving on.

Resources