Link to home
Start Free TrialLog in
Avatar of dominicwong
dominicwong

asked on

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

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.
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

> 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.
Avatar of dominicwong
dominicwong

ASKER

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
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?
ASKER CERTIFIED SOLUTION
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
>  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
Sorry vadimrapp1. I hadn't read the E-E Grading Guildelines before.

Thanks again for your suggestion.
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.