cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
HLoEpicor
Level 3

System Search results to determine what components get installed

I have searched the forum, there are answers but nothing ever worked properly for what I need to do.

I am using a Basic MSI project. I need to find out whether target computer of my installation has SQL Server installed on it. The following link from Installshield documentation show me how to find it. 

https://docs.revenera.com/installshield24helplib/installshield24helplib.htm#helplibrary/ISQLServerSide.htm?Highlight=install%20condition 

However I DO NOT want the installation to stop if SQL Server not installed. That is how the documentation showed and that part works for sure. I need to store the property for later use. During the installation I want to determine which Components will installed based on whether SQL Server is present on target computer or not.  How do I use the property "SQLSERVERFOUND" (based on the link above) in the Condition of those component.  I have tried things like "SQLSERVERFOUND", "NOT SQLSERVERFOUND", "SQLSERVERFOUND <> "" ", etc. in my test install but nothing works. I have 2 test machines, 1 without SQL Server and the other one has SQL Server. It seems I always get the component for "No SQL Server" installed after.  So what conditions do I need to set to achieve this?

 

Labels (1)
0 Kudos
(16) Replies
rguggisberg
Level 13

I'd like to help... but the link you posted is dead.

0 Kudos

Copy and Paste this to your browser. Add http: slash slash in front of it. Something in the forum butchered the link.

docs.revenera.com/installshield24helplib/installshield24helplib.htm#helplibrary/ISQLServerSide.htm?Highlight=install%20condition

 

 

0 Kudos

OK. Try:

SQLSERVERFOUND=""

or:

Not SQLSERVERFOUND=""

or if you want to base action on whether or not the string value contains a string:

SQLSERVERFOUND><"2016"

or:

Not SQLSERVERFOUND><"2016"

0 Kudos

I thought initially that it is working but proves to be wrong. Let me go deeper in how my test Basic MSI project is setup.

Feature1 - 1st Component "SQLFound" - a file called SQLFound.txt

                    -  2nd Component "SQLNotFound" - a file called SQLNotFound.txt

I use the System Search wizard just like the article said but choose to store the property instead. Whether I add the property to thru the Property Manager or not doesn't make any difference.

I try what you suggested: "NOT SQLSERVERFOUND=""   " and "SQLSERVERFOUND=""   ". The outcome is whichever component that have the condition set to "  SQLSERVERFOUND="" " will get installed.

 

My test environments:

Machine 1: my dev laptop has no "InstalledInstances" value under  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server as I have no SQL Server on it. 

Machine 2: a QA server that has all kinds of  SQLExpress entries in "InstalledInstances". So I do expect the MSI property get set to something other than empty string.

If the CONDITION is working properly I expect Machine1 to get the SQLNotFound file all the time and Machine2 will get the SQLFound file all the time.

 

How can I make that happen with MSI System Search?

 

 

 

0 Kudos

Log your install with this command from a CMD window and see what is going on.

Setup.exe /v"/l*v \"%CD%\log.txt\""

 

0 Kudos

I did the logging on both of my test environments. Attached are the log files. 

0 Kudos

What is the name of your property?

I see no SQLSERVERFOUND property or anything like that in the log.

I can't see what you are doing, So maybe try manually putting that property in the Properties table and get that to work first.

0 Kudos

Added via Property Manager the property. No difference. Files attached.

Just search for "sqlserverfound".

 

 

 

0 Kudos

Here is my test project ism in XML format in case you need to see what I am trying to do. 

0 Kudos

I see 44 files.. but no .ism file.

0 Kudos

What do you mean? I can see the "BasicTest.ism" and test download it and open it in notepad fine.

0 Kudos

Ahhh yes. I see it now. Unfortunately I am using InstallShield 2019 R#... so I can only look at it with notepad. I will try to set up a test project this weekend and get back to you.

0 Kudos

Saw this online.

You can't do directly now. But, if it is XML format, change the value of SchemaVersion using notepad, let's say 783 is for 2020 R2 and for 2016 it is 777. If it is binary format then change the extension to msi and open with orca and change the value and rename the extension back to ism

 

I think I should be able to open an older version ism. Thanks in advance. 

0 Kudos

I set up a test project and got this to work for me. Perhaps your trouble is with the "Additional Options" selection. There are 2 radio buttons:

  • Just Store the value in the property
  • Store the value in the property and use the property in an Install Condition

You must select the first one. If you select the 2nd one it uses that as a condition for installing the entire application... not just a single component.

0 Kudos

Thanks for your help so far. Selecting the 1st option is what I have been doing all along. The 2nd option will lead to a message box being displayed and the installation stopped if SQL Server is missing. I tried the outcome of 2nd option earlier. 

Just in case I have missed something. I do it again and follow the help library article to the letter and make sure I select the 1st option in "Additional Options" area.  Then for the component "SQLFound" I set condition to NOT SQLSERVERFOUND="". For the component "SQLNotFound" I set the condition to SQLSERVERFOUND="".

The outcome is the same, always the file under component "SQLNotFound" got installed. 

 

If you have an ism that works and you can send it over as attachment. I will gladly try it out in case I miss something. 

 

 

 

 

0 Kudos

Well it turns out that doing what you want is not that simple 😞

From the InstallShield HELP obtained by searching for "System Search)"...

Searching for the Presence of a Registry Key

Windows Installer does not have built-in support for searching target systems for the presence or absence of a specific registry key. However, you can create a system search that looks for the default value of a specific registry key. If the default value is present, Windows Installer writes it to the system search’s associated property. If the system search fails to find the default value, Windows Installer leaves the property undefined.

So that is not very useful because the default value is often blank. You might have to resort to doing that using your favorite type of Custom Action.

0 Kudos