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]: Error()[Next]: GuidGet()
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Source Code->VBSCRIPT->VBSCRIPT Functions - For Imbedded VB->GetSeqNumber()

GetSeqNumber()

This function is used internally by MAKEMSI whenever you use one of the MAKEMSI commands than needs to schedule a custom action relative to another.

You can call this function directly if you need to do your own scheduling. You must not cache the value or some other process might use the same number, use the value so any subsequent process don't reallocate it.

The function returns a sequence number (or displays an error message and terminates) and takes these parameters:

  1. The name of an existing sequence table (case sensitive).

  2. The specification (see below for more detail).

  3. How may sequence numbers do you need? MAKEMSI will look for an unused slot/block of that size. You would normally supply "1".

Note that the function does some table/row manipulation itself and so can't be used everywhere, for example it can't be used within a "Row" command block. You will probably get a cryptic message if it fails for this reason. The example below uses a VBSCRIPT variable to hold the value so the "row" command can access it.

The Specification Explained

Basically you describe a range of valid values and whether you prefer the value to be chosen from the lower (default) or higher end.

The range should be specified in the format "lower - higher". Either value can be omitted, be specified as an integer such as "1000" or the name of an action such as "InstallFiles". The default value for the lower end is "1" and for the higher "32767" and leading and trailing spaces for each are stripped. The minimum and maximum values can be returned as the range is inclusive.

By default MAKEMSI will choose a number as close as possible to the lower end, if you wish it to be as high as possible then begin the specification string with "<".

Some Examples:

You should of course be aware of what your script does, for example if it moves a custom action that you have already sequenced other actions relative to then that would probably be "bad"!

EXAMPLE

<$Table "InstallExecuteSequence">
#(
    ;--- Need to do this or "SourceDir" null if UI=none or basic ------------
    dim RsSeqNumber : RsSeqNumber = GetSeqNumber("InstallExecuteSequence", "CostInitialize-", 1)
    <$Row
          Action="ResolveSource"
       Condition=^<$CONDITION_INSTALL_ONLY>^
       *Sequence=^RsSeqNumber^
    >
#)
<$/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]: Error()[Next]: GuidGet()


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday February 28 2016 at 3:45pm
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.