Solved

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

Posted on 2010-11-15
10
1,017 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
Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a tradeshow? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
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…
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…

705 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

20 Experts available now in Live!

Get 1:1 Help Now