inst.c File Reference

SQLite ODBC Driver installer/uninstaller for WIN32. More...

#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <odbcinst.h>
#include <winver.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define SEEEXT   ""
 
#define SEESTR   ""
 
#define SEESTR2   ""
 
#define NUMDRVS   4
 

Functions

static BOOL ProcessErrorMessages (char *name, int quiet)
 Handler for ODBC installation error messages.
 
static BOOL CopyOrDelModules (char *dllname, char *path, BOOL del)
 Copy or delete SQLite3 module DLLs.
 
static BOOL InUn (int remove, char *drivername, char *dllname, char *dll2name, char *dsname)
 Driver installer/uninstaller.
 
int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
 Main function of installer/uninstaller.
 

Variables

static char * DriverName [NUMDRVS]
 
static char * DSName [NUMDRVS]
 
static char * DriverDLL [NUMDRVS]
 
static int quiet = 0
 
static int nosys = 0
 

Detailed Description

SQLite ODBC Driver installer/uninstaller for WIN32.

Id
inst.c,v 1.27 2023/08/23 08:43:02 chw Exp chw

Copyright (c) 2001-2023 Christian Werner <chw at ch minus werner dot de>

See the file "license.terms" for information on usage and redistribution of this file and for a DISCLAIMER OF ALL WARRANTIES.

Definition in file inst.c.

Macro Definition Documentation

◆ NUMDRVS

#define NUMDRVS   4

Definition at line 32 of file inst.c.

Referenced by WinMain().

◆ SEEEXT

#define SEEEXT   ""

Definition at line 27 of file inst.c.

◆ SEESTR

#define SEESTR   ""

Definition at line 28 of file inst.c.

◆ SEESTR2

#define SEESTR2   ""

Definition at line 29 of file inst.c.

Function Documentation

◆ CopyOrDelModules()

static BOOL CopyOrDelModules ( char * dllname,
char * path,
BOOL del )
static

Copy or delete SQLite3 module DLLs.

Parameters
dllnamefile name of driver DLL
pathinstall directory for modules
delflag, when true, delete DLLs in install directory

Definition at line 102 of file inst.c.

Referenced by InUn().

◆ InUn()

static BOOL InUn ( int remove,
char * drivername,
char * dllname,
char * dll2name,
char * dsname )
static

Driver installer/uninstaller.

Parameters
removetrue for uninstall
drivernameprint name of driver
dllnamefile name of driver DLL
dll2namefile name of additional DLL
dsnamename for data source

Definition at line 153 of file inst.c.

References CopyOrDelModules(), nosys, ProcessErrorMessages(), and quiet.

Referenced by WinMain().

◆ ProcessErrorMessages()

static BOOL ProcessErrorMessages ( char * name,
int quiet )
static

Handler for ODBC installation error messages.

Parameters
namename of API function for which to show error messages
quietwhen true suppress message box

Definition at line 70 of file inst.c.

References quiet.

Referenced by InUn().

◆ WinMain()

int APIENTRY WinMain ( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdLine,
int nCmdShow )

Main function of installer/uninstaller.

This is the Win32 GUI main entry point. It (un)registers the ODBC driver(s) and deletes or copies the driver DLL(s) to the system folder.

Definition at line 299 of file inst.c.

References DriverDLL, DriverName, DSName, InUn(), nosys, NUMDRVS, and quiet.

Variable Documentation

◆ DriverDLL

char* DriverDLL[NUMDRVS]
static
Initial value:
= {
"sqliteodbc.dll",
"sqliteodbcu.dll",
"sqlite3odbc" SEEEXT ".dll",
"sqlite4odbc.dll"
}
#define SEEEXT
Definition inst.c:27

Definition at line 45 of file inst.c.

Referenced by WinMain().

◆ DriverName

char* DriverName[NUMDRVS]
static
Initial value:
= {
"SQLite ODBC Driver",
"SQLite ODBC (UTF-8) Driver",
"SQLite3 ODBC Driver" SEESTR,
"SQLite4 ODBC Driver"
}
#define SEESTR
Definition inst.c:28

Definition at line 33 of file inst.c.

Referenced by WinMain().

◆ DSName

char* DSName[NUMDRVS]
static
Initial value:
= {
"SQLite Datasource",
"SQLite UTF-8 Datasource",
"SQLite3 " SEESTR2 "Datasource",
"SQLite4 Datasource"
}
#define SEESTR2
Definition inst.c:29

Definition at line 39 of file inst.c.

Referenced by WinMain().

◆ nosys

int nosys = 0
static

Definition at line 61 of file inst.c.

Referenced by InUn(), and WinMain().

◆ quiet

int quiet = 0
static

Definition at line 60 of file inst.c.

Referenced by InUn(), ProcessErrorMessages(), and WinMain().


Generated on Sun Nov 26 2023 by doxygen.
Contact: chw@ch-werner.de