Solved

Installation of INF-file via batch script is not going as expected

Posted on 2010-11-15
10
1,039 Views
Last Modified: 2012-05-10
I'm trying to quietly install an INF-file from a batch script with the help of:
C:\>%SystemRoot%\System32\rundll32.exe advpack.dll,LaunchINFSectionEx "D:\imdisk.inf",,,4
C:\>echo %errorlevel%
0

Open in new window

... as documented here:
http://msdn.microsoft.com/en-us/library/aa768006%28VS.85%29.aspx

This seems to work partly, meaning that the control panel applet and the user land CLI-application gets installed. However, trying to run these results in a complaint about the driver missing:
C:\>imdisk -a -s 33M
The ImDisk Virtual Disk Driver is not installed. Please re-install ImDisk.

Open in new window


Then doing this procedure from explorer.exe (right-click the .inf-file -> Install)  it works as a charm. What am I missing?

The software in question is ImDisk, found here:
http://www.ltr-data.se/opencode.html/#ImDisk

Also, the platform I'm trying to run this on is Windows XP SP3 x86. The user has admin-rights.
0
Comment
Question by:NordCap
  • 5
  • 4
10 Comments
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34135759
Wich OS you use? Try better to use dpinst.exe to install drivers.

http://www.microsoft.com/whdc/driver/install/32-64bit_install.mspx

or you can use devcon

http://support.microsoft.com/kb/311272
0
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34135846
Ok i see you use Win XP. Why you want to install the inf file? You can install the software silentlly from commandline

imdiskinst.exe -y
0
 

Author Comment

by:NordCap
ID: 34136416
Using imdiskinst -y is a good idea but when I said quiet I meant that I don't want anything to show up on the screen (except the batch window running). With imdiskinst -y you get a small window-flash and a progress-bar.

I've just tried my above mentioned command on Windows 7 x86 as well and the result is the same. I must be missing something. I also prefer to use a method that can be used on a vanilla release of Windows, hence no devcon.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 5

Expert Comment

by:xylog
ID: 34139140
Do you need a reboot after install for the driver to become active?
0
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34139472
If you don't like the small popup window-flash you have only one way. you must repackage the package to a msi. But it can be very complex because the package contains a driver. i will try tomorow to create a install wrapper for silent installation
0
 

Author Comment

by:NordCap
ID: 34143153
@xylog
It does not need of a reboot, since installing the INF-file from explorer.exe works as expected.

@cyborgrd
I understand, however I'm not sure if packaging a msi is the best way to go. The command I posted above that uses LaunchINFSectionEx is totally silent, however, something is missing, wouldn't it be easier to look for the cause of it not installing the driver as expected?
0
 
LVL 3

Accepted Solution

by:
cyborgrd earned 500 total points
ID: 34143819
the LaunchINFSectionEx works not correctly with many drivers. I don't know the solution for it. The install wrapper don't work propertly. I see the window. May is a custom action in the vendor installer.
0
 

Author Comment

by:NordCap
ID: 34143869
I see, so in essence is it common that LaunchINFSectionEx does not work with all drivers? And there is no known reason for this?
0
 
LVL 3

Expert Comment

by:cyborgrd
ID: 34143960
i has the same issue some time ago. I used the the dpinst and devcon for driver installations
0
 

Author Closing Comment

by:NordCap
ID: 34155019
I took a different kind of approach to "solving" this problem.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question