if ("$pgmvc" -ne "") {
$dllspecified = "${pgmvc}\${rt_dllname}"
if (Test-Path -Path $dllspecified) {
- return $dllspecified
+ $dllspecified
+ return ""
}
}
if ($env:PROCESSOR_ARCHITECTURE -eq "x86") {
}
$dllinredist = "$pgmvc\Microsoft Visual Studio ${runtime_version}.0\VC\redist\${CPUTYPE}\Microsoft.VC${runtime_version}0.CRT\${rt_dllname}"
if (Test-Path -Path $dllinredist) {
- return $dllinredist
+ $dllinredist
+ return ""
} else {
$messageSpec = "Please specify Configuration.$CPUTYPE.runtime_folder element of the configuration file where msvc runtime dll $rt_dllname can be found"
if ($CPUTYPE -eq "x86") {
throw "${messageSpec}`nneither $dllinredist nor $dllinsystem exists unfortunately"
}
}
- return $dllinsystem
+ ""
+ return $rt_dllname
}
function buildInstaller($CPUTYPE)
{
throw "Unknown CPU type $CPUTYPE";
}
- # msvc runtime
- $MSVCRUNTIMEDLL = ""
- $LIBPQMSVC = ""
+ # msvc runtime psqlodbc links
+ $PODBCMSVCDLL = ""
+ $PODBCMSVCSYS = ""
+ # msvc runtime libpq links
+ $LIBPQMSVCDLL = ""
+ $LIBPQMSVCSYS = ""
if (-not $ExcludeRuntime) {
$toolset = $configInfo.Configuration.BuildResult.PlatformToolset
if ($toolset -match "^v(\d+)0") {
} else {
$runtime_version0 = "10"
}
- # where's the dll?
- $MSVCRUNTIMEDLL=findRuntime($runtime_version0)
- # where's the dll?
+ # where's the msvc runtime dll psqlodbc links?
+ $dlls=findRuntime($runtime_version0)
+ $PODBCMSVCDLL=$dlls[0]
+ $PODBCMSVCSYS=$dlls[1]
+ # where's the runtime dll libpq links?
$msvclist=invoke-expression -command "& `"${dumpbinexe}`" /imports `"$LIBPQBINDIR\libpq.dll`""| select-string -pattern "^\s*msvcr(\d+)0\.dll" | % {$_.matches[0].Groups[1].Value}
if ($msvclist -ne $Null -and $msvclist.length -gt 0) {
if ($msvclist.GetType().Name -eq "String") {
$runtime_version1=$msvclist[0]
}
if ($runtime_version1 -ne $runtime_version0) {
- $LIBPQMSVC=findRuntime($runtime_version1)
+ $dlls=findRuntime($runtime_version1)
+ $LIBPQMSVCDLL=$dlls[0]
+ $LIBPQMSVCSYS=$dlls[1]
Write-Host "LIBPQ requires msvcr${runtime_version1}0.dll"
}
}
Write-Host ".`nBuilding psqlODBC/$SUBLOC merge module..."
- invoke-expression "candle -nologo -dPlatform=$CPUTYPE `"-dVERSION=$VERSION`" -dSUBLOC=$SUBLOC `"-dLIBPQBINDIR=$LIBPQBINDIR`" `"-dLIBPQMSVC=$LIBPQMSVC`" `"-dMSVCRUNTIMEDLL=$MSVCRUNTIMEDLL`" $addpara -o $CPUTYPE\psqlodbcm.wixobj psqlodbcm_cpu.wxs"
+ invoke-expression "candle -nologo -dPlatform=$CPUTYPE `"-dVERSION=$VERSION`" -dSUBLOC=$SUBLOC `"-dLIBPQBINDIR=$LIBPQBINDIR`" `"-dLIBPQMSVCDLL=$LIBPQMSVCDLL`" `"-dLIBPQMSVCSYS=$LIBPQMSVCSYS`" `"-dPODBCMSVCDLL=$PODBCMSVCDLL`" `"-dPODBCMSVCSYS=$PODBCMSVCSYS`" $addpara -o $CPUTYPE\psqlodbcm.wixobj psqlodbcm_cpu.wxs"
if ($LASTEXITCODE -ne 0) {
throw "Failed to build merge module"
}
<?define CIDPFILES = "5C9A19B5-D7C6-4bb4-BBBC-88C2A67A59B0" ?>
<?define CIDXFILES = "121A6C41-2B8F-463D-BA84-6BF36701428A" ?>
<?define InstallerVersion = "300" ?>
+<?if $(env.PROCESSOR_ARCHITECTURE) = x64 ?>
+ <?define SysFolder = "$(env.SystemRoot)\system32" ?>
+<?else?>
+ <?define SysFolder = "$(env.SystemRoot)\sysnative" ?>
+<?endif?>
<?else?>
<?define ModuleName = "psqlODBC" ?>
<?define BIT64 = "no" ?>
<?define CIDPFILES = "00A1ACE3-B7C2-41b8-A1F1-DB565990DA4E" ?>
<?define CIDXFILES = "49933A1E-4350-437C-B8D5-E96AA5D61139" ?>
<?define InstallerVersion = "150" ?>
+<?if $(env.PROCESSOR_ARCHITECTURE) = x64 ?>
+ <?define SysFolder = "$(env.SystemRoot)\syswow64" ?>
+<?else?>
+ <?define SysFolder = "$(env.SystemRoot)\system32" ?>
+<?endif?>
<?endif?>
<Module
<File Id="pgenlista.dll" Name="pgenlista.dll" Source="../$(var.ANSIFOLDER)/pgenlista.dll" />
<File Id="pgenlista.pdb" Name="pgenlista.pdb" Source="../$(var.ANSIFOLDER)/pgenlista.pdb" />
<!-- MSVC Runtime -->
-<?if "$(var.MSVCRUNTIMEDLL)" != "" ?>
- <File Source="$(var.MSVCRUNTIMEDLL)" />
+<?if "$(var.PODBCMSVCDLL)" != "" ?>
+ <File Source="$(var.PODBCMSVCDLL)" />
+<?endif?>
+<?if "$(var.PODBCMSVCSYS)" != "" ?>
+ <File Source="$(var.SysFolder)\$(var.PODBCMSVCSYS)" />
+<?endif?>
+<?if "$(var.LIBPQMSVCDLL)" != "" ?>
+ <File Source="$(var.LIBPQMSVCDLL)" />
<?endif?>
-<?if "$(var.LIBPQMSVC)" != "" ?>
- <File Source="$(var.LIBPQMSVC)" />
+<?if "$(var.LIBPQMSVCSYS)" != "" ?>
+ <File Source="$(var.SysFolder)\$(var.LIBPQMSVCSYS)" />
<?endif?>
<File Id="libpq.dll" Name="libpq.dll" Source="$(var.LIBPQBINDIR)\libpq.dll" KeyPath="yes" />