MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: FilesInUse Dialog - Display if Program Running[Next]: Logo on Dialogs
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->User Interface Tips->Licence Dialog Enabling

Licence Dialog Enabling

If you use the "Preferred MSI Interface for Building a Complete MSI" then the licence dialog is conditionally disabled depending on whether you appear to have a licence to display or not.

To display a licence you will need to use "wordpad", "word" or a similar word processor to produce an "rtf" formatted file.

Method 1 - .VER file

Probably the easiest way to specify a licence file is via the "licence" keyword in the product information section.

Please note that I use the english spelling "licence" and not "license".

Method 2 - ".licence.rtf" file

If a licence file matching the name defined in the "COMPANY_LICENCE_NAME" macro exists then this will be used. By default this is defined such that if you have a "TryMe.MM" file then it will look for a licence file of "TryMe.licence.rtf".

You should not try to use both methods of specifying the licence file otherwise a warning message (and return code) will be generated.

The main options related to the searching for a licence file are:

#define? COMPANY_LICENCE_SPELLING_C_OR_S  c           ;;Spelling - Licence OR License?
#define? COMPANY_LOOK_FOR_LICENCE_FILE    Y           ;;Y/N - Look for file or just use if supplied?
#define? COMPANY_PREPROCESS_LICENCE_FILE  N           ;;Y/N - Does sthe file contain macros or decisions etc?
#define? COMPANY_LICENCE_EXTN             .licen<$COMPANY_LICENCE_SPELLING_C_OR_S>e.rtf  ;;US spelling?
#define? COMPANY_LICENCE_NAME             <?InputFile $$FilePart:w><$COMPANY_LICENCE_EXTN>

Please see the "options for commands" section of the manual.

Administration Install Sequence

The licence doesn't normally appear during an administrative install, if you want the same license details to appear between the "AdminWelcomeDlg" and "AdminInstallPointDlg" dialogs then the following code does this by:

  1. Setting up my own property ("ITSADMIN") so that it contains "Y" when its an administrative install, this allows me to change the common dialog's forwards and backwards operations to work correctly for both cases.

  2. Altering the "ControlEvent" table for the two admin dialogs so forward and back buttons go to the new "inserted" licence dialog.

  3. Modified the "LicenseAgreementDlg" dialog so it works in both cases.

I used the "Using ORCA and MSIDIFF to Automate MSI Updates" procedure to produce this output (slightly reorganised to aid clarity) which you should be able to append to your script:

;#include "OpenMsi.MMH"
;<$Msi 'C:\Program Files\MakeMsi\Samples\TryMe\DB$\2009-05-14 - licence\out\TryMe.MM\MSI\AdminSequenceWithLicence.msi' Template='C:\Program Files\MakeMsi\Samples\TryMe\DB$\2009-05-14 - licence\out\TryMe.MM\MSI\Before.msi'>

<$Table "AdminUISequence">
   #(
       <$Row
              Action="ItsAdmin"            ;;Set my "ITSADMIN" property
           Condition=""
            Sequence="10"
       >
   #)
<$/Table>
<$Table "CustomAction">
   #(
       <$Row
                 Action="ItsAdmin"
                   Type="51"
                 Source="ITSADMIN"          ;;My new property
                 Target="Y"                 ;;Make its value "Y"
           ExtendedType=""
       >
   #)
<$/Table>


<$Table "ControlEvent">
   <$RowsDelete WHERE="`Dialog_` = 'AdminWelcomeDlg' AND `Control_` = 'Next' AND `Event` = 'NewDialog' AND `Argument` = 'AdminInstallPointDlg' AND `Condition` = '1'">
   <$RowsDelete WHERE="`Dialog_` = 'AdminInstallPointDlg' AND `Control_` = 'Back' AND `Event` = 'NewDialog' AND `Argument` = 'AdminWelcomeDlg' AND `Condition` = '1'">
   #(
       <$Row
             Dialog_="AdminWelcomeDlg"
            Control_="Next"
               Event="NewDialog"
            Argument="LicenseAgreementDlg"
           Condition="1"
            Ordering="2"
       >
   #)
   #(
       <$Row
             Dialog_="AdminInstallPointDlg"
            Control_="Back"
               Event="NewDialog"
            Argument="LicenseAgreementDlg"
           Condition="1"
            Ordering=""
       >
   #)

   <$RowsDelete WHERE=^`Dialog_` = 'LicenseAgreementDlg' AND `Control_` = 'Next' AND `Event` = 'NewDialog' AND `Argument` = 'SetupTypeDlg' AND `Condition` = 'IAgree = "Yes"'^>
   #(
       <$Row
             Dialog_="LicenseAgreementDlg"
            Control_="Next"
               Event="NewDialog"
            Argument="AdminInstallPointDlg"
           Condition='(ITSADMIN = "Y") and  (IAgree = "Yes")'
            Ordering=""
       >
   #)
   #(
       <$Row
             Dialog_="LicenseAgreementDlg"
            Control_="Next"
               Event="NewDialog"
            Argument="SetupTypeDlg"
           Condition='(ITSADMIN  <> "Y") and  (IAgree = "Yes")'
            Ordering="1"
       >
   #)

   <$RowsDelete WHERE="`Dialog_` = 'LicenseAgreementDlg' AND `Control_` = 'Back' AND `Event` = 'NewDialog' AND `Argument` = 'WelcomeDlg' AND `Condition` = '1'">
   #(
       <$Row
             Dialog_="LicenseAgreementDlg"
            Control_="Back"
               Event="NewDialog"
            Argument="AdminWelcomeDlg"
           Condition='ITSADMIN = "Y"'
            Ordering=""
       >
   #)
   #(
       <$Row
             Dialog_="LicenseAgreementDlg"
            Control_="Back"
               Event="NewDialog"
            Argument="WelcomeDlg"
           Condition='ITSADMIN <> "Y"'
            Ordering=""
       >
   #)
<$/Table>
;<$/Msi>


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: FilesInUse Dialog - Display if Program Running[Next]: Logo on Dialogs


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday August 13 2017 at 2:39pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.