Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

How can I install a .inf file from the command line?

- - - - -

  • Please log in to reply
25 replies to this topic

#1
lucky2007

lucky2007
  • Member
  • 3 posts
wel I know this one works:

rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\<file>.inf

but I can stil see files being copied, so I was wondering if anyone can tell me how to hide it, if it is posible.

thx in advance :)


How to remove advertisement from MSFN

#2
ricktendo

ricktendo

    Group: Banned Members

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,306 posts
  • OS:Windows 7 x64
  • Country: Country Flag
Try Adanced INF way, it has more options

rundll32.exe advpack.dll,LaunchINFSectionEx inf_filename,[section name],[cab name],<flags>[,smart reboot]

INF Filename
INF filename you want to launch. If the given name is not full pathname, advpack.dll will extract the INF from the given CAB file.


Section Name
INF install section name you want to launch. If it is empty string or NULL, DefaultInstall section name will be called.


Cab Name
Specify the fully qualified CAB file pathname which contains the files or INF you want to install to the user's system.


Flags
Flag Meaning
4 Quiet Mode, no UI
8 Don't Run GrpConv
16 Force Self-Updating on User's System
32 Backup Data Before Install
64 Rollback to Previous State
128 Validate the Backup Data
256 Complete Rollback to Previous State
512 Force Delay of OCX Registration


Smart Reboot
N No Reboot
A Always Reboot
I Reboot if Needed (default value)


Example:
rundll32.exe advpack.dll,LaunchINFSectionEx myinf.inf,,c:\temp\mydata.cab,36

This means to extract myinf.inf file from c:\temp\mydata.cab file and launch myinf.inf with DefaultInstall section in Quiet|Backup install mode, reboot if needed.

rundll32.exe advpack.dll,LaunchINFSectionEx c:\windows\inf\myinf.inf,,,256

This means to rollback to the state before installing myinf.inf DefaultInstall section.

So to make it silent it would be:
rundll32.exe advpack.dll,LaunchINFSectionEx .\<file>.inf,,,4

Edited by ricktendo64, 21 September 2007 - 09:39 PM.


#3
lucky2007

lucky2007
  • Member
  • 3 posts
thx,

do you perhaps know where to find some more info about Adanced INF(want to learn a bit more about what it can do and how it works)?
if I google it it only shows up people with errors :rolleyes:

#4
Inferi0r

Inferi0r

    Little dude

  • Member
  • PipPip
  • 180 posts
Check Gosh' site.

#5
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,374 posts
  • OS:none specified
  • Country: Country Flag
And the link here:
http://www.boot-land...-inf-t1966.html
http://www.boot-land...?showtopic=1966

jaclaz

Edited by jaclaz, 21 May 2009 - 11:36 AM.


#6
ricktendo

ricktendo

    Group: Banned Members

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,306 posts
  • OS:Windows 7 x64
  • Country: Country Flag
http://www.sokoolz.c...r64/INF_DOC.ZIP

#7
wherzdaluv

wherzdaluv

    Newbie

  • Member
  • 10 posts
not sure from command line, but in windows just right click on it and instal. only thing i could think of is figure out the hex for right click and then figure out instal code.

#8
Arie

Arie

    One Man Army

  • Member
  • PipPipPipPipPip
  • 835 posts

not sure from command line, but in windows just right click on it and instal. only thing i could think of is figure out the hex for right click and then figure out instal code.

The answer is already given, read up.
Not trying to pretend the enemy that I am.

#9
lucky2007

lucky2007
  • Member
  • 3 posts
Thx for the aswers :thumbup

and sorry for the late reply (internet problem) :angry:

#10
seattleman1969

seattleman1969
  • Member
  • 1 posts
Good information but we are attempting to use this to install from command line a "special" INF for Internet Component Download Service. Does anyone have any information on how to execute one of THOSE INF files from command line successfully?

Our goal is to take the payload from a cab file downloaded from an internet site and execute the .INF located within to install the application since our user base doesn't have permissions to install any software, and we do not want to change that. This will be scripted through winbatch and executed with elevated permissions through LANDesk once we get the command line figured out.

Thanks!

Edited by seattleman1969, 21 May 2009 - 10:19 AM.


#11
Martin H

Martin H

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 802 posts
  • OS:none specified
If the INF to install has a DefaultInstall section, then it's silently installed with:
rundll32 advpack.dll,LaunchINFSection <PathTo>\name.inf,,1
(advpack runs the Advanced INF commands(if any), and calls setupapi for the standard INF commands)

However, with many 3'rd party INFs, then a DefaultInstall section is not always used, and then you need to investigate which install-section to call instead:
rundll32 advpack.dll,LaunchINFSection <PathTo>\name.inf,<InstallSection>,1

/* Moved to Linux - Thanks for a nice stay all! */
Posted Image


#12
Velund

Velund
  • Member
  • 3 posts
Hi.
I hope there is somebody here on this forum and reading this topic. I trying to overread the default windows driver for usb audio device. I created the the .inf file and i trying to install it using rundll32 advpack.dll ... I do it successfully and i see that OEM inf file added to windows inf directory, but when i plug in the device it still uses default driver. If i manually install my .inf from the device manager it works fine. I know that this happend because my file is without certificate, but maybe there is still a way to make my driver to become default driver for my device? If not, how can i SIGN my inf file?

Thanks in advance.

Edited by Velund, 24 August 2009 - 09:31 AM.


#13
iamtheky

iamtheky

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 866 posts
http://social.msdn.m...8c-f08ce75c7bf1

good thread for swapping/editing the wdma_usb.inf file
iamtheKy

#14
Velund

Velund
  • Member
  • 3 posts
Yes i saw this thread before, it helped me to build my .inf file. My problem now is different. I want windows to use my .inf as default driver for my usb audio device instead of wdma_usb.inf. I can't change wdma_usb.inf it self because it's signed file and it won't work if changed...

Edited by Velund, 25 August 2009 - 12:55 AM.


#15
iamtheky

iamtheky

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 866 posts
its been a while since i played with this, but I remember only changing the pointer in wdma_usb from usbaudio.inf to the new .inf

I'll continue looking for the directions I followed for that (but I keep coming back to that same article).
iamtheKy

#16
Velund

Velund
  • Member
  • 3 posts
I actually need to change some registry values for my usb audio(USBAudio.AddReg section in wdma_usb.inf) and keep them for all the rest usb audio devices. It's can easly done manually when device is installed - i can reinstall my driver or go to the registry and change the keys. What i need is make windows install my driver by default... probably the only option to do this is to sign the .inf file.

iamtheky
Anyway, if you'll find something, please let me know.

Edited by Velund, 26 August 2009 - 02:38 AM.


#17
click-click

click-click

    Member

  • Member
  • PipPip
  • 107 posts
I'm trying to install a ThinkPad LCD Monitor inf file with advpack and it doesn't install. There are no error messages and nothing happens as far as I can tell. If I use explorer and right-click the .inf and select install, it works fine. I don't understand why the command line doesn't work. This is the cmd I'm using:
rundll32.exe advpack.dll,LaunchINFSectionEx D:\@Drivers\$T500\$Common\Video\LCDMon\geoi02w8\tplcd.inf
The inf file looks like this:
Spoiler
Anyone know why it doesn't install with the command line I used?

Edited by click-click, 09 March 2013 - 05:29 AM.


#18
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,374 posts
  • OS:none specified
  • Country: Country Flag

The inf file looks like this:
....
Anyone know why it doesn't install with the command line I used?

I cannot find a DefaultInstall section in that .inf file (re-read the thread).

http://www.msfn.org/...post__p__695273

Section Name
INF install section name you want to launch. If it is empty string or NULL, DefaultInstall section name will be called.


http://www.msfn.org/...post__p__858362

jaclaz

#19
click-click

click-click

    Member

  • Member
  • PipPip
  • 107 posts
okay, understood, but how does the right-click on .inf -> install find the right install section?

I was thinking that method also used advpack under the covers.

I still can't get it to install by adding the inf section TPLCDWSXGAP.Install.NTx86

Now I get INF Install failure. Reason: The parameter is incorrect
rundll32.exe advpack.dll,LaunchINFSection D:\@Drivers\$T500\$Common\Video\LCDMon\geoi02w8\tplcd.inf,TPLCDWSXGAP.Install.NTx86

Edited by click-click, 09 March 2013 - 08:28 AM.


#20
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,374 posts
  • OS:none specified
  • Country: Country Flag
I guess that if you provide a parameter, you ALSO need to provide the other parameters. :unsure:

Why don' t you simply do first thing EXACTLY what has been posted on this thread?

rundll32.exe advpack.dll,LaunchINFSectionEx D:\@Drivers\$T500\$Common\Video\LCDMon\geoi02w8\tplcd.inf,TPLCDWSXGAP.Install.NTx86,,4

or:

rundll32.exe advpack.dll,LaunchINFSection D:\@Drivers\$T500\$Common\Video\LCDMon\geoi02w8\tplcd.inf,TPLCDWSXGAP.Install.NTx86,1



jaclaz

#21
click-click

click-click

    Member

  • Member
  • PipPip
  • 107 posts
Neither of those commands work. I had tried those already. No error msgs. but did not install. The monitor still shows Generic PnP Monitor instead of ThinkPad Display 1680x1050. I think this is because windows thinks I already have the newest drivers installed and advpack won't process the inf file.

The only way I could get this to install from a command line was:
c:\windows\system32\infdefaultinstall.exe  D:\@Drivers\$T500\$Common\Video\LCDMon\geoi02w8\TPLCD.INF

Edited by click-click, 09 March 2013 - 11:02 AM.


#22
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,374 posts
  • OS:none specified
  • Country: Country Flag
Wait a minute:

infdefaultinstall.exe

that should mean Vista :ph34r: or later, it is possible that something has changed, I guess that this thread was originated about XP/2003 (and possibly earlier OS's). :unsure:

jaclaz

#23
click-click

click-click

    Member

  • Member
  • PipPip
  • 107 posts
Yes, sorry. I should have mentioned that I was using Win8. Advpack.dll should work there too, but I don't know why it doesn't for this particular inf file. Anyway, using infdefaultinstall was a workaround for me. Thanks .....

Edited by click-click, 09 March 2013 - 11:59 AM.


#24
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,276 posts
  • OS:none specified
  • Country: Country Flag
Ummm... I hate to break in here, but if you have a running OS that already has ANY driver installed, the ONLY way (that I know of at least) to use a DIFFERENT driver is to Update Driver in the Device Manager. OTHERWISE, the Driver has to be Integrated (however depending on the OS) to be Installed during Clean or Upgrade.

I know of NO other way to update a Driver. The INF may PUT the Drivers where they need to be but they won't "automagically" change just because you "installed" it. Generally speaking Driver Updates Packages "know" what to "delete older" and "force" a reinstall of the NEWER ("alternate") Driver. In other words, just putting (e.g.) NEWER nVidia Drivers via INF into my OS won't by default USE the Newer Driver. You would have to REMOVE the Device to allow it to "re-find" it.

That's why there's SPECIFICALLY an "Update Driver" button in Device Manager.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#25
Geej

Geej

    Senior Member

  • Member
  • PipPipPipPip
  • 635 posts
  • OS:XP Pro x86
  • Country: Country Flag
This article says "DefaultInstall sections must not be used for device installations. etc" in the 'Remarks' heading. It also says try calling using InstallHinfSection.

But also this article says as long as there is an INF Manufacturer section, it generally will also work.
We have the section in tplcd.inf
[Manufacturer]
%Lenovo%=Lenovo,NTx86,NTamd64

Perhaps we can try calling InstallHinfSection on commandline (w/o using infdefaultinstall.exe)
rundll32 setupapi,InstallHinfSection D:\@Drivers\$T500\$Common\Video\LCDMon\geoi02w8\tplcd.inf

Above are just pure guess on my part.

Edited by Geej, 09 March 2013 - 07:48 PM.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users



How to remove advertisement from MSFN