return "", $rt_dllname
}
-function getVersion($connInfo)
-{
- $version_no = $connInfo.Configuration.version
- if ("$version_no" -eq "") {
- pushd "$scriptPath"
- $splitItem = Get-Content "..\version.h" | Where-Object {($_.IndexOf("#define") -ge 0) -and ($_.IndexOf("POSTGRESDRIVERVERSION") -ge 0) -and ($_.IndexOF("`"") -ge 0)} | ForEach-Object {$_.split("`"")}
- $version_no = $splitItem[1]
- popd
- }
- return $version_no
-}
-
function buildInstaller($CPUTYPE)
{
$LIBPQBINDIR=getPGDir $configInfo $CPUTYPE "bin"
$dumpbinexe = Find-Dumpbin
$wRedist=$false
- $VERSION = getVersion $configInfo
+ $VERSION = GetPackageVersion $configInfo "$scriptPath/.."
if ($cpu -eq "both") {
buildInstaller "x86"
buildInstaller "x64"
::
@echo off
if "%1" == "/?" (
- powershell Get-Help %~dp0\buildBootstrapper.ps1 -detailed
+ powershell Get-Help '%~dp0\buildBootstrapper.ps1' -detailed
) else if "%1" == "-?" (
- powershell Get-Help %~dp0\buildBootstrapper.ps1 %2 %3 %4 %5 %6 %7 %8 %9
+ powershell Get-Help '%~dp0\buildBootstrapper.ps1' %2 %3 %4 %5 %6 %7 %8 %9
) else (
- powershell %~dp0\buildBootstrapper.ps1 %*
+ powershell "& '%~dp0\buildBootstrapper.ps1' %*"
)
$scriptPath = (Split-Path $MyInvocation.MyCommand.Path)
if ("$version" -eq "") {
- $configInfo = & "$scriptPath\..\..\winbuild\configuration.ps1" "$BuildConfigPath"
- $version = $configInfo.Configuration.version
+ # $configInfo = & "$scriptPath\..\..\winbuild\configuration.ps1" "$BuildConfigPath"
+ $scriptPath = (Split-Path $MyInvocation.MyCommand.Path)
+ $modulePath="${scriptPath}\..\..\winbuild"
+ Import-Module ${modulePath}\Psqlodbc-config.psm1
+ $defaultConfigDir=$modulePath
+ $configInfo = LoadConfiguration $BuildConfigPath $defaultConfigDir
+ $version = GetPackageVersion $configInfo "$scriptPath/../.."
+ Remove-Module Psqlodbc-config
}
if ("$env:WIX" -eq "") {
return $result
}
-Export-ModuleMember -function LoadConfiguration, SaveConfiguration, unifyNodes, getPGDir -variable LIBPQ_VERSION
+function GetPackageVersion($configInfo, $srcpath)
+{
+ $version_no = $configInfo.Configuration.version
+ if ("$version_no" -eq "") {
+ pushd "$srcpath"
+ $splitItem = Get-Content ".\version.h" | Where-Object {($_.IndexOf("#define") -ge 0) -and ($_.IndexOf("POSTGRESDRIVERVERSION") -ge 0) -and ($_.IndexOF("`"") -ge 0)} | ForEach-Object {$_.split("`"")}
+ $version_no = $splitItem[1]
+ popd
+ }
+ return $version_no
+}
+
+Export-ModuleMember -function LoadConfiguration, SaveConfiguration, unifyNodes, getPGDir, getPackageVersion -variable LIBPQ_VERSION