Debian Codegraph @

builds/install/arch-specific/win32/test_installer/Readme.md

raw
1 ## Firebird Binary Installer Test Harness - FBIT
2
3
4 ### Quick Start
5
6 * DO NOT run this script in a production environment.
7 * Using a snapshotted VM is recommended for initial use.
8 * Open a command prompt and execute
9
10 ``fbit.bat HELP``
11
12 to see what parameters you can pass. Or jump to [examples](#Examples)
13
14
15 ### Introduction
16
17 The executable Firebird Binary Installer is designed to be as simple as possible, allowing users of any level to more or less click through to have a working install. Options are kept as simple as possible so that the installation will work, no matter which options have been chosen. In addition the installer can be run from a batch script. This enables developers to embed it within their own deployment application.
18
19 Over the years bug reports have been made in the tracker but these are often untestable.
20
21 There have also been feature requests made and most have not made it into the installer. This is for two reasons:
22
23 * More options can be visually confusing during an interactive install, and certainly make a click through install more difficult for users as they are forced to make decision even though they may know nothing about Firebird.
24
25 * More options means more installation configurations are possible and there has not been a reliable method of testing these combinations
26
27 Currently this test harness consists of a single script. It is hoped that using it will make it easier to add new features as well as verify and reliably reproduce problems so that they can be fixed. Other scripts are planned for addition at a later date.
28
29
30 #### Intended Audience
31
32 This test harness is for anyone who wishes to integrate a scripted install of Firebird into their own installer or deployment program.
33
34 It is also intended to help developers to create reproduceable bug reports if they do experience installation problems.
35
36 ##### WARNING
37
38 > This script is not intended for use in a production environment.
39 > IT IS DELIBERATELY DESTRUCTIVE AS IT WILL DELETE THE INSTALLED VERSION OF FIREBIRD ON COMPLETION.
40
41 However it only installs and uninstalls Firebird using the features of the installer. It does not do anything that can not already be done with the installer itself.
42
43 It should also be noted that this script is not intended to be an example of best practice as far as creating a scripted install of Firebird is concerned. The script is way too complicated for that as it needs to support as many possible installation configurations as possible.
44
45
46 #### Assumptions
47
48 The script has only been tested on Windows 10 20H2 as an Administrator with UAC turned off.
49
50 The script can be run multiple times with different configurations. It is intended that the results of different install configurations can be compared with a tool such as BeyondCompare.
51
52 It is preferable that Firebird is not already installed. However, it doesn't matter as testing with an existing version of Firebird installed is itself a valid test of the installer. Such a test should fail and the results can be used for future analysis.
53
54 The script is designed to:
55
56 - execute a combination of installation options,
57 - make a copy of the new install
58 - save the install log and the install configuration into the copy of the install
59 - immediately uninstall the package
60 - save the uninstall log with the copy of the installation
61 - Generate some visual indications of the outcome of the installation and uninstallation
62
63 It is **NOT** designed for testing Firebird after the install has completed. However, if you wish to do so be sure to pass NOUNINSTALL otherwise the script will uninstall Firebird immediately.
64
65
66 #### System Requirements
67
68 * The test script is designed to run on Windows systems that are currently supported by Microsoft. It should run on earlier versions too but they may lack features that have been introduced into newer releases of Windows.
69 * A version of grep needs to be on the path. Other posix tools _may_ be required at a later date.
70 * A Firebird Binary installer package is required. Any version of Firebird _should_ work but testing has only been done with Firebird 4.
71
72 There are no particular installation requirements. The script is intended to be run at command prompt.
73
74
75 #### Configuration
76
77 There are some hard coded variables near the beginning of the script. These need to be changed to suit your setup. In particular, FBINST_EXEC must point to the Firebird Binary Installer you wish to test. See the section :SET_GLOBAL_ENV in the script.
78
79 #### Examples
80
81 Here is a typical configuration to run the regular interactive installer:
82
83 ``fbit.bat``
84
85 This will produce the same installation, but entirely scripted:
86
87 ``fbit.bat SCRIPTED``
88
89 Uninstallation is automatic and by default will leave files such as firebird.conf in place. There is a 'clean' option to test complete removal of a Firebird install:
90
91 ``fbit.bat SCRIPTED CLEAN``
92
93 This sort of command will override the defaults to install Firebird SuperClassic as an application with no automatic start:
94
95 ``fbit.bat SCRIPTED SUPERCLASSIC APPTASK NOAUTOSTART``
96
97 All install runs are archived into %USERPROFILE%\fbit-tests with a unique name. You can add your own test identifier by passing TESTNAME name
98
99
100 After a full firebird build from the same console prompt where run_all.bat was run this command will test the freshly built package:
101
102 ``..\install\arch-specific\win32\test_installer\fbit.bat SCRIPTED CLEAN TESTNAME SmokeTestAfterBuild``
103
104
105
106 #### Functionality Not Yet Implemented
107
108 * A detailed explanation of InnoSetup error codes will be added.
109 * Some more verifications will be added
110 - test that server is running
111 - SYSDBA can connect to employee db locally and via localhost
112
113
114
115 #### Known issues and problems
116
117 1/ The current focus of FBIT is to test Firebird specific features of the installer. It is not intended as a generic test tool for all InnoSetup based installers. Many scriptable options of InnoSetup based installers have not been implemented and perhaps may never be implemented.
118
119 MERGE_TASKS is currently not possible as it requires use of the ! exclamation mark to unset a task. However FBIT uses Delayed Variable Expansion which strips all instances of '!' during assignment.
120
121 The /HELP option is not implemented and probably never will.
122
123 /CURRENTUSER and /ALLUSERS may be implemented at a later date.
124
125 The various options around RESTART, CLOSE APPS, RESTARTCLOSEDAPPS have not been implemented mainly because the installer does not use them. They may never be implemented in the test harness.
126
127 /LOADINF hasn't been implemented but could be.
128
129 /DIR, /TYPE, /TASKS, /COMPONENTS, /LOG and /SAVEINF are implemented internally in FBIT. It doesn't make sense to expose them.
130
131 /GROUP and /NOICONS could be implemented but currently are not.
132
133 /LANG= probably will be implemented in fbit but is not currently available.
134
135 A full list of the standard InnoSetup commandline params as of December 2020 is available in a text file accompanying this package.
136
137 2/ Parameter passing is not 100% reliable.
138
139 3/ Uninstall error codes from InnoSetup are not reliable.
140
141 4/ Cancelling an interactive uninstall is not detected. Verification of the cancelled uninstall will subsequently detect errors that are not in fact errors.
142
143 5/ Installation type always becomes CustomInstall.
144
145 6/ It is not possible to choose the installation language used by scripted installs.
146
147 7/ Running an interactive install with this script is not well tested.
148
149
150
151 #### When things go wrong
152
153 What could possibly go wrong?
154
155
156
157 ### Future Enhancements
158
159 Possible features that will be added to the harness are:
160
161 * Diagnostic report of an existing Firebird installation along with details of O/S and H/W
162 * A test suite that runs through all known/reasonable combination of options
163 * A script to uninstall MS runtimes that have been deployed by the installer.
164 * A means to scrub the registry of all references to previous Firebird installs.