/build/static/layout/Breadcrumb_cap_w.png

Exiting MSI Install based on System Search Condition set at runtime...

I am looking for suggestions on how to exit an MSI installation that will not generate error messages. (Using Wise PS 5.5)

What I have done is the following:

1. Set up a system search to look for a given file or reg key/value and set the results to a public property called SSRESULTS

2. Then in Execute Immediate, I've created a custom action using an IF statement to check the value of the Public Property. If the conditions are met, I want to exit the installation.

So far I have been able to get the logic to work just fine and the I can exit the install when condtions are met. The problem is that instead of the install just exiting, the install generates error messages. First is the message that the custom action is spewing out ( Internal error 2717). Then when you click OK a second message appears that is titled "Fatal Error" and states the the installation has ended prematurely.

So, this behavior can create confusion by making the user that is installing the package think that something disasterous has happened to their machine, when in reality, the script exited as intended based on the conditions and custom action test...

Its doing what I want, but its a mess... Is there any way to suppress these messages? I would think that this would be a common event ( to exit an install based on a system test ).

Is there a "cleaner", more user message friendly way to accomplish this simple, but overlooked task?

All suggestions are welcome.

Thanks - Ph

0 Comments   [ + ] Show comments

Answers (8)

Posted by: MSIPackager 19 years ago
3rd Degree Black Belt
0
How are you exiting the install if the system search conditions aren't being met? i.e. What does the 'then' part of your if then statement do?

We normally use the appsearch / signature / launch condtion tables to do this stuff and don't have any problems..
Posted by: ThePhoenix 19 years ago
Senior Yellow Belt
0
There is no "else" condition... If the system search turns up the file or reg entry that I am looking for - that triggers the exit. If the system search turns up empty, then the conditions are not met and the install continues normally. Seems quite simple - and it does work, but it is just noisy to the end user.

I am just looking for a more graceful way to exit an install without the MSI barking internal and fatal error messages to the end user.

Tell me more about your techique, if you would care to..

-PH
Posted by: Nikolas 19 years ago
Senior Yellow Belt
0
Here is the way we do it at MSIPackager's workplace. He was asking me how we did it so I thought it was a good excuse to sign up.

Use the AppSearch and related tables or System search to find your condition and assign it to a property (as you already do) our example uses property FINDJAVASDK
In the LaunchCondition table in the Condition column set the condition that must be met in order for the MSI to install EG FINDJAVASDK="C:\Program Files\j2sdk1.4.2_03\bin\java.exe". Here the property FINDJAVASDK must be set to the full path of the java.exe file as searched for in AppSearch/System search. In the description column of this table put the message you want the user to see if the condition is not met. They will click OK to the message and the install exits cleanly.

In the InstallExecuteSequence and InstallUISequence table change the AppSearch Sequence to 90. This means your MSI will run the AppSearch before evaluating the Launch Conditions and should therefore exit cleanly if these are not met.

Add your property to the Property table with a Value of 0 so it is initialised

Let me know what you decide to do. You could move the AppSearch and your Custom Action sequence around but I would stick with the Launch Condition as it is already in the MSI.
Posted by: ThePhoenix 19 years ago
Senior Yellow Belt
0
Nikolas - Thanks for taking the time to post your method. I will definately give it a try and see where it leads. It appears that this is just what I am looking for. Thanks again. I really appreciate your info.

-PH
Posted by: ThePhoenix 19 years ago
Senior Yellow Belt
0
Nikolas,

I cannot - for the life of me - get the launch conditon to evaluate properly. I have used your example in a test MSI.

Here is the scenario.. I have created a test MSI that just lays a few files down and merges a few reg keys and values into HKLM\Software. Quick to compile and simple...

1. Added Property called YESNOINSTALL to the prop table with string value of Null

2. Added a SystemSearch to seek the file FindMe.txt. In the AppSearch Table the Property is set to YESNOINSTALL and the Signature_ is set to AppFile

3. In the Signature Table, the Sig is AppFile and the FileName is FindMe.txt

4. Set the AppSearch in the UI and Exe Sequences to 75 to ensure that they are run before LaunchCondition.

5. In the LaunchConditon Table - for a Condition I have YESNOINSTALL ="C:\Temp\Findme.txt" and Description is Launch Conditon eval - so I know when it gets hit.

6. Located a text file ( Findme.txt ) in the Temp dir off the root of C ( C:\Temp\Findme.txt is the path )

7. Under MSI Script ( in User Interface ) I added a few display message boxes ( before and after the AppSearch event ) that display the value of the YESNOINSTALL prop as the MSI executes.

Compiled the MSI successfully and all is well.

Run the MSI and I can watch the public property value change as the script executes, but the launch condition does not eval the public prop value successfully. I have altered the syntax in the condition box and I even built a condition using the condition builder and it will not evaluate the value of the public property. I have tried just about every possible way to alter the conditon string in the Launch Condition table - and to no avail...

I know that this stuff is fickle... but am I missing something here? I have combed throught the SDK and from all of the info that I have - this should work, but it doesnt.

Any suggestions?
Posted by: aogilmor 19 years ago
9th Degree Black Belt
0
In the message box does it actually display "C:\Temp\Findme.txt " in the dialog?

See wise.com for KB how to use the dialog to see what the value is at runtime.

This is a good place to start
Posted by: ThePhoenix 19 years ago
Senior Yellow Belt
0
Thank you for the link. I will look at it further.
Posted by: Nikolas 19 years ago
Senior Yellow Belt
0
Use the AppSearch and related tables

[:)] Hi there Merry Xmas and all that.
Not sure if this is it but think you may not be using the Dr Locator Table and this is causing the problem. In the original post I said to use the "Appsearch and related tables" but probably should have said use Appsearch, Signature and DrLocator tables to set your variable. The DrLocator table in your example should look like this:

Signature_ AppFile
Parent
Path C:\temp
Depth 0

I would have thought if you were using SystemSearch in Wise that the DrLocator table would have been populated but I have only done it by editing the tables directly.

The launch condition must evaluate to true for the application to install. If the file is there it will install and if it is not Launch Condition eval should be displayed to the user.

Good Luck and let me know how you go.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ