|
Introduction
Normally ShellRun just tries to display one file when it starts,
set in the filename parameter.
However, ShellRun has these further options:
-
-
- , including boolean operators and these tests:
Displaying more than one file when ShellRun starts
If you want to display other files then specify their filenames in up to ten more
filenameN parameters.
Start with filename1, filename2,
etc. up to filename10.
Here's an example ShRun.INF file that has a main file
index.html , a web page. However it also shows README.TXT
and a movie Welcome.mov .
[Info]
filename=index.html
.
.
filename1=README.TXT
filename2=Welcome.mov
These other files are only shown if the main filename is shown successfully.
These other files can be any file type, including the same type as the main file.
These other files will usually appear "on top of" the main file, with the highest
numbered such file on top.
No indication is given if there is any problem showing any of these other files,
eg if the file does not exist or if there is no viewer.
Running programs
Each filename can be a program instead of file. You can use
filenameNParam
and filenameNSpecialParam parameters to provide a command line to
a program. The process is the same as used for the main filename -
.
This example shows how to show a web page in kiosk mode if Internet Explorer is the default browser:
[Info]
...
filename1=index.htm
filename1SpecialParam=iexplore.exe,-k %F
Display a menu of command buttons
ShellRun can display a list of command button options in its popup window, as shown in this example,
which has a menu on the left, and a sub-menu shown when the "Play videos" button is clicked:
To configure the appearance of the buttons, see the page.
The ShellRun menu is made up of the filename and
filenameN parameters which have associated
filenameMenu and
filenameNMenu parameters.
The 'menu' parameters specify the text to go on the command button.
If a 'filename' parameter has a 'menu' equivalent, then the filename is not shown straight away,
but only shown if the user clicks on the relevant command button.
To obtain a sub-menu for one of the main buttons, keep the filenameMenu or
filenameNMenu parameter, but miss out the correspnding
filename or filenameN parameter.
Then: add in up to 10 more corresponding sub-menu items, as follows,
either:
Filename_1, Filename_1Menu, Filename_2, Filename_2Menu, etc
or:
FilenameN_1, FilenameN_1Menu, FilenameN_2, FilenameN_2Menu, etc.
You cannot supply Condition, Param or SpecialParam options for sub-menu items.
Example
This example shows the contents of the ShRun.INF file to make the above screenshot:
[Info]
filename=~AudioCD~play
filenameMenu=Play CD Audio
filename1=index.htm
filename1Menu=Show web site on CD
filename2=info.doc
filename2Menu=Read documentation
filename3Menu=Play video
filename3_1=product.wmv
filename3_1Menu=Product video
filename3_2=howto.mwv
filename3_2Menu=How to video
filename3_3=bloopers.mwv
filename3_3Menu=Out-takes video
Popup window configuration
If a menu is display, then the popup window by default is centered on the user's screen.
You can override the window position by setting the xPos
and yPos parameters. If you use a Splash window, you may want to
reposition it so that it does not obscure the popup window.
By default, the menu buttons appear below the information and message text.
However you can override this by setting the xMenu
and yMenu parameters.
If you want the popup window to close when the user clicks on any button then add 2 to the value of
the ShowOptions parameter.
The ShowTime parameter determines how long the popup window stays on screen.
Set this to -1 to keep the popup window permanently on display. If you want the first menu option
to be displayed when a timeout expires, then add 4 to the value of
the ShowOptions parameter.
File display conditions
You can make the display of any file conditional, ie for
filename and
filename1 to filename10.
Each file is only displayed if the condition evaluates to true .
The condition (or conditions) for each file are specified in separate parameters
in ShRun.inf . For filename the condition is
specified in FilenameCondition. The other
conditions are set in parameters Filename1Condition
to Filename10Condition.
ShellRun's still operates,
so you can handle cases where no viewer is installed for the main
filename. Note that this viewer checking is
done first, before any display conditions are checked.
Example
In this example, ShellRun displays one of three presentation files depending on which
version of PowerPoint is installed.
The v command is used to test the viewer executable filename and version;
a full explanation of the syntax is given below.
[Info]
Filename=intro.ppt
FilenameCondition=v?not,PowerPnt.exe
Filename1=intro97.ppt
Filename1Condition=v?0.0.0.0,PowerPnt.exe:9.0.0.0,PowerPnt.exe
Filename2=intro2k.ppt
Filename2Condition=v?9.0.0.0,PowerPnt.exe
- If PowerPoint 2000 or later is installed then
intro2k.ppt is shown
- If an earlier version of PowerPoint is installed then
intro97.ppt is shown
- If another PowerPoint viewer is installed (eg PowerPointViewer) then
intro.ppt is shown
- If no viewer is installed at all, then ShellRun displays a message saying no viewer is available.
(If you add ShellRun parameters to install PowerPointViewer, then it tries to show
intro.ppt after the installation has completed.)
Condition syntax
Each condition parameter can contain one or more condition elements, where
each condition element is either a test or a boolean operator.
Do not put any spaces in conditions, unless they are needed as a part of
file or registry key names.
Command |
Description |
|
f |
File present test |
|
r |
Registry test |
|
v |
Viewer filename or version test |
|
& |
Boolean AND |
|
| |
Boolean OR |
|
! |
Boolean NOT |
|
The question mark ? character separates commands and their arguments.
Given that the f command simply tests whether a file is present on the user's computer,
consider the following example:
[Info]
FilenameCondition=f?C:\test1.txt
Filename1Condition=!?f?C:\test1.txt
Filename2Condition=f?C:\test1.txt?&?f?C:\test2.doc
Filename3Condition=f?C:\test1.txt?|?f?C:\test2.doc
Filename4Condition=f?C:\test1.txt?|?!?f?C:\test2.doc
- filename is shown if
C:\test1.txt
is present.
- filename1 is shown if
C:\test1.txt
is not present.
- filename2 is shown if
C:\test1.txt
and C:\test2.doc are present.
- filename3 is shown if
C:\test1.txt
or C:\test2.doc are present.
- filename4 is shown if
C:\test1.txt
is present or C:\test2.doc is not present.
Note that the Boolean OR | and NOT ! command characters look similar,
so be careful when you use them.
File conditions
The file command f tests if a file is present on a user's computer.
Put a ? after the f and then follow this by the name of the file
you want to test for, usually including the drive letter.
If you only want to proceed if a file is not there, then
precede the condition with a Boolean NOT ! command.
In this example, ShellRun shows instlld.htm if file trial.exe
is present (in the expected directory, C:\Program files\PHD\test\ ) ;
ShellRun shows noinst.htm if trial.exe is not present.
[Info]
Filename=instlld.htm
FilenameCondition=f?C:\Program files\PHD\test\trial.exe
Filename1=noinst.htm
FilenameCondition=!?f?C:\Program files\PHD\test\trial.exe
Testing for specific files has a drawback: the file may not be in the
place you expect. For example, the user may have installed a program to
an unusual directory, or deleted, renamed or moved the file.
It is usually therefore better to use a registry test if this possible.
Registry conditions
The registry command r tests a registry key value on a user's computer.
It can test whether the registry key value is present, or do various comparisons.
Sub-command type |
Syntax |
Example |
Key value present |
keyname |
r?HKEY_CURRENT_USER\Software\PHD\test\Settings\Loaded
|
Key value equals |
keyname=value |
r?HKEY_CURRENT_USER\Software\PHD\test\Settings\Loaded=1
|
Key value greater than |
keyname>value |
r?HKEY_CURRENT_USER\Software\PHD\test\Settings\version>0x0102
|
Key value less than |
keyname<value |
r?HKEY_CURRENT_USER\Software\PHD\test\Settings\version<1234
|
The keyname consists of a registry key and the value name.
If you use Windows Registry Editor, the keys are displayed on the left,
while the value names are displayed on the right;
put both these elements together (with a \ character in between)
to make the keyname.
The keyname must start with one of these root key names:
HKEY_CLASSES_ROOT\
HKEY_CURRENT_USER\
HKEY_LOCAL_MACHINE\
HKEY_USERS\
The value name can be blank, in which case you are testing the default string value -
shown as (Default) at the top of the value name list in the Registry Editor.
Registry values can have various types. If ShellRun finds that the
keyname value is type DWORD, then it interprets
the comparison value as a number; the
value can then be an ordinary decimal number,
or in hexadecimal if it is preceded by 0x .
If the keyname value is type DWORD, then numeric
comparisons are done. For all other key types, a string comparison is done.
(String comparisons < and > do work, albeit strangely:
a is less than z , but
Z is less than a .)
In this simple example, ShellRun only shows file upgrade.htm
if DWORD registry key value HKEY_CURRENT_USER\Software\PHD\test\Settings\Version
is less than 4.
[Info]
Filename=upgrade.htm
FilenameCondition=r?HKEY_CURRENT_USER\Software\PHD\test\Settings\Version<4
Viewer conditions
The viewer command v tests the viewer that the user has for the display file.
ShellRun can test the viewer executable version and filename.
(If no viewer is installed for the main
filename, then the separate
ShellRun parameters are
run instead of these conditions.)
Viewer executable filenames and versions
Each display file has an associated viewer (if a viewer is installed).
for filename and version details of some typical applications.
For a Microsoft Word file intro.doc , the viewer executable might be
C:\Program Files\Microsoft Office\Office10\WINWORD.EXE
with version 10.0.4219.0 if Word XP is installed.
In this case ShellRun ignores the directory and considers the
viewer executable filename to be WINWORD.EXE .
Windows program version numbers are 4 numbers (each in the range 0 to 65535).
For example, the Acrobat Reader viewer 5.01 is in file AcroRd32.exe which has
file version 5.0.1.329. The numbers to the left are most significant.
You can use the ShellRun Viewer Browser to determine the viewer and viewer version
for a file type on your computer. Alternatively, locate the viewer program using
Windows Explorer. Right-click on the program icon and select Properties then the
Version tab. The file version number is listed at the top.
Viewer condition commands
Sub-command type |
Syntax |
Example |
Version greater than or equal |
version1 |
v?10.0.0.0
|
Version range |
version1:version2 |
v?6.0.0.0:7.0.0.0
|
Version greater than or equal, filename test |
version1,filename1 |
v?10.0.0.0,winword.exe
|
Version range, filename test |
version1,filename1:version2,filename2 |
v?6.0.0.0,winword.exe:7.0.0.0,winword.exe
|
Not filename test |
not,filename1 |
v?not,winword.exe
|
- For the "Version range" test, the condition succeeds if the viewer executable version
is greater than or equal to version1 and less than
version2.
- For the "filename" tests, the condition fails if the viewer executable filename
does not match that given in filename1 or
filename2.
- For the "not filename" test, the condition succeeds if the viewer executable filename
does not match that given in filename1.
Example
In this example, we only want to show one of three files:
intro2k.ppt if PowerPoint 2000 or later is installed,
intro97.ppt if an earlier version of PowerPoint is installed,
or intro.ppt if any other viewer is installed (ie PowerPoint Viewer).
- PowerPoint 2000 typically has version number 9.0.0.3821.
- For PowerPoint, the viewer executable has always been
PowerPnt.exe . For PowerPoint Viewer, the current executable is
ppview32.exe .
- You can use the ShellRun Viewer Browser to determine the viewer executable and version
for a file type on the current computer.
for the results for some typical applications.
[Info]
Filename=intro.ppt
FilenameCondition=v?not,PowerPnt.exe
Filename1=intro97.ppt
Filename1Condition=v?0.0.0.0,PowerPnt.exe:9.0.0.0,PowerPnt.exe
Filename2=intro2k.ppt
Filename2Condition=v?9.0.0.0,PowerPnt.exe
Working backwards:
intro2k.ppt is shown if the viewer filename is PowerPnt.exe
and the viewer version is 9 or greater, ie PowerPoint 2000 or later.
intro97.ppt is shown if the viewer filename is PowerPnt.exe
and the viewer version is greater than or equal to 0 and less than 9,
ie an earlier version of PowerPoint.
intro.ppt is shown if the viewer filename is not PowerPnt.exe ,
ie if the installed viewer is PowerPoint Viewer.
The "not,PowerPnt.exe" case is deliberately put first. If no viewer is available,
then ShellRun can be set up to install the PowerPoint Viewer. When installation
is complete, ShellRun will again try to display the
filename. In this case it is correct for
file intro.ppt to be shown.
Common application versions
This section gives a guide to the version numbers and executable filenames
used by some of the most common viewer applications.
These are typical values - not a definitive list.
Some older versions of Windows may not display a full set of 4 digits for a version number.
In general, application version numbers reflect the program version number for their
first number. The less significant numbers can usually be ignored, so to test for
Word 2000 only specify 9.0.0.0:10.0.0.0 , ie anything where the first
version number is 9.
For Office viewer applications, the version number seems to indicate the lowest version
they cope with, eg Word Viewer has version 8.0.0.3920 which would seem to indicate
- correctly - that it will cope with Word 97 files or later (because Word 97 also starts with
8, ie 8.0.0.3514 ).
Application |
File extension |
Typical version number |
Executable filename |
Acrobat 4 |
.pdf |
4.0.5.0 |
Acrobat.exe |
Acrobat 5 |
.pdf |
5.0.5.452 |
Acrobat.exe |
Acrobat 6 |
.pdf |
6.0.0.878 |
Acrobat.exe |
Acrobat Reader 4 |
.pdf |
4.0.0.0 |
AcroRd32.exe |
Acrobat Reader 5 |
.pdf |
5.1.0.216 |
AcroRd32.exe |
Excel 2000 |
.xls |
9.0.0.3822 |
Excel.exe |
Excel XP 2002 |
.xls |
10.0.4524.0 |
Excel.exe |
Excel Viewer |
.xls |
8.0.0.0 |
XlView.exe |
Internet Explorer 6 |
.htm .html |
6.0.2800.1106 |
iexplore.exe |
Mozilla |
.htm .html |
1.0.0.0 |
mozilla.exe |
Netscape 3 |
.htm .html |
3.1.0.0 |
netscape.exe |
Netscape 4.73 |
.htm .html |
4.73.0.4 |
netscape.exe |
Netscape 6 |
.htm .html |
6.1.0.0 |
netscp6.exe |
Netscape 7 |
.htm .html |
7.0.0.0 |
netscp.exe |
Opera 6 |
.htm .html |
6.0.1107.0 |
opera.exe |
PowerPoint 2000 |
.ppt |
9.0.0.3821 |
PowerPnt.exe |
PowerPoint XP 2002 |
.ppt |
10.0.4205.0 |
PowerPnt.exe |
PowerPoint Viewer |
.ppt |
8.0.0.5625 |
ppview32.exe |
Word 6 |
.doc |
6.0.0.2513 |
WinWord.exe |
Word 97 |
.doc |
8.0.0.3514 |
WinWord.exe |
Word 2000 |
.doc |
9.0.0.2717
9.0.0.3822
|
WinWord.exe |
Word XP 2002 |
.doc |
10.0.4219.0 |
WinWord.exe |
Word Viewer |
.doc |
8.0.0.3920 |
WordView.exe |
WordPad |
.doc |
5.1.2600.1106
5.0.2170.1
5.0.1691.1
|
WordPad.exe |
|