AUTOPLAY Short Description

The program AUTOPLAY makes it possible to start other programs from a removable disk, like a CDs DVDs or an USB drives. Therefore, it is necessary to configure the program AUTOPLAY in an appropriated way.

Furthermore, to use the complete functionality of program AUTOPLAY it is strictly recommend­ed to ensure the so-called Autorun behavior for removable disks on your Windows operating system. Otherwise the program AUTOPLAY must be started by yourself.

Shortcuts

General Parameters: title, welcome, background, icon, alignment, fontname, fontsize, fontcolor, fontbold, border buttonsize

Button Parameters: label, tooltip, image, execute, parameter, alignment, afterwards

Pre-defined Keyboard Accelerators

F1 Show integrated program help.
ALT + LEER Open main window's system menu.
ALT + F4 End program AUTOPLAY.

Setup of Automated Program Launch

To configure an automated program startup of program AUTOPLAY it is necessary to ensure the existence of file autorun.inf within the removable disk's root directory. Usually, this file must be created. In any case, the file autorun.inf needs to be configured in a reasonable way. Otherwise, the program AUTOPLAY will not start automatically. See following code snippet for an example of the minimum content for file autorun.inf:

[autorun]
label  = USB Stick
icon   = autoplay.exe
action = USB Stick starten...
open   = autoplay.exe

If the autorun.inf file has been adapted and saved, to copy the program files autoplay.exe and autoplay.ini onto the removable disk should be the next step. Thereafter an adaption of file autoplay.ini needs to be done. The meaning of every single parameter will be explained during the rest of this document.

Structure of the Configuration File

The configuration file autoplay.ini consists of an amount of different parameter groups; the so-called sections. This follows the well-known structure of a typical Windows INI-file. But in general, the configuration file presented within this document distinguishes between two kinds of sections only; the general section and the sections to describe a single button.

Parameter Group of General Settings

The setup to control the program behavior in general will be done in the group [application]. Consequently, the settings made within this group effect the whole program AUTOPLAY. But pay attention, some individual parameters interact between themselves respectively they are depending on each other.

Parameter: title

This optional parameter may be used to modify the caption of program AUTOPLAY's main window. Omitting this parameter will result in a usage of the standard caption. Default value of this parameter is "Autoplay".

Example: title="Hello, World!"
 ↑ 

Parameter: welcome

This optional parameter may be used to specify an appropriated welcome text. This welcome text will be displayed (center aligned) in the upper range of the main window. Omitting this parameter will result in suppressing the usage of a welcome text. Default value of this parameter is "empty".

Example: welcome="Welcome to program Autoplay!"
 ↑ 

Parameter: background

This optional parameter may be used to specify a picture to be use as the main window's background image. The value type of this parameter is the name of a bitmap file (.BMP). This file name may also include a path pointing to a subdirectory on the removable disk. But such a sub-path must not include the leading backslash ("\")!

Furthermore, the given bitmap controls the size of the program's main window. This means, the bigger the image the lager will be the window dimension. On the other hand, if the given bitmap size is smaller than 300x200 pixel the background image is stretched onto this size. Omitting this parameter will result in a usage of white as the background color. Default value of this parameter is "empty".

Example: background=autoplay\background.bmp

Instead to a usage of a single background image, it is also possible to setup a directory with a list of bitmap files (.BMP) which will be displayed randomly. To accomplish, the parameter's value needs to be set to the keyword "RANDOM" followed by a subdirectory's path which contains all optional background images. As mentioned above this path must not include the leading back­slash ("\"). Furthermore, both parameter parts have to be separated by a comma (",")!

Example: background=RANDOM,autoplay\backgrounds
 ↑ 

Parameter: icon

This optional parameter may be used to specify a picture to be use as the application's icon. The value type of this parameter is the name of an icon file (.ICO). This file name may also include a path pointing to a subdirectory on the removable disk. But such a sub-path must not include the leading backslash ("\")! Omitting this parameter will result in a usage of the program's standard icon. In addition to that, you may use the keyword "OFF" as the parameter's value to suppress the usage of an icon. Default value of this parameter is "use internal icon".

Example: icon=OFF
 ↑ 

Parameter: alignment

This optional parameter may be used to control the vertical and horizontal button alignment. The value of this parameter is coded as "<vertical>,<horizontal>". The following table describes all possible and therefore allowed combinations of keywords available with this parameter.

TOP,LEFT TOP,CENTER TOP,RIGHT
CENTER,LEFT CENTER,CENTER CENTER,RIGHT
BOTTOM,LEFT BOTTOM,CENTER BOTTOM,RIGHT

Omitting this parameter will result in a usage of the default button alignment. Default value of this parameter is "CENTER,CENTER".

Example: alignment=TOP,RIGHT
 ↑ 

Parameter: fontname

This optional parameter allows an adaption of the font family to be used with the program. But notice, this will affect the welcome message and all button texts as well. Omitting this parameter will result in a usage of the default font family which is set to "Times New Roman".

Example: fontname=MS Sans Serif
 ↑ 

Parameter: fontsize

This optional parameter allows an adaption of the font size to be used with the program. But notice, this will affect the welcome message and all button texts as well. Omitting this parameter will result in a usage of the default font size which is set to "11".

Example: fontsize=6
 ↑ 

Parameter: fontcolor

This optional parameter allows an adaption of the font color to be used with the program. But notice, this will affect the welcome message and all button texts as well. The value of this parameter can have own of the pre-defined keywords "BLACK", "WHITE", "GRAY", "BLUE", "RED", "GREEN" or "YELLOW". If this is not nice enough it is also possible to use an RGB color definition instead. At this, the definition of such a color value is made through statement "RGB(<red>, <green> ,<blue>)". Omitting this parameter will result in a usage of the default font color which is set to "BLACK".

Example: fontcolor=RGB(255,222,76)
 ↑ 

Parameter: fontbold

This optional parameter allows a usage of "BOLD" as the font weight to be used with the program. But notice, this will affect the welcome message and all button texts as well. The type of this parameter is a typically boolean value (yes/no) and can have one of the pre-defined keywords "TRUE", "YES" or "1". Any other value content will be interpreted as "FALSE" instead. Omitting this parameter will result in a usage of the default font weight which is set to "NORMAL".

Example: fontbold=yes
 ↑ 

Parameter: border

This optional parameter may be used to adjust the program window's frame border. The value of this parameter can have own of the pre-defined keywords "TOOL", "THICK", "THIN" or "NONE". Omitting this parameter will result in usage of a dialog window's frame border.

Example: border=tool
 ↑ 

Parameter: buttonsize

This optional parameter may be used to adapt the size of every single button. The value of this parameter is coded as "<width>,<height>". Omitting this parameter will result in a usage of the default button size which is set to 200x42 pixels.

Example: buttonsize=300,55
 ↑ 

Parametergruppen zur Konfiguration einzelner Buttons

To define a single button you will need to put a so-called button sections into the configuration file autoplay.ini. At this, a particular attention needs to be put on the button section's name. This is because of the button section descriptor is built through the prefix "button" followed by the button section's number! Consequently, such a button section name looks like [button<n>].

The numbering of the button sections starts at zero ("0") and has to be incremented by one ("1") for each following button section. For example, if you plan to configure all in all three buttons it becomes necessary to have the corresponding button sections: one with name [BUTTON0], one with name [BUTTON1] and also one section with name [BUTTON1]. Attention: An unexpected program behavior can happen if this straight forward declaration is interrupted! As the result to this, if you miss one or more buttons you should check the numbering of each button sections at first.

Parameter: label

This optional parameter defines the button text. Omitting this parameter will result in a button without text. Default value of this parameter is "empty".

Example: label="Start a program..."
 ↑ 

Parameter: tooltip

This optional parameter may be used to specify a tooltip – a short description of "what the button actually does" – to be displayed if the mouse hovers over the corresponding button. No tooltip is used if this parameter is not set. Default value of this parameter is "empty".

Example: tooltip="This button starts a program!"
 ↑ 

Parameter: image

This optional parameter may be used to specify an image to be displayed on the button's right edge. The value type of this parameter is the name of a bitmap file (.BMP). This file name may also include a path pointing to a subdirectory on the removable disk. But such a sub-path must not include the leading backslash ("\")! If this parameter is not set or could the given file not been loaded no image will be displayed.

Furthermore you should notice, the size of the painted image depends on the button's height! This means, the higher the button the bigger the image. Also notice, a button's image is painted without alignment and without stretching. The color for transparent painting will be specified by the first bitmap's pixel, the pixel of the upper left corner!

Example: image=autoplay\execute.bmp
 ↑ 

Parameter: execute

This optional parameter may be used to define a button's action. Usually, such an action is to execute a program. Due to this fact, you should provide the file name of an executable right here. This file name may also include a path pointing to a subdirectory on the removable disk. But such a sub-path must not include the leading backslash ("\")!

But not only is the usage of an EXE file possible. You can also use file names with other extensions like TXT, PDF or HTML. Principle is that every file type is allowed which can be called with a registered program on the target system.

Furthermore, it is also possible to apply the pre-defined keywords "BROWSE" and "QUIT" (key­word "EXIT" is a synonym) to carry out special program behavior. The keyword "BROWSE" might be used to start the Windows Explorer within current directory, whereas the keywords "QUIT" and "EXIT" should be used to configure a button which is able to close the program AUTOPLAY.

Example: execute=procs\setup.exe
 ↑ 

Parameter: parameter

If a program requires a list of options than you can apply such a list to this parameter. You should notice program options depending on the program you want to execute and hence they should follow the rules of that program! If this parameter is not set the transferred option list is empty.

Example: parameter=-t -f test.dat
 ↑ 

Parameter: alignment

This optional parameter may be used to specify the horizontal alignment of a button's text. To justify the button text you can use one of the keywords "LEFT", "CENTER" or "RIGHT". Omitting this parameter will result a center aligned button text. Default value of this parameter is "empty".

Example: alignment=RIGHT
 ↑ 

Parameter: afterwards

Sometimes it makes sense to call a second program after the first program has been finished. For this purpose you may use this optional parameter. To define such a follow up action you simply apply the name of the button second you want to execute to this parameter. Attention: This parameter involves the risk of a recursion! To solve this problem the program AUTOPLAY limits the possible number of encapsulated afterwards calls to the number of configured buttons. This means, if you configure three buttons than the program AUTOPLAY repeats the afterwards action three times only.

Example: afterwards=button1
 ↑ 

Sample Configuration

Assume program AUTOPLAY should be configured in a way that the programs SETUP1.EXE and SETUP2.EXE will executed one after another. In addition assume that both programs are available from within the corresponding directories SETUP1 and SETUP2 which both are subdirectories of the root directory SETUP. Furthermore you also want to support a readme file with important information. Ongoing with assumptions program AUTOPLAY should have a welcome text a nice background image too. An EXIT button is configured in a way that is displays an appropriated pictogram. Under those conditions, the configuration file of program AUTOPLAY could look like as follows:

;;
;; AUTOPLAY sample configuration file.
;;

[application]
title      = "Setup via program "Autoplay""
welcome    = "Welcome to your own setup!"
background = autoplay\background.bmp
icon       = OFF
alignment  = BOTTOM,CENTER
fontname   = MS Sans Serif
fontsize   = 8
fontcolor  = BLUE
fontbold   = YES
border     = TOOL
buttonsize = 300,55

[button0]
label      = "Start setup 1"
tooltip    = "Starts the first setup."
image      =
execute    = setups\setup1\setup1.exe
parameter  =
alignment  = RIGHT
afterwards = BUTTON1

[button1]
label      = "Start setup 2"
tooltip    = "Starts the second setup."
image      =
execute    = setups\setup2\setup2.exe
parameter  =
alignment  = RIGHT
afterwards =

[button2]
label      = "Show README.TXT file"
tooltip    = "Runs an external programm to show readme file content."
image      =
execute    = setups\readme.txt
parameter  =
alignment  = RIGHT
afterwards =

[button3]
label      = "Browse removable disk"
tooltip    = "Runs the Windows Explorer within current directory."
image      =
execute    = BROWSE
parameter  =
alignment  = RIGHT
afterwards =

[button4]
label      = "Quit"
tooltip    = "Exits this setup program."
image      = autoplay\exit.bmp
execute    = QUIT
parameter  =
alignment  = RIGHT
afterwards =

;; EOF
 ↑