Tuesday, 21 June 2011

Conditions in WisePackagingStudio

Introduction
 
Conditions define criteria that the operating system or installation must meet for the installation to continue.
 
Conditions are expressions that can be either evaluated to true or false. By associating a condition with an element such as a property, feature or component within your MSI, you can determine whether something happens or not during the installation of that MSI. Through evaluating a condition to either true or false the MSI can allow or disallow an installation to continue, display certain dialogs depending on user input, install or not install certain features or components, executes or does not executes certain actions.
 
Based on whether the condition is true or not, you can determine whether to:
  • Allow the installation to continue.
  • Install certain features and components.
  • Display certain dialogs or dialog controls.
  • Execute custom actions you add in MSI Script.
As part of the Wise Package Studio tool, conditions can be created as appropriate. However, conditions are integral to most complex installations and in order to carry out advanced customization of your installation MSI they will almost certainly need to be used.
Conditions can be created in the areas given below Wise Package Studio:
  • The Features Page
  • Launch conditions
  • Conditions attached to Components
  • Conditions for Custom Action
Adding condition in Features page
On the features page in the Installation Expert - click on the name of the feature to which you want to add a condition. You will see in the example below that "Feature1" is selected.


Click on the Add Condition command button situated on the right of the dialog.
The Feature Condition dialog box appears.
Click on the Build command button

Create condition using the Condition Builder
Enter a condition for your installation. For this example, enter VersionNT>=600.
Click Ok once finished

Click Ok

You will see the condition for the feature as shown below.

Launch Conditions
Launch conditions are expressions that must evaluate to true for the installation to start. The launch condition is the first action which takes place in the execute sequence
 Click here for more information and steps to add launch conditions
Component Conditions.
Component conditions can be set anywhere in the installation and install resources based on conditions you have defined. They are important to the repackaging process because they control which files and keys install on an operating system or target machine in a particular domain.
Find the condition for components in Component table.
To edit the condition for component,
In Windows Installer Editor, click the Setup Editor tab,  click the Components tab then Right-click on the component and select Details.

If you prefer to edit conditions in the Condition Builder, click the Build button and edit conditions and then give ok.
Conditions for Custom Actions
Below is an example(just for demonstration)of a custom action that will Execute VBScript.
Click the MSI Script tab. Select Execute Deferred tab

In MSI Script click on Call VBScript From Installation
Fill in the details(for custom action)

Now I want to run this Custom Action only for the first time when I install the application.
Now Navigate To Installation Mode Select All Custom Actions
Double click on the Custom Action Name just created.

Following Window will appear.
Select Location Tab
Ensure that the position of the new custom action is just above InstallFinalize.

Enter Condition as NOT Installed or take the help of condition builder to build the condition
"Not Installed" is simply giving the instruction that if the action is not already installed on the system to install it.
Click Ok to Finish.

Now you can see the custom action within condition
If NOT Installed then
  Run the Action(Custom action for which you have   added the condition)

End

3 comments:

  1. Hai poorniam so nice to see this blog i am very happy. Its fantastic way of posting but pictures are not displaying only text i can see. can u please check it once.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Salesforce, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Application Packaging. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Nitesh Kumar
    MaxMunus
    E-mail: nitesh@maxmunus.com
    Skype id: nitesh_maxmunus
    Ph:(+91) 8553912023
    http://www.maxmunus.com/


    ReplyDelete