From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA RAW: automatic driver update?

Regarding VISA RAW access under WIndows.....

 

I'm using a custom device driver written in VISA for a spectrometer and everything works fine.

 

Problems occur however, when a customer wants to install the software on their computer and the device is already installed with the manufacturer's driver.....

 

I can install the new driver to Windows/inf so that it shows up when I manually change the driver for the device, but is there a way to automatically replace the old driver with the new one?  So that the customer can start using the devide straight away?

 

Some customers get all hot and bothered when you ask them to open "device manager".

 

Shane.

Message 1 of 7
(2,917 Views)

Hi Intaris,

 

Thanks for the post and I hope your well today.

 

Device Manager:

Link:http://technet.microsoft.com/en-us/library/cc732377.aspx#BKMK_Anchor2

Using PnPUtil at a command line to update or change a device driver. To update or change a device driver by using PnPUtil at a command line.

However I couldnt find a cmd for changing the driver associations.. someone else may know?

 

DevCon Utility:

Link: http://support.microsoft.com/kb/311272

The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices. DevCon also provides information that is relevant to the driver developer and is not available in Device Manager.

 

Know this had a cmd as follows: devcon update mydev.inf *pnp0501
Updates all devices that exactly match the hardware ID *pnp0501 to use the best driver in Mydev.inf that is associated with the hardware ID *pnp0501.

Note This update forces all devices to use the driver in Mydev.inf, even if there is a better match already on the system. This is useful when you want to install new versions of drivers during development before you obtain a signature. The update affects only the devices that match the specified hardware ID, and does not affect the child devices. If the specified .inf file is unsigned, Windows may display a dialog box that prompts you to confirm whether the driver should be installed. If a restart is required, this is reported and DevCon returns a level 1 error. If you specify -r, this causes a restart to occur automatically if one is required. 

 

This could help?! Let me know what you think,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 2 of 7
(2,904 Views)

That all sounds promising.

 

I'll have to try it out and see what happens.

 

Shane.

0 Kudos
Message 3 of 7
(2,895 Views)

Hi Shane,

 

Thanks for the reply.

 

Please let me know how you get on - if you get started, then maybe I can help some more...

 

You can also use the cmd to uninstall the previous driver, this may help with the process.

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 4 of 7
(2,892 Views)

Looks good, but it's unfortunately it's not redistributable.

 

Source code is included so if I had a spare month or two, I could probably implement it myself.  I don't have a free month though.....

 

I'll see what I can find anyway.

 

Thanks

 

Shane.

0 Kudos
Message 5 of 7
(2,890 Views)

I can't locate "pnputil" on my machine.  Is that a standard microsoft tool or an add-on for Server 2008 (The link you sent is a part of the Server 2008 documentation)?

 

Shane

0 Kudos
Message 6 of 7
(2,885 Views)
Hi Shane,

 

Good afternoon and I hope your well.

 

I really wish I knew more about this.. to me it seems difficult to do because generally it wouldnt be good if it was easy to programmatically change (alter/delete) drivers. However, I have found a document -Designing Driver Packages for Corporate Deployment by Microsoft.

 

It discusses INI Files, INI File to Configure Drivers..

 

Maybe this will give you some ideas 😄

Let me know. 
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 7 of 7
(2,857 Views)