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:
- Password for setup: if you want your setup executable to be password protected, specify that password in this setting.
- EULA license file: if you want the user to be prompted to accept an End-User License Agreement (EULA), specify the name of the file containing the text for the EULA. This file must be either a text file or a Rich Text Format (RTF) file.
- Setup script file: the default name and path for the Inno Setup script file is Setup.ISS in your Stonefield Query project directory. You can specify a different file name or path if you wish.
- Setup executable file: the default name and path for the setup executable generated by Inno Setup is Setup.EXE in your Stonefield Query project directory. You can specify a different file name or path if you wish.
- Create setup executable: if you choose this option, the Generate Setup function generates the script file and then runs the Inno Setup compiler to generate the setup executable for you. Note that because the Configuration Utility holds open several files listed in the Inno Setup script file, including the project files for your customized Stonefield Query project, and the Inno Setup compiler won't compile a script if any of the listed files are open in another application, the Configuration Utility closes during the compilation and re-opens once it's done.
- Open setup script: this option generates the script file and opens it in the Inno Setup editor.
- Just create setup script: choose this option if you want to generate the script file but not compile or open it at this time.
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:
- ApplicationName: the Application Name configuration setting.
- CompanyName: the Company Name configuration setting.
- CompanyURL: the Company Web Site configuration setting.
- LicenseFile: the EULA file specified in the Generate Setup Files dialog.
- OutputBaseFileName: the setup executable file name specified in the Generate Setup Files dialog.
- OutputDir: the setup executable path specified in the Generate Setup Files dialog.
- Password: the password specified in the Generate Setup Files dialog.
- ProjectPath: the directory for your Stonefield Query project file.
- QueryEXE: the name of the Stonefield Query executable file.
- ReportsIconFile: the name of the icon to use for the uninstall program generated by Inno Setup.
- SQPath: the Stonefield Query program directory.
- Version: the current Stonefield Query version number.
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: /regserverOption 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:
- Windows System folder: TEECHART7.OCX (this file must be registered as a COM object) and LPNG.DLL. If it's possible the target system doesn't have Internet Explorer 4.0 or later or the HTML Help engine files installed, include HHCTRL.OCX, ITIRCL.DLL, and ITSS.DLL. These are runtime components.
- Windows folder: if it's possible the target system doesn't have Internet Explorer 4.0 or later or the HTML Help engine files installed, include HH.EXE. This is a runtime component.
- Folder where Stonefield Query is installed (these are all full-installation rather than runtime components):
- COMMFUNC.DBF and COMMFUNC.FPT
- COMPRESSION.FLL
- FIND.CSS
- GDIPLUS.DLL
- HNDLIB.DLL
- MSVCR71.DLL
- MSVCP71.DLL
- A splash screen image file (SPLASH.BMP, JPG, JPEG, or PNG) if you want a splash screen displayed.
- SQDESIGNER.EXE
- SQOUTPUT.EXE
- SQPREVIEW.EXE
- SFQUERY.EXE
- SQCODE.EXE, SQCODE.DBF, and SQCODE.FPT (there's no need to distribute SQCODE2.DBF or SQCODE2.FPT).
- SQPROXY.EXE if you're using the SQProxy object; be sure to register this as a COM object.
- SQUPDATE.EXE
- TASKSCHEDULER.DLL (this file must be registered as a COM object)
- WWIPSTUFF.DLL
- XFRXLIB.FLL
- XICRCORE.DLL (only needed if your project is encrypted)
- ZLIB.DLL
- Sample Reports folder containing any sample or standard reports you want supplied to the user.
- Sample Templates folder containing any report templates you want supplied to the user.
- Data subdirectory of the Stonefield Query program directory:
- SFQUERY.LIC if you are distributing an unlimited runtime license. Be sure to select the unlimited runtime license file you were provided by Stonefield Software Inc. and not your own Stonefield Query license file. Do not include this file if you are not distributing an unlimited runtime license or your users will get an invalid license file error when they run Stonefield Query for the first time.
- SQRESOURCE.DBF, SQRESOURCE.FPT, and SQRESOURCE.CDX
- Folder where your Stonefield Query project files are installed (could the Data subdirectory of the Stonefield Query program directory if the user will only have a single Stonefield Query project on their system):
- REPMETA.DBF, CDX, and FPT
- SFSCRIPT.DBF, CDX, and FPT
- SFCONFIG.DBF, CDX, and FPT
- SFQUERY.INI
- SFQUERY.CHM (customized for your project)
- Any image files specified with the Logo Image File and Icon File configuration settings
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:
- ASYCFILT.DLL: in the Windows System directory.
- COMCAT.DLL: in the Windows System directory. This file must be registered as a COM object (for example, use REGSVR32).
- OLEAUT32.DLL: in the Windows System directory. This file must be registered as a COM object (for example, use REGSVR32).
- OLEPRO32.DLL: in the Windows System directory. This file must be registered as a COM object (for example, use REGSVR32).
- STDOLE2.TLB: in the Windows System directory. This file must be registered as a type library.
- MSCOMCT2.OCX: in the Windows System directory. This file must be registered as a COM object (for example, use REGSVR32).
- MSCOMCTL.OCX: in the Windows System directory. This file must be registered as a COM object (for example, use REGSVR32).
- MSMAPI32.OCX: in the Windows System directory. This file must be registered as a COM object (for example, use REGSVR32).
- MSXML3.DLL: in the Windows System directory.
- MSXML3R.DLL: in the Windows System directory.
- MSXML4.DLL: in the Windows System directory.
- MSXML4R.DLL: in the Windows System directory.
- MSVCR71.DLL: in C:\Program Files\Common Files\Microsoft Shared\VFP during installation only (some components require it for registration); it can be deleted afterward.
- VFP9R.DLL: in C:\Program Files\Common Files\Microsoft Shared\VFP. This file must be registered as a COM object (for example, use REGSVR32).
- VFP9RENU.DLL: in C:\Program Files\Common Files\Microsoft Shared\VFP.
- FOXHHELP9.EXE: in C:\Program Files\Common Files\Microsoft Shared\VFP. This file must be registered as a COM object by running it with /REGSERVER specified as a parameter.
- FOXHHELPPS9.DLL: in C:\Program Files\Common Files\Microsoft Shared\VFP.
- GDIPLUS.DLL: in C:\Program Files\Common Files\Microsoft Shared\VFP.