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]: Row[Next]: RowsDelete
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->Commands->/Row

The "/Row" Command

This command is normally called automatically by the "Row" command and so is rarely needed. It is used to delimit the user VBSCRIPT which is being used to process a record when the "@CODE='Y'" parameter was used.

This command takes these parameters:

EXAMPLE

The standard "bannrbmp" is a white bar with a graphic image on the right. To make it more managable I wish to split the image into two bitmaps, the first a very small "white" image which gets scaled to fill the area and a fixed size "icon" image.

The simplest method is to replace the "bannrbmp" binary and leave the "Control" table entries alone. If I did nothing else I would now have a plain white bar only on each dialog.

To add the "icon", I need to create a new record for every dialog making use of the "bannrbmp" graphic in the "Control" table. I do not wish to hard code all the values over multiple "Row" commands.

Splitting the bitmap into a scalable white bitmap allowed me to fill the area (pretty much impossible any other way) while also preventing the graphic from being resized.

;--- Insert the binaries ----------------------------------------------------
<$Binary ".\white.bmp"   KEY="bannrbmp"    DOCO="N">   ;;Very small image gets sized to fill area
<$Binary ".\Aust_DB.bmp" KEY="AUST_DB.BMP" DOCO="N">   ;;Will place fixed size bitmap on right of filled area

;--- Now create new record(s) -----------------------------------------------
<$Table "Control">
   <$Row @Where="`Control` = 'BannerBitmap'" @Code='Y' @OK=^? > 0^>
       ;--- Insert a new record (grabbing info from the located record) -----
       dim oRecNew : set oRecNew = oRec
       oRecNew.StringData(2)  = "CompanyLogo"
       oRecNew.IntegerData(4) = 330
       oRecNew.IntegerData(5) = 10
       oRecNew.IntegerData(6) = 26
       oRecNew.IntegerData(7) = 26
       oRecNew.IntegerData(8) = &H00100000 or 1    ;;Fixed size bitmap
       oRecNew.StringData(10) = "AUST_DB.BMP"
       oRecNew.StringData(11) = ""

       ;--- INSERT ----------------------------------------------------------
       oView.Modify MsiViewModifyInsert, oRecNew
       VbsCheck "Creating and inserting 'AUST_DB.BMP' record."
   <$/Row UPDATE="N">
<$/Table>

The above table inserts can now also be done like:

<$Table "Control">
#(
   <$Row
        @Where="`Control` = 'BannerBitmap'"
       @Method="INSERT"
           @OK=^? > 0^
       Control="CompanyLogo"
             X="330"
             Y="10"
         Width="26"
        Height="26"
    Attributes="&H00100001"            ;;Fixed size bitmap
          Text="AUST_DB.BMP"
  Control_Next=""
   >
#)
<$/Table>

This is an example where you wish to update an existing row:

;----------------------------------------------------------------------------
;--- Tell user what to do if they get a permissions issue -------------------
;----------------------------------------------------------------------------
<$Table "Error">
    ;--- Error 1303. The installer has insufficient privileges to access this directory: C:\ProgramData\Microsoft\Event Viewer\Views\ANZ.  The installation cannot continue.  Log on as administrator or contact your system administrator. ---
    <$Row @Where="Error = 1303" @OK=^? = 1^ @Code="Y">
          ;--- Work out the text to append ----------------------------------
          dim T3103 : T3103 = vbCRLF & vbCRLF & _
                              "Please see http://help.co/permissions for more information."

          ;--- The above is literal text (overkill for this example) --------
          T3103 = replace(T3103, "]",   vbTAB)    ;;Hide the right bracket
          T3103 = replace(T3103, "[",   "[\[]")   ;;Take care of "["
          T3103 = replace(T3103, vbTAB, "[\]]")   ;;Take care of "]"

          ;--- Append the text to the existing value ------------------------
          <$COLSTR.Error.Message> = <$COLSTR.Error.Message> & T3103
    <$/Row UPDATE="UPDATE">
<$/Table>


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]: Row[Next]: RowsDelete


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday April 07 2018 at 3:59pm
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.