Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-11-15
10
Medium Priority
?
1,112 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 1500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

783 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