Dibendu
Dibendu

Reputation: 13

Visual Studio Launch Condition

This may be one of the frequently asked Q. but i haven't come across any help so far. While creating an MSI package for an application, I've a requirement where I need to check if JDK 1.7.0 is installed. If yes, proceed with the installation else, show a message which after the user's permission will redirect to the Install URL to install the prerequisite.

I've used the "Add Registry Search" but the condition I've provided either always fails or always pass. Below are the parameters I've used:

ADD REGISTRY SEARCH:

Property: JDKEXISTS

RegKey: SOFTWARE\JAVASOFT\JAVA DEVELOPMENT KIT

Root: vsdrrHKLM

Value: currentversion

LAUNCH CONDITION:

Condition: (JDKEXISTS="Installed")

InstallUrl: the url to be downloaded from

Message: Your system needs Java 1.7.0 or higher. Download it now?

However, its not working. Can somebody help me on this?

Upvotes: 1

Views: 2066

Answers (1)

PhilDW
PhilDW

Reputation: 20780

If the registry search finds the item in the registry, then all you need use as a condition is JDKEXISTS. That's enough. I don't know if that value is actually "Installed", which is what you're checking, but you don't need it. JDKEXISTS will not exist (and will be false) if the value isn't found.

That looks like a VS setup project. There is also a bug of sorts in VS setup projects registry search. There's no way to search the native 64-bit registry, in case that is where your key is. The registry search always searches the 32-bit registry. You'd need to edit your MSI file (with Orca) to modify the RegLocator table Type value to add the 64-bit search option (add 16). https://msdn.microsoft.com/en-us/library/aa371171(v=vs.85).aspx

Upvotes: 1

Related Questions