Solved

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

Posted on 2010-11-15
10
1,028 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
 
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
Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now