Runtime Distributable Installer

NOTE: You must have Administrator rights or equivalent to install these components.

The Framework EDI (FREDI) Runtime Component Setup is a single executable, which installs and configures on computers only the necessary FREDI components for the successful execution of ActiveX clients that were programmed to interface with them.  The Runtime Component Setup can be deployed with your application that you've developed and completed using FREDI. The setup can run stand alone or it can be called from a program capable of running an external executable program.

System File updated
The following Windows system files are updated. These files will be copied over to the Windows System directory and will overwrite older versions.

FREDI v. 5.2 Components Installed
The following Framework EDI files are installed in the BIN subdirectory of the target path that the user had specified. When upgrading, these files will overwrite older versions of the existing files. FREDI components are dependent on one another and must be installed and registered in the order shown below. The installer takes care of the order in which these file are installed.

The .NET Hybrid is installed to the global assembly cache (GAC).  The installer will replace an existing FREDI .NET hybrid in with a later version.

The program to uninstall Framework EDI is installed in the Window System directory.  When Framework EDI SDK is installed the .NET hybrid is also removed from the GAC.

NOTE: The components installed by the runtime setup may change from one version to the next. The components listed in this documentation apply to this version only.

Registry Updates
The FREDI Runtime Setup records the files that it installs as well as all the setup settings in the registry. The Edidev key is created in the following registry branch:

When the uninstaller removes files from the computer, it reads the registry information under the key:

Before installing the component files in the runtime setup, any previous installation of the components are first removed. The runtime setup program determines previous file installations from the recorded files under the registry key mentioned above.

Executing Setup in a Program
The FREDI Runtime Setup can be executed in a program that can run an external program. The syntax of the call is as follows:

Where -s indicates the serial number of the product, and –p indicates the target path to install the files.

Example:

    Edidev_EDI_Runtime.exe –s123456ABCDEFGH –pC:\Program Files\Edidev

Where "123456ABCDEFGH" is the serial number and "C:\Program Files\Edidev" is the target path.  Please note that the serial number MUST NOT contain any dashes or hyphens.  That is, a serial number like "1234-56AB-CDEF-GHIJ" is not allowed.

If there are no parameters following the executable in the command line, the program will launch a GUI interface to allow interactive installation.



Sample Visual Basic program
The following is a sample Visual Basic program to execute the setup.

Option Explicit

Private Type PROCESS_INFORMATION
   hProcess As Long
   hThread As Long
   dwProcessId As Long
   dwThreadId As Long
End Type

Private Type STARTUPINFO
   cb As Long
   lpReserved As String
   lpDesktop As String
   lpTitle As String
   dwX As Long
   dwY As Long
   dwXSize As Long
   dwYSize As Long
   dwXCountChars As Long
   dwYCountChars As Long
   dwFillAttribute As Long
   dwFlags As Long
   wShowWindow As Integer
   cbReserved2 As Integer
   lpReserved2 As Long
   hStdInput As Long
   hStdOutput As Long
   hStdError As Long
End Type

Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" _
   (ByVal lpApplicationName As String, _
   ByVal lpCommandLine As String, _
   lpProcessAttributes As Any, _
   lpThreadAttributes As Any, _
   ByVal bInheritHandles As Long, _
   ByVal dwCreationFlags As Long, _
   lpEnvironment As Any, _
   ByVal lpCurrentDriectory As String, _
   lpStartupInfo As STARTUPINFO, _
   lpProcessInformation As PROCESS_INFORMATION) As Long

Private Declare Function OpenProcess Lib "kernel32.dll" _
   (ByVal dwAccess As Long, _
   ByVal fInherit As Integer, _
   ByVal hObject As Long) As Long

Private Declare Function TerminateProcess Lib "kernel32" _
   (ByVal hProcess As Long, _
   ByVal uExitCode As Long) As Long

Private Declare Function CloseHandle Lib "kernel32" _
   (ByVal hObject As Long) As Long

Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
      hHandle As Long, ByVal dwMilliseconds As Long) As Long

Private Const SYNCHRONIZE = 1048576
Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const INFINITE = -1&


Private Sub Command1_Click()
    Dim pInfo As PROCESS_INFORMATION
    Dim sInfo As STARTUPINFO
    Dim lSuccess As Long
    Dim lRetValue As Long

    sInfo.cb = Len(sInfo)
    lSuccess = CreateProcess(vbNullString, _
                " Edidev_EDI_Runtime –s123456ABCDEF -pC:\Program Files\Edidev", _
                ByVal 0&, _
                ByVal 0&, _
                1&, _
                NORMAL_PRIORITY_CLASS, _
                ByVal 0&, _
                vbNullString, _
                sInfo, _
                pInfo)

    ' Wait for the shelled application to finish
    lRetValue = WaitForSingleObject(pInfo.hProcess, INFINITE)

    lRetValue = CloseHandle(pInfo.hThread)
    lRetValue = CloseHandle(pInfo.hProcess)

    MsgBox "Setup Completed"
End Sub