Use the same version number in buildBootstrapper.ps1 as buildInstaller.ps1 uses.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Wed, 1 Feb 2017 03:16:46 +0000 (12:16 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Mon, 6 Feb 2017 05:27:49 +0000 (14:27 +0900)
installer/buildInstallers.ps1
installer/psqlodbc-setup/Make.bat
installer/psqlodbc-setup/buildBootstrapper.ps1
winbuild/Psqlodbc-config.psm1

index 318efe678b95c8b9715a2ae57d7db4c8ee1fab8b..6197f5306b02e9ae97435a86e5045e7ca8e4dc2c 100644 (file)
@@ -96,18 +96,6 @@ function findRuntime([int]$runtime_version, [String]$pgmvc)
    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"
@@ -273,7 +261,7 @@ try {
    $dumpbinexe = Find-Dumpbin
 
    $wRedist=$false
-   $VERSION = getVersion $configInfo
+   $VERSION = GetPackageVersion $configInfo "$scriptPath/.."
    if ($cpu -eq "both") {
        buildInstaller "x86"
        buildInstaller "x64"
index e79bf0abb8dd02c23943bcc9b87644e16da27fe1..c8cd9a1cc564ee9e0debef0a7ac2654ce138173e 100755 (executable)
@@ -3,9 +3,9 @@
 ::
 @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' %*"
 )
index a1220494748284a23d47b3f3d9be0a0c0296329c..710d25dfddb28bfe68c8c4a6a775a2de8a0e8cc7 100644 (file)
@@ -36,8 +36,14 @@ write-host "Building bootstrapper program`n"
 
 $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 "") {
index b1cea3edd626b83a94608cb281297e8aae8e10e8..9abe7e038e481fbdda7b34cca38294d12345567c 100755 (executable)
@@ -163,4 +163,16 @@ function getPGDir($configInfo, $Platform, $kind)
    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