Although you could use the setup executable you received from Stonefield Software Inc. to install Stonefield Query on your user's system, we recommend against that. For one thing, that installs the Configuration Utility, which your user isn't licensed to use and you almost certainly don't want your user accessing. Second, it shows the "Stonefield" name, which is a problem if you've private labeled or branded Stonefield Query. Finally, our setup won't install your customized project files, so you'd need to do that as a separate step.

Instead, we recommend creating your own setup executable. In addition to avoiding the problems mentioned above, you can customize your setup to exactly suit your needs.

Before discussing how to create a setup executable, a discussion of setup types is in order. Stonefield Query can be installed on either a single desktop computer for use as single-user software or a network server so it can be shared by several users across the network. It can also be installed in a Citrix or Windows Terminal Server environment; that works almost the same as a network server. For details on standalone versus network installations, see http://www.stonefieldquery.com/Support/FAQs.aspx.

In the case of a network server, there isn't any need to install the Stonefield Query program files (the files in Stonefield Query program directory) or your custom project files on a workstation, since they can be accessed from the workstation; you just need to install a shortcut to SFQuery.EXE on the server. However, like most Windows applications, a minimal set of runtime files is required on each workstation that runs Stonefield Query. To facilitate this, a workstation-only installer, WSSetup.EXE is provided. Be sure to include this file in your installer. This installer requires a file called Setup.INI in the application folder, with the following contents:

[Setup]
AppName=Application name
EXEName=Name of Stonefield Query executable without an extension
Company=Your company name

The Generate Setup function described below automatically creates this INI file on the user's system when they install your customized verstion of Stonefield Query. If you are using your own installation mechanism, be sure to distribute or create this INI file.

WSSetup.EXE also copies the help file to the user's workstation to avoid security issues with help files located on servers.

There are several ways you can create a setup executable for your Stonefield Query project.

Option 1. Using the Generate Setup Function

Inno Setup is a free installer for Windows programs that's easy to use, creates small setup executables, and runs quickly. We highly recommend it; in fact, it's the installer we use to install Stonefield Query SDK. You can download it from http://www.jrsoftware.org/isinfo.php. After installing Inno Setup, be sure to also download and install the QuickStart Pack, as it contains an add-on, the Inno Setup Pre-Processor (ISPP), which Stonefield Query requires.

The Generate Setup function in the Configuration Utility (available in the File and shortcut menus and in the toolbar) makes it even easier to use Inno Setup because you don't have to build the installation script yourself; this function generates a customized Inno Setup script for your Stonefield Query project. With this function, you don't have to know anything about Inno Setup; it can even generate a setup executable from the generated script file.

When you choose this function, the following dialog appears.

This dialog has the following options:

The template used to generate the script is in a file called InnoSetup.TXT in the Stonefield Query program directory. If you want to change how the Generate Setup function generates scripts, you can modify this file as you desire. For example, if you want to always use the same license agreement file, change the LicenseFile setting from "LicenseFile=<%=LicenseFile%>" (which replaces <%=LicenseFile%> with the EULA file you specify in the Generate Setup Files dialog) to a specific file name and path. Text between <%= and %> in InnoSetup.TXT are placeholders the Generate Setup function replaces with the appropriate values. The placeholders used are:

See the Inno Setup documentation for a description of the options in the script file.

Note that the script doesn't automatically include any sample reports; add a line to the [Files] section to include them; for example:

Source: "path\*"; DestDir: "{app}\Sample Reports"; Components: complete; Flags: ignoreversion

(where path is the location of your sample reports.)

Also, if your application uses the SQProxy object, you'll need to both install it and register it. Add the following to the [Files] section:

Source: "path\sqproxy.exe"; DestDir: {app}; Flags: ignoreversion

(where path is the Stonefield Query program folder on your system) and add the following to the [Run] section:

Filename: {app}\sqproxy.exe; Parameters: /regserver

Option 2. Using a Windows Installer-Based Installation Tool

If you use an installation tool that's based on the Windows Installer (such as InstallShield), create a setup using that tool that uses the following merge modules (you may have to download some of these merge modules from Microsoft's or your tool vendor's Web sites if you don't already have them). All of these merge modules are runtime components.

The setup will need to create a subdirectory of the program folder called Data and assign full permissions to all users to this folder.

Other files to include in the setup are:

You likely want the installer to create a shortcut for SFQuery.EXE. Specify "INI=project file folder" as a parameter (where project file folder is the folder where the Stonefield Query project files are installed) if the project files are in a different directory than SFQuery.EXE.

You should also have the installer create a Windows Registry key named HKEY_CURRENT_USER\Software\CompanyName\ApplicationName, where CompanyName and ApplicationName are the values of the Company Name and Application Name configuration settings. For example, if Company Name is "Bob Software Inc." and Application Name is "The Northwind Report Writer," create a Registry key called HKEY_CURRENT_USER\Software\Bob Software Inc.\The Northwind Report Writer. This allows the installer to remove all of Stonefield Query's Registry entries upon uninstall.

Option 3. Using an Installation Tool That Does Not Use Windows Installer

If you use an installation tool that's not based on the Windows Installer, the instructions are the same as for Option 2 (in other words, install the same files mentioned there), except you also install the following files (which are all runtime components) rather than the merge modules listed in Option 2: