Build the setup program psqlsetup used for the regression dsn.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Wed, 31 Aug 2016 07:27:48 +0000 (16:27 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 22 Sep 2016 08:11:31 +0000 (17:11 +0900)
psqlsetup also playes a role to relay ODBC API calls to compiled psqlodbc35w(30a).dll.

loadlib.c
loadlib.h
psqlsetup.c [new file with mode: 0644]
psqlsetup.def [new file with mode: 0644]
psqlsetupa.def [new file with mode: 0644]
winbuild/platformbuild.vcxproj
winbuild/psqlodbc.vcxproj
winbuild/psqlsetup.vcxproj [new file with mode: 0644]

index 3f3a6b8d005fb252de899fa503b2e8a9130371e6..c597f813a9cc1de7d2ac45791241ece52e83626b 100644 (file)
--- a/loadlib.c
+++ b/loadlib.c
 #define    WIN_DYN_LOAD
 #ifdef UNICODE_SUPPORT
 CSTR   pgenlist = "pgenlist";
-CSTR   pgenlistdll = "PGENLIST.dll";
+CSTR   pgenlistdll = "pgenlist.dll";
+CSTR   psqlodbc = "psqlodbc35w";
+CSTR   psqlodbcdll = "psqlodbc35w.dll";
 #else
 CSTR   pgenlist = "pgenlista";
-CSTR   pgenlistdll = "PGENLISTA.dll";
+CSTR   pgenlistdll = "pgenlista.dll";
+CSTR   psqlodbc = "psqlodbc30a";
+CSTR   psqlodbcdll = "psqlodbc30a.dll";
 #endif /* UNICODE_SUPPORT */
 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
 #define    _MSC_DELAY_LOAD_IMPORT
@@ -80,6 +84,7 @@ CSTR  pgenlistdll = "PGENLISTA.dll";
 
 #if defined(_MSC_DELAY_LOAD_IMPORT)
 static BOOL    loaded_pgenlist = FALSE;
+static BOOL    loaded_psqlodbc = FALSE;
 /*
  * Load a DLL based on psqlodbc path.
  */
@@ -122,6 +127,7 @@ DliErrorHook(unsigned   dliNotify,
        PDelayLoadInfo  pdli)
 {
    HMODULE hmodule = NULL;
+   const char* call_module = NULL;
 
    mylog("Dli%sHook %s Notify=%d\n", (dliFailLoadLib == dliNotify || dliFailGetProc == dliNotify) ? "Error" : "Notify", NULL != pdli->szDll ? pdli->szDll : pdli->dlp.szProcName, dliNotify);
    switch (dliNotify)
@@ -130,15 +136,40 @@ DliErrorHook(unsigned dliNotify,
        case dliFailLoadLib:
            RELEASE_NOTIFY_HOOK
            if (_strnicmp(pdli->szDll, pgenlist, strlen(pgenlist)) == 0)
+               call_module = pgenlist;
+           else if (_strnicmp(pdli->szDll, psqlodbc, strlen(psqlodbc)) == 0)
+               call_module = psqlodbc;
+           if (call_module)
            {
-               if (hmodule = MODULE_load_from_psqlodbc_path(pgenlist), NULL == hmodule)
-                   hmodule = LoadLibrary(pgenlist);
+               if (hmodule = MODULE_load_from_psqlodbc_path(call_module), NULL == hmodule)
+                   hmodule = LoadLibrary(call_module);
+               if (NULL != hmodule)
+               {
+                   if (pgenlist == call_module)
+                       loaded_pgenlist = TRUE;
+                   else if (psqlodbc == call_module)
+                       loaded_psqlodbc = TRUE;
+               }
            }
            break;
    }
    return (FARPROC) hmodule;
 }
 
+#if (_MSC_VER < 1300)
+void EnableDelayLoadHook()
+{
+   __pfnDliFailureHook = DliErrorHook;
+   __pfnDliNotifyHook = DliErrorHook;
+}
+#else
+void EnableDelayLoadHook()
+{
+   __pfnDliFailureHook2 = DliErrorHook;
+   __pfnDliNotifyHook2 = DliErrorHook;
+}
+#endif /* _MSC_VER */
+
 /*
  * unload delay loaded libraries.
  */
@@ -156,8 +187,15 @@ void CleanupDelayLoadedDLLs(void)
    if (loaded_pgenlist)
    {
        success = (*func)(pgenlistdll);
+       loaded_pgenlist = FALSE;
        mylog("%s unload success=%d\n", pgenlistdll, success);
    }
+   if (loaded_psqlodbc)
+   {
+       success = (*func)(psqlodbcdll);
+       loaded_psqlodbc = FALSE;
+       mylog("%s unload success=%d\n", psqlodbcdll, success);
+   }
    return;
 }
 #else
index f78ae33ce93c1f6761f060cf3b3aa063cf5782fe..a76b65bc7788fe34e8dd82f16a51d3a2fc0b5ee2 100644 (file)
--- a/loadlib.h
+++ b/loadlib.h
@@ -32,6 +32,7 @@ void  CALL_ReleaseTransactionObject(void *);
 #endif /* _HANDLE_ENLIST_IN_DTC_ */
 /* void    UnloadDelayLoadedDLLs(BOOL); */
 void   CleanupDelayLoadedDLLs(void);
+void   EnableDelayLoadHook(void);
 
 #ifdef __cplusplus
 }
diff --git a/psqlsetup.c b/psqlsetup.c
new file mode 100644 (file)
index 0000000..47c90ff
--- /dev/null
@@ -0,0 +1,100 @@
+#include   <windows.h>
+
+#include   "psqlodbc.h"
+#include   "dlg_specific.h"
+
+HINSTANCE s_hModule;       /* Saved module handle. */
+
+#ifdef PG_BIN
+
+#include "loadlib.h"
+#include <DelayImp.h>
+#include <stdio.h>
+#include <string.h>
+#include <sql.h>
+
+RETCODE SQL_API SQLDummyOrdinal(void);
+
+/*
+ * This function is used to cause the Driver Manager to
+ * call functions by number rather than name, which is faster.
+ * The ordinal value of this function must be 199 to have the
+ * Driver Manager do this.  Also, the ordinal values of the
+ * functions must match the value of fFunction in SQLGetFunctions()
+ */
+RETCODE        SQL_API
+SQLDummyOrdinal(void)
+{
+   return SQL_SUCCESS;
+}
+
+#endif /* PG_BIN */
+
+static HINSTANCE s_hLModule;
+/* This is where the Driver Manager attaches to this Driver */
+
+extern GLOBAL_VALUES globals;
+
+int    initialize_global_cs(void)
+{
+   static  int init = 1;
+
+   if (!init)
+       return 0;
+   init = 0;
+   InitializeLogging();
+   memset(&globals, 0, sizeof(globals));
+
+   return 0;
+}
+
+static void finalize_global_cs(void)
+{
+   finalize_globals(&globals);
+   FinalizeLogging();
+#ifdef _DEBUG
+#ifdef _MEMORY_DEBUG_
+   // _CrtDumpMemoryLeaks();
+#endif /* _MEMORY_DEBUG_ */
+#endif /* _DEBUG */
+}
+
+BOOL       WINAPI
+DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
+{
+   switch (ul_reason_for_call)
+   {
+       case DLL_PROCESS_ATTACH:
+           s_hModule = hInst;  /* Save for dialog boxes */
+
+           if (initialize_global_cs() == 0)
+               getCommonDefaults(DBMS_NAME, ODBCINST_INI, NULL);
+#ifdef PG_BIN
+           if (s_hLModule = LoadLibraryEx(PG_BIN "\\libpq.dll", NULL, LOAD_WITH_ALTERED_SEARCH_PATH), s_hLModule == NULL)
+           {
+               mylog("libpq folder %s couldn't be loaded\n", PG_BIN);
+           }
+           EnableDelayLoadHook();
+#endif
+           break;
+
+       case DLL_THREAD_ATTACH:
+           break;
+
+       case DLL_PROCESS_DETACH:
+           CleanupDelayLoadedDLLs();
+           FreeLibrary(s_hLModule);
+           finalize_global_cs();
+           return TRUE;
+
+       case DLL_THREAD_DETACH:
+           break;
+
+       default:
+           break;
+   }
+
+   return TRUE;
+
+   UNREFERENCED_PARAMETER(lpReserved);
+}
diff --git a/psqlsetup.def b/psqlsetup.def
new file mode 100644 (file)
index 0000000..d15bdf2
--- /dev/null
@@ -0,0 +1,70 @@
+LIBRARY psqlsetup
+EXPORTS
+
+DllMain @201
+ConfigDSN @202
+ConfigDriver @203
+
+SQLBindCol @4
+SQLCancel @5
+SQLDisconnect @9
+SQLExecute @12
+SQLFetch @13
+SQLFreeStmt @16
+SQLNumResultCols @18
+SQLRowCount @20
+SQLGetData @43
+SQLGetFunctions @44
+SQLParamData @48
+SQLPutData @49
+SQLDescribeParam @58
+SQLExtendedFetch @59
+SQLMoreResults @61
+SQLNumParams @63
+SQLSetPos @68
+SQLBindParameter @72
+
+SQLAllocHandle @80
+SQLBindParam @81
+SQLCloseCursor @82
+SQLCopyDesc @84
+SQLEndTran @85
+SQLFetchScroll @86
+SQLFreeHandle @87
+SQLGetEnvAttr @92
+SQLSetEnvAttr @98
+SQLBulkOperations @100
+
+SQLDummyOrdinal @199
+
+SQLColAttributeW   @101
+SQLColumnPrivilegesW   @102
+SQLColumnsW        @103
+SQLConnectW        @104
+SQLDescribeColW        @106
+SQLExecDirectW     @107
+SQLForeignKeysW        @108
+SQLGetConnectAttrW @109
+SQLGetCursorNameW  @110
+SQLGetInfoW        @111
+SQLNativeSqlW      @112
+SQLPrepareW        @113
+SQLPrimaryKeysW        @114
+SQLProcedureColumnsW   @115
+SQLProceduresW     @116
+SQLSetConnectAttrW @117
+SQLSetCursorNameW  @118
+SQLSpecialColumnsW @119
+SQLStatisticsW     @120
+SQLTablesW     @121
+SQLTablePrivilegesW    @122
+SQLDriverConnectW  @123
+SQLGetDiagRecW     @124
+SQLGetStmtAttrW        @125
+SQLSetStmtAttrW        @126
+SQLSetDescFieldW   @127
+SQLGetTypeInfoW        @128
+SQLGetDiagFieldW   @129
+SQLGetDescFieldW   @130
+SQLGetDescRecW     @131
+SQLSetDescRecW     @132
diff --git a/psqlsetupa.def b/psqlsetupa.def
new file mode 100644 (file)
index 0000000..da1a778
--- /dev/null
@@ -0,0 +1,69 @@
+LIBRARY psqlsetupa
+EXPORTS
+
+DllMain @201
+ConfigDSN @202
+ConfigDriver @203
+
+SQLBindCol @4
+SQLCancel @5
+SQLConnect @7
+SQLDescribeCol @8
+SQLDisconnect @9
+SQLExecDirect @11
+SQLExecute @12
+SQLFetch @13
+SQLFreeStmt @16
+SQLGetCursorName @17
+SQLNumResultCols @18
+SQLPrepare @19
+SQLRowCount @20
+SQLSetCursorName @21
+SQLColumns @40
+SQLDriverConnect @41
+SQLGetData @43
+SQLGetFunctions @44
+SQLGetInfo @45
+SQLGetTypeInfo @47
+SQLParamData @48
+SQLPutData @49
+SQLSpecialColumns @52
+SQLStatistics @53
+SQLTables @54
+SQLColumnPrivileges @56
+SQLDescribeParam @58
+SQLExtendedFetch @59
+SQLForeignKeys @60
+SQLMoreResults @61
+SQLNativeSql @62
+SQLNumParams @63
+SQLPrimaryKeys @65
+SQLProcedureColumns @66
+SQLProcedures @67
+SQLSetPos @68
+SQLTablePrivileges @70
+SQLBindParameter @72
+
+SQLAllocHandle @80
+SQLBindParam @81
+SQLCloseCursor @82
+SQLColAttribute @83
+SQLCopyDesc @84
+SQLEndTran @85
+SQLFetchScroll @86
+SQLFreeHandle @87
+SQLGetDescField @88
+SQLGetDescRec @89
+SQLGetDiagField @90
+SQLGetDiagRec @91
+SQLGetEnvAttr @92
+SQLGetConnectAttr @93
+SQLGetStmtAttr @94
+SQLSetConnectAttr @95
+SQLSetDescField @96
+SQLSetDescRec @97
+SQLSetEnvAttr @98
+SQLSetStmtAttr @99
+SQLBulkOperations @100
+
+SQLDummyOrdinal @199
index c2ad3c0bf0eb336a0eef7b07abbb4400a8675c2f..5ec4b43c6014e194952de50fe0aba506a24f0b74 100755 (executable)
         </ProjectToBuild>
         <ProjectToBuild Include="pgxalib.vcxproj">
         </ProjectToBuild>
+        <ProjectToBuild Include="psqlsetup.vcxproj">
+        </ProjectToBuild>
+        <ProjectToBuild Include="psqlsetup.vcxproj">
+     <AdditionalProperties>ANSI_VERSION=yes
+     </AdditionalProperties>
+        </ProjectToBuild>
     </ItemGroup>
     <Target Name="Build">
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="BuildCompile"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Lib"/>
-        <MSBuild Projects="psqlodbc.vcxproj" 
+        <MSBuild Projects="psqlodbc.vcxproj"
      Targets="Build"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="Build"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Link"/>
 
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="BuildCompile"
      Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Lib"/>
-        <MSBuild Projects="psqlodbc.vcxproj" 
+        <MSBuild Projects="psqlodbc.vcxproj"
      Targets="Build"
      Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="Build"
      Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath);BuildStep=Link"/>
-        <MSBuild Projects="pgxalib.vcxproj" 
+        <MSBuild Projects="pgxalib.vcxproj"
      Targets="Build"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
-        <!-- MSBuild Projects="@(ProjectToBuild)" 
+
+   <Error
+     Text="PG_BIN isn't set%0D%0Acoudn't build psqlsetup."
+       Condition="'$PG_BIN)'==''"/>
+   <Error
+     Text="directory $(PG_BIN) doesn't exist.%0D%0Aset PG_BIN properly."
+       Condition="!exists('$(PG_BIN)')"/>
+   <Error
+     Text="$(PG_BIN)\libpq.dll doesn't exist.%0D%0Aset PG_BIN properly."
+       Condition="!exists('$(PG_BIN)\libpq.dll')"/>
+
+        <MSBuild Projects="psqlsetup.vcxproj"
      Targets="Build"
-     Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/ -->
+     Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
+        <MSBuild Projects="psqlsetup.vcxproj"
+     Targets="Build"
+     Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
     </Target>
     <Target Name="Rebuild">
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="Clean;BuildCompile"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath);ImpLibForward=true"/>
-        <MSBuild Projects="psqlodbc.vcxproj" 
+        <MSBuild Projects="psqlodbc.vcxproj"
      Targets="ReBuild"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="Build"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
 
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="Clean;BuildCompile"
      Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath);ImpLibForward=true"/>
-        <MSBuild Projects="psqlodbc.vcxproj" 
+        <MSBuild Projects="psqlodbc.vcxproj"
      Targets="ReBuild"
      Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
-        <MSBuild Projects="pgenlist.vcxproj" 
+        <MSBuild Projects="pgenlist.vcxproj"
      Targets="Build"
      Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
-        <MSBuild Projects="pgxalib.vcxproj" 
+        <MSBuild Projects="pgxalib.vcxproj"
      Targets="ReBuild"
      Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
 
-        <!-- MSBuild Projects="@(ProjectToBuild)"
-     Targets="Rebuild" 
-     Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/ -->
+   <Error
+     Text="PG_BIN isn't set%0D%0Acoudn't build psqlsetup."
+       Condition="'$PG_BIN)'==''"/>
+   <Error
+     Text="directory $(PG_BIN) doesn't exist.%0D%0Aset PG_BIN properly."
+       Condition="!exists('$(PG_BIN)')"/>
+   <Error
+     Text="$(PG_BIN)\libpq.dll doesn't exist.%0D%0Aset PG_BIN properly."
+       Condition="!exists('$(PG_BIN)\llibpq.dll')"/>
+        <MSBuild Projects="psqlsetup.vcxproj"
+     Targets="ReBuild"
+     Properties="Configuration=$(Configuration);srcPath=$(srcPath)"/>
+        <MSBuild Projects="psqlsetup.vcxproj"
+     Targets="ReBuild"
+     Properties="ANSI_VERSION=yes;Configuration=$(Configuration);srcPath=$(srcPath)"/>
     </Target>
     <Target Name="Clean">
         <MSBuild Projects="@(ProjectToBuild)"
index 494cc06ac8253b51cf788ec4688cf3c39dcfed16..91606a3ddc767bf9f4d492aa0b6720315c2118cc 100755 (executable)
     <ADD_DEFINES>$(ADD_DEFINES);DBMS_NAME="PostgreSQL ANSI(x64)"</ADD_DEFINES>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(ANSI_VERSION)|$(Platform)'=='no|Win32'" >\r
-    <ADD_DEFINES>$(ADD_DEFINES);UNICODE_SUPPORT</ADD_DEFINES>\r
+    <ADD_DEFINES>$(ADD_DEFINES);UNICODE_SUPPORT;UNICODE_SUPPORTXX</ADD_DEFINES>\r
     <RSC_DEFINES>$(RSC_DEFINES);UNICODE_SUPPORT</RSC_DEFINES>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(ANSI_VERSION)|$(Platform)'=='no|x64'" >\r
-    <ADD_DEFINES>$(ADD_DEFINES);UNICODE_SUPPORT;DBMS_NAME="PostgreSQL Unicode(x64)"</ADD_DEFINES>\r
+    <ADD_DEFINES>$(ADD_DEFINES);UNICODE_SUPPORT;UNICODE_SUPPORTXX;DBMS_NAME="PostgreSQL Unicode(x64)"</ADD_DEFINES>\r
     <RSC_DEFINES>$(RSC_DEFINES);UNICODE_SUPPORT</RSC_DEFINES>\r
   </PropertyGroup>\r
 \r
diff --git a/winbuild/psqlsetup.vcxproj b/winbuild/psqlsetup.vcxproj
new file mode 100644 (file)
index 0000000..d334e03
--- /dev/null
@@ -0,0 +1,274 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{DFD90C9A-E9BA-4CA3-812B-E820EE9A3F5B}</ProjectGuid>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <RootNamespace>psqlsetup</RootNamespace>\r
+    <GenerateImportLib>true</GenerateImportLib>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <!-- GenerateImportLib>true</GenerateImportLib -->\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120_xp</PlatformToolset>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <!-- GenerateImportLib>true</GenerateImportLib -->\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v120_xp</PlatformToolset>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <!-- GenerateImportLib>true</GenerateImportLib -->\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120_xp</PlatformToolset>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <!-- GenerateImportLib>true</GenerateImportLib -->\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v120_xp</PlatformToolset>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" >\r
+   <ANSI_VERSION>no</ANSI_VERSION>\r
+   <PG_BIN></PG_BIN>\r
+   <CALL_LIB></CALL_LIB>\r
+   <DELAY_LOAD_DLLS></DELAY_LOAD_DLLS>\r
+  </PropertyGroup>\r
+\r
+  <PropertyGroup Condition="'$(ANSI_VERSION)'=='yes'">\r
+    <TargetName>psqlsetupa</TargetName>\r
+    <TargetType>ANSI</TargetType>\r
+    <CALL_LIB>psqlodbc30a.lib</CALL_LIB>\r
+    <DELAY_LOAD_DLLS>psqlodbc30a.dll;pgenlista.dll</DELAY_LOAD_DLLS>\r
+    <ADD_DEFINES></ADD_DEFINES>\r
+    <RSC_DEFINES></RSC_DEFINES>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(ANSI_VERSION)'!='yes'">\r
+    <TargetName>psqlsetup</TargetName>\r
+    <TargetType>Unicode</TargetType>\r
+    <CALL_LIB>psqlodbc35w.lib</CALL_LIB>\r
+    <DELAY_LOAD_DLLS>psqlodbc35w.dll;pgenlist.dll</DELAY_LOAD_DLLS>\r
+    <ADD_DEFINES>UNICODE_SUPPORT</ADD_DEFINES>\r
+    <RSC_DEFINES>UNICODE_SUPPORT</RSC_DEFINES>\r
+  </PropertyGroup>\r
+\r
+  <PropertyGroup Condition="'$(Platform)'=='Win32'">\r
+    <TARGET_CPU>x86</TARGET_CPU>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Platform)'!='Win32'">\r
+    <TARGET_CPU>x64</TARGET_CPU>\r
+  </PropertyGroup>\r
+\r
+  <PropertyGroup Condition="'$(BuildStep)'==''">\r
+    <GenerateImportLib>false</GenerateImportLib>\r
+  </PropertyGroup>\r
+\r
+  <PropertyGroup>\r
+    <IntDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\psqlsetup\</IntDir>\r
+    <OutDir>$(srcPath)$(TARGET_CPU)_$(TargetType)_$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+  </PropertyGroup>\r
+\r
+  <Import Project="psqlodbc.Cpp.props" />\r
+\r
+  <PropertyGroup Condition="'$(PG_BIN)'!=''">\r
+    <ADD_DEFINES>$(ADD_DEFINES);PG_BIN="$(PG_BIN.Replace('\','\\'))"</ADD_DEFINES>\r
+  </PropertyGroup>\r
+\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ResourceCompile>\r
+    <ImpLib Condition="'$(GenerateImportLib)'=='true'">\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+    </ImpLib>\r
+    <Link>\r
+      <DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>\r
+    </Link>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <PreLinkEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreLinkEvent>\r
+    <PostBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <ClCompile>\r
+      <PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;WIN_MULTITHREAD_SUPPORT;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ResourceCompile>\r
+    <ImpLib Condition="'$(GenerateImportLib)'=='true'">\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+    </ImpLib>\r
+    <Link>\r
+      <DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>\r
+    </Link>\r
+    <CustomBuildStep>\r
+      <Command>\r
+      </Command>\r
+    </CustomBuildStep>\r
+    <PreLinkEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreLinkEvent>\r
+    <PostBuildEvent>\r
+      <Command>\r
+      </Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;WIN_MULTITHREAD_SUPPORT;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ResourceCompile>\r
+    <ImpLib Condition="'$(GenerateImportLib)'=='true'">\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+    </ImpLib>\r
+    <Link>\r
+      <DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>\r
+    </Link>\r
+    <PreLinkEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreLinkEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <ClCompile>\r
+      <PreprocessorDefinitions>DYNAMIC_LOAD;_HANDLE_ENLIST_IN_DTC_;WIN_MULTITHREAD_SUPPORT;$(ADD_DEFINES);_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PSQLSETUP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>$(RSC_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ResourceCompile>\r
+    <ImpLib Condition="'$(GenerateImportLib)'=='true'">\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>\r
+      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+    </ImpLib>\r
+    <Link>\r
+      <DelayLoadDLLs>$(DELAY_LOAD_DLLS);%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <AdditionalDependencies>$(CALL_LIB);winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>\r
+    </Link>\r
+    <PreLinkEvent>\r
+      <Command>\r
+      </Command>\r
+    </PreLinkEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(GenerateImportLib)'=='true'">\r
+    <Link>\r
+      <ModuleDefinitionFile></ModuleDefinitionFile>\r
+      <AdditionalDependencies>$(TargetName).exp;%(AdditionalDependencies)</AdditionalDependencies>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <Text Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="$(srcPath)psqlsetup.c" />\r
+    <ClCompile Include="$(srcPath)setup.c" />\r
+    <ClCompile Include="$(srcPath)dlg_wingui.c" />\r
+    <ClCompile Include="$(srcPath)dlg_specific.c" />\r
+    <ClCompile Include="$(srcPath)mylog.c" />\r
+    <ClCompile Include="$(srcPath)xalibname.c" />\r
+    <ClCompile Include="$(srcPath)misc.c" />\r
+    <ClCompile Include="$(srcPath)loadlib.c" />\r
+    <ClCompile Condition="'$(ANSI_VERSION)'=='no'" Include="$(srcPath)win_unicode.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="$(srcPath)psqlodbc.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>\r