[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What 'Property' to look for during prerequisite check for ClickOnce Installation.

Posted on 2012-09-18
8
Medium Priority
?
749 Views
Last Modified: 2012-09-25
Hi experts
I am writing the install condition check for a prerequisite component as part of the ClickOnce installer.

It checks the need to install an '.inf' file for a USB CDC driver. This '.inf' file tells the PC about the PID and VID, and it tells the PC to use the Windows provided driver 'usbser'.

I don't know the property that I need to search for. I tried 'device-ID', 'DeviceInfo.DeviceID', and 'DeviceID'. None of them were recognized.

Also, the file that it is checking is 'system32\drivers\usbser.sys'.

Kindly please let me know the Property that I should look for, and is the file 'usbser.sys' the correct file that I should look into. Thanks in advance.
0
Comment
Question by:dominicwong
  • 5
  • 3
8 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 38412151
> It checks the need to install an '.inf' file for a USB CDC driver.

If I understand correctly, you want to check whether certain either device, or driver, is already present in the system, and if not, you want to install it by your installation. Correct?

If so, then it's not prerequisite, because prerequisite will abandon the installation if the condition is not met, which is not what you want.

Please clarify.
0
 

Author Comment

by:dominicwong
ID: 38412166
Thank you very much for your prompt response.

>If I understand correctly, you want to check whether certain either device, or driver, is
>already present in the system, and if not, you want to install it by your installation. Correct?
Yes, that is what I want.  But I don't quite understand about the latter part of your comment.

Please find my 'package.xml' attached.

In the xml file, I used the property 'DriverVer' for my checking, I think it is not correct.
I think I should look for PID, VID, or device instance ID, or some sort in order to uniquely identify whether one particular '.inf' file had been previous installed.
package.xml
0
 

Author Comment

by:dominicwong
ID: 38412524
I found that it is under the 'MatchingDeviceId' of the HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Class.

Now my next task is to figure out how to edit this information into my 'package.xml' as part of installation checking condition.

It appears under a sub-sub-directory eg
Class/{4D36E978....318}/0006/MatchingDeviceId

It would be PC dependent. Any advice how I could put it into the prerequisite please?
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 2000 total points
ID: 38413281
The right way to install drivers is by using Microsoft-provided API's, by using custom actions - rather than by directly editing the registry. See http://stackoverflow.com/questions/3662656/how-to-include-inf-driver-install-into-vs-installer-project and links from there. Also http://msdn.microsoft.com/en-us/library/windows/hardware/gg463086.aspx, which is this same interface specially for installations.

Creating custom prerequisites is described in this article:
http://msdn.microsoft.com/en-us/library/ms165429%28v=vs.80%29.aspx
0
 

Author Comment

by:dominicwong
ID: 38416122
Thanks vadimrapp1 for your advice.

I'd looked into the links about creating custom action, and using 'devcon' to install driver.
I'd previously studied the msdn link about creating custom prerequisites.

My current situation is this:
I'd already created a bootstrapper package which I could import into VS2008 as a prerequisite condition. I'd already implemented a batch file and a cab file for installing an '.inf' file in a target PC (I am using the command 'rundll32').

My ClickOnce installer can successfully download the batch/cab files, and install the '.inf' file in a target PC. The problem I am facing is how I could get the Installer to first check the target PC for any previous installation of the '.inf' file.

As far I know, the ClickOnce installer runs the 'product.xml'/'package.xml'. If it finds installation is required, it then looks into a custom action or 'devcon'.

I am afraid you're pointing me to the latter part. What I am facing is the first part - which is how to implement the pre-installation check.

Thanks again for your help.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 38427235
>  The problem I am facing is how I could get the Installer to first check the target PC for any previous installation of the '.inf' file.

I don't think you need to. DIF is smart enough not to downgrade existing driver. Making custom checking is risky, because the mere presence of .inf, .sys, or registry entries, does not mean that it's complete, not broken, not misconfigured, etc. I would specify the installation unconditionally and rather rely on DIF to do all these checks.

Also, I suggest that you read E-E Grading Guildelines
0
 

Author Comment

by:dominicwong
ID: 38427243
Sorry vadimrapp1. I hadn't read the E-E Grading Guildelines before.

Thanks again for your suggestion.
0
 

Author Comment

by:dominicwong
ID: 38435411
I used DPInst as pointed out in one of the links. It is, as vadimrapp1 mentioned, that it was smart enough to detect the current configuration itself. Thanks vadimrapp1.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

872 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