| Stonefield Query SDK |
| Creating a Setup Executable |
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 version 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.
One other thing: Stonefield Query requires the .Net 2.0 or higher framework, so if it or a higher version isn't found on the user's system, it must be installed. The installer generated from the Generate Setup function described below automatically downloads and installs the .Net 2.0 framework if necessary. If you are using your own installation mechanism, be sure to check whether .Net 2.0 or later is installed and if not, install it (your installer will either have to include the .Net installer or download it).
There are several ways you can create a setup executable for your Stonefield Query project.
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 the Stonefield Query SDK. You can download it from http://www.jrsoftware.org/isinfo.php. When installing Inno Setup, be sure to turn on the option to install the Inno Setup Pre-Processor (ISPP), which Stonefield Query requires.
The Generate Setup function in Stonefield Query Studio (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. Many of these are replacements for the names of certain Stonefield Query files if you've branded them. The placeholders used are:
See the Inno Setup documentation for a description of the options in the script file.
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: "{#SQPath}sqproxy.exe"; DestDir: {app}; Flags: ignoreversionand add the following to the [Run] section:
Filename: {app}\sqproxy.exe; Parameters: /regserverIf 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 merge modules are runtime components.
The setup must 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:
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Regasm.exe" "C:\Program Files\Common Files\Microsoft Shared\VFP\VfpDotNet.dll" /codebase /tlb
(Although this is formatted here over several lines for readability, it should all be on one line.)
VFPDOTNET.DLL and SFQWRAPPER.DLL are only required if any of your scripts use VB.Net or C#.
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.
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:
| Last Updated: 06/01/11 |