Command-line parameters and option storage.
Specifying a comparison project on the command line.
Starting from version 1.90, AdeptSQL Diff supports a number of start-up
parameters on the command line.
The parameter you'd most commonly use is a comparison project's
filename. A comparison file (filename.ASQ) contains all connection information and settings
the Diff needs to start comparing two databases (you might need to supply the passwords,
though), so when you specify it in the command line, the Diff will run the comparison immediately:
asqldiff c:\my_comparison.asq
When the Diff gets installed, it registers itself as the application to open .ASQ files.
Therefore to re-run a saved comparison, you can simply click a comparison
document in a File Explorer window.
The Diff also recognizes several command-line switches. Since most of the
switches control loading and saving of the Diff's options, let's first look where the Diff
keeps its configuration.
Storing options in file or registry; "portable" mode.
Starting from version 1.90, AdeptSQL Diff can keep its configuration in .INI
files as well as in the system registry. Please note that the
Diff options format in the registry has changed and is not backward-compatible.
The program will NOT read the old settings, so even if you have an earlier version,
you'll have to configure the new one again.
When the Diff starts (without any command line switches modifying its behaviour), it first tries to locate a file
called ASQLDIFF.INI in the same directory where the executable is running from.
If such file exists, the settings it contains are loaded. After that, the Diff
checks if another set of options exists in the system registry.
If it does, whatever is in the registry overrides the settings from the ASQLDIFF.INI file.
When the program is closing, it writes its modified configuration back to the
registry, or if the registry key for AdeptSQL Diff doesn't exists, back to the INI file.
The Diff won't write its configuration to both places at once and it won't
write to the registry if no Diff keys existed before.
The reasoning behind such behaviour is as follows. The configuration file ASQLDIFF.INI
is included in the setup and supposed to contain some "original" or "default"
option set. It is normally not overwritten when the program exits. The registry
entry for AdeptSQL Diff is created when the program is installed and works as the
regular option storage. All changes you make are normally saved there.
However, it is anticipated that the Diff can also be used in "portable" mode,
when it is not actually installed on a system, but is run directly from a removable
media, like AdeptSQL Toolkit flash drive. In this case there will be originally
no registry key for AdeptSQL Diff and none will be created as a result of
running the program, so the system remains "clean". All options will be both loaded from and saved to the default
.INI file.
Command-line switches.
The command-line switches can be placed either before or after the document name
and must start with '/' or '-'. The switches are case-insensitive, some of them
have several alternative spellings (e.g. '-i' or '-ini'). Some of
them can be optionally followed by an INI file name, which must not be confused
with the comparison document parameter described above (so you must NOT specify
"-i", "-ri" or "-wi" directly before the document name).
The following switches are supported:
| -i|-ini [ini_file] |
Forces the Diff to read configuration from and save it to the default or specified
.INI file, even if the registry entry is present. This works as a shortcut for the
combination of -ri and -wi switches described below.
|
| -ri [ini_file] |
Forces the Diff to read configuration from the default or specified
.INI file. Does not affect saving the changed options on exit.
|
| -wi [ini_file] |
Forces the Diff to write configuration to the default or specified
.INI file. Does not affect loading the options on startup.
|
| -reg |
Forces the Diff to create a registry entry for the product, if it didn't exist before.
Therefore on exit the Diff would write its configuration to the registry, according to the
rules described above. While the switch doesn't exactly conflict with -ini
or -wi switches, it doesn't make much sense to use them together. On the other hand,
the combination of "-ri [ini_file] -reg" would have an effect of copying
all settings from the INI file to the registry.
|
-nc or
-nocompare |
This switch can be used when you also specify a comparison file to tell the Diff
that all comparison configuration should be loaded, but the comparison is not to be
started automatically. This allows you to change the connection parameters
of the loaded comparison before pressing [Compare]
|
Environment settings vs. project-level settings.
In version 1.90, there is no overlap between "project options" (those specific
to a particular comparison and saved in a .ASQ file) and "environment options" (saved
to registry or .INI file as described above). The project-level settings include connection
parameters and any schema-loading filters, renaming associations and DataDiff
settings for specific tables. All the rest - any settings that are available through
the Options dialog (e.g. scripting styles) are considered "environment-level" and
not saved with the project. It is possible that future versions would allow to
redefine some of these setting on the project level as well, but no such functionality
is implemented so far.
Meanwhile, if you really need different option sets for different comparisons,
use the command-line switches described above to start the Diff with different
configuration files according to the comparison you are going to work with:
asqldiff -i c:\my_options.ini c:\my_comparison.asq
|