*** THIS TOPIC NEEDS TO BE REVISED

See http://documentation.devexpress.com/#XtraReports/CustomDocument3189 for DevExpress assemblies

*** IF change conn settings for formulas or security must create database yourself. Add this to other topics too

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 Stonefield Query Studio, 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 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.

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 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:

  • 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 Stonefield Query Studio 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, Stonefield Query Studio 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. Many of these are replacements for the names of certain Stonefield Query files if you've branded them. The placeholders used are:

  • ApplicationName: the Application Name configuration setting.

  • BuilderEXE: the replacement name for SQDesigner.EXE.

  • CodeEditorEXE: the replacement name for SQCodeEditor.EXE.

  • CommFunctionDBF: the replacement name for CommFunc.DBF.

  • CommFunctionFPT: the replacement name for CommFunc.FPT.

  • CompanyName: the Company Name configuration setting.

  • CompanyURL: the Company Web Site configuration setting.

  • ConfigCDX: the replacement name for SFConfig.CDX.

  • ConfigDBF: the replacement name for SFConfig.DBF.

  • ConfigFPT: the replacement name for SFConfig.FPT.

  • HaveDotNetScripts: True if any scripts use VB.Net or C#.

  • HelpFile: the replacement name for SFQuery.CHM.

  • INIFile: the replacement name for SFQuery.INI.

  • IntelliSenseDBF: the replacement name for SQCode.DBF.

  • IntelliSenseEXE: the replacement name for SQCode.EXE.

  • IntelliSenseFPT: the replacement name for SQCode.FPT.

  • LicenseFile: the EULA file specified in the Generate Setup Files dialog.

  • LogoImageFile: the name of the logo image file.

  • ManualPDF: the replacement name for SFQuery.PDF.

  • MetaData: a collection containing the names of the meta data files.

  • NewsExe: the replacement name for SQNews.EXE.

  • 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.

  • ResourceCDX: the replacement name for SQResource.CDX.

  • ResourceDBF: the replacement name for SQResource.DBF.

  • ResourceFPT: the replacement name for SQResource.FPT.

  • Scripts: a collection containing the names of the script files.

  • SplashFile: the name of the splash screen image file.

  • SQPath: the Stonefield Query program directory.

  • UpdateEXE: the replacement name for SQUpdate.EXE.

  • Version: the current Stonefield Query version number.

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: ignoreversion

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 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:

  • Windows System folder: TEECHART8LANG.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 aren't 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 aren't installed, include HH.EXE. This is a runtime component.

  • Common Files folder (typically C:\Program Files\Common Files\Microsoft Shared): a directory called VFP should contain:

    • VFPDOTNET.DLL. This must also be registered using the .NET RegAsm utility using a command line similar to:

      "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.)

    • SFQWRAPPER.DLL

    VFPDOTNET.DLL and SFQWRAPPER.DLL are only required if any of your scripts use VB.Net or C#.

  • Folder where Stonefield Query is installed (these are all full-installation rather than runtime components):

    • COMMFUNC.DBF and COMMFUNC.FPT

    • COMPRESSION.FLL

    • CONVERT.FLL

    • ENCRYPTION.FLL

    • EXMAPI.FLL

    • FEEDS.CSS

    • FIND.CSS

    • FOXTOOLS.FLL

    • GDIPLUS.DLL

    • HNDLIB.DLL

    • MSVCR71.DLL

    • MSVCP71.DLL

    • REPORT.ICO

    • A splash screen image file (SPLASH.BMP, JPG, JPEG, or PNG) if you want a splash screen displayed.

    • SQDESIGNER.EXE

    • SQNEWS.EXE

    • SFQUERY.EXE

    • SFQUERY.EXE.CONFIG

    • SFQWRAPPER.DLL (only required if any of your scripts use VB.Net or C#)

    • SQCODE.EXE, SQCODE.DBF, and SQCODE.FPT (there's no need to distribute SQCODE2.DBF or SQCODE2.FPT).

    • SQCODEEDITOR.EXE

    • SQPROXY.EXE if you're using the SQProxy object; be sure to register this as a COM object.

    • SQUPDATE.EXE

    • SYSTEM.EXE

    • TASKSCHEDULER.DLL (this file must be registered as a COM object)

    • WIN7TLIB.DLL

    • WWDOTNETBRIDGE.DLL

    • 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:

    • UNLIMITED.LIC if you are distributing an unlimited Report Viewer license.

    • 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.

  • VFP9R.DLL: in the application installation folder. This file must be registered as a COM object (for example, use REGSVR32).

  • VFP9RENU.DLL: in the application installation folder.

  • 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 the application installation folder.