first commit for openGauss connect odbc code
This commit is contained in:
33
installer/psqlodbc-setup/Bundle.wxs
Normal file
33
installer/psqlodbc-setup/Bundle.wxs
Normal file
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
|
||||
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
|
||||
|
||||
<Bundle Name="psqlodbc"
|
||||
Version="$(var.VERSION)"
|
||||
Manufacturer="PostgreSQL Global Development Group"
|
||||
UpgradeCode="7f9f14ee-2f3a-4120-a300-ee3fbd585627">
|
||||
|
||||
<BootstrapperApplicationRef
|
||||
Id="WixStandardBootstrapperApplication.RtfLicense">
|
||||
|
||||
<bal:WixStandardBootstrapperApplication
|
||||
SuppressOptionsUI="yes"
|
||||
ShowVersion="yes"
|
||||
LicenseFile="..\lgpl.rtf"
|
||||
/>
|
||||
</BootstrapperApplicationRef>
|
||||
|
||||
<Chain>
|
||||
<!-- TODO: Define the list of chained packages. -->
|
||||
<?if $(var.withRedist) = yes ?>
|
||||
<PackageGroupRef Id="vcredist"/>
|
||||
<?endif ?>
|
||||
<MsiPackage SourceFile="..\x86\psqlodbc_x86.msi"
|
||||
DisplayInternalUI="$(var.withUI)" />
|
||||
<MsiPackage SourceFile="..\x64\psqlodbc_x64.msi"
|
||||
DisplayInternalUI="$(var.withUI)"
|
||||
InstallCondition="VersionNT64" />
|
||||
</Chain>
|
||||
</Bundle>
|
||||
</Wix>
|
11
installer/psqlodbc-setup/Make.bat
Executable file
11
installer/psqlodbc-setup/Make.bat
Executable file
@ -0,0 +1,11 @@
|
||||
::
|
||||
:: Build bootstrapper program of psqlodbc project
|
||||
::
|
||||
@echo off
|
||||
if "%1" == "/?" (
|
||||
powershell Get-Help '%~dp0\buildBootstrapper.ps1' -detailed
|
||||
) else if "%1" == "-?" (
|
||||
powershell Get-Help '%~dp0\buildBootstrapper.ps1' %2 %3 %4 %5 %6 %7 %8 %9
|
||||
) else (
|
||||
powershell "& '%~dp0\buildBootstrapper.ps1' %*"
|
||||
)
|
97
installer/psqlodbc-setup/buildBootstrapper.ps1
Normal file
97
installer/psqlodbc-setup/buildBootstrapper.ps1
Normal file
@ -0,0 +1,97 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Build a bootstrapper application of psqlodbc drivers.
|
||||
.DESCRIPTION
|
||||
Build psqlodbc-setup.exe
|
||||
.PARAMETER version
|
||||
Specify when you'd like to specify the version explicitly.
|
||||
.PARAMETER UI
|
||||
Specify when you'd like to show UIs of each MSIs.
|
||||
.PARAMETER withRedist
|
||||
Specify when you have to include vcredist.
|
||||
.PARAMETER BuildConfigPath
|
||||
Specify the configuration xml file name if you want to use
|
||||
the configuration file other than standard one.
|
||||
The relative path is relative to the current directory.
|
||||
.EXAMPLE
|
||||
> .\buildBootstrapper
|
||||
Build the bootstrapper.
|
||||
.EXAMPLE
|
||||
> .\buildBootstrapper -w(ithRedist)
|
||||
Build the bootstrapper with vcredist.
|
||||
.NOTES
|
||||
Author: Hiroshi Inoue
|
||||
Date: October 8, 2014
|
||||
#>
|
||||
# build bootstrapper of psqlodbc drivers
|
||||
#
|
||||
Param(
|
||||
[string]$version,
|
||||
[switch]$UI,
|
||||
[switch]$withRedist,
|
||||
[string]$BuildConfigPath
|
||||
)
|
||||
|
||||
write-host "Building bootstrapper program`n"
|
||||
|
||||
$scriptPath = (Split-Path $MyInvocation.MyCommand.Path)
|
||||
if ("$version" -eq "") {
|
||||
# $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 "") {
|
||||
throw "Please install WIX"
|
||||
}
|
||||
|
||||
$wix_dir="${env:WIX}bin"
|
||||
$pgmname="psqlodbc-setup"
|
||||
$build_config="Release"
|
||||
$objdir="obj\${build_config}"
|
||||
$bindir="bin\${build_config}"
|
||||
|
||||
$modules=@("Bundle.wxs")
|
||||
$wRedist="no"
|
||||
$objs=@("${objdir}\Bundle.wixobj")
|
||||
if ($withRedist) {
|
||||
$modules += "vcredist.wxs"
|
||||
$objs += "${objdir}\vcredist.wixobj"
|
||||
$wRedist = "yes"
|
||||
write-host "with Redistributable"
|
||||
}
|
||||
$wUI = "no"
|
||||
if ($UI) {
|
||||
$wUI = "yes"
|
||||
}
|
||||
|
||||
try {
|
||||
pushd "$scriptPath"
|
||||
|
||||
& ${wix_dir}\candle.exe -v "-dVERSION=$version" "-dwithRedist=$wRedist" "-dwithUI=$wUI" "-dConfiguration=${build_config}" "-dOutDir=${bindir}\" -dPlatform=x86 "-dProjectDir=.\" "-dProjectExt=.wixproj" "-dProjectFileName=${pgmname}.wixproj" "-dProjectName=${pgmname}" "-dProjectPath=${pgmname}.wixproj" "-dTargetDir=${bindir}\" "-dTargetExt=.exe" "-dTargetFileName=${pgmname}.exe" "-dTargetName=${pgmname}" "-dTargetPath=${bindir}\${pgmname}.exe" -out "${objdir}\" -arch x86 -ext ${wix_dir}\WixUtilExtension.dll -ext ${wix_dir}\WixBalExtension.dll $modules
|
||||
# $candle_cmd = "& `"${wix_dir}\candle.exe`" -v `"-dVERSION=$version`" -dwithRedist=$wRedist -dwithUI=$wUI -dConfiguration=${build_config} `"-dOutDir=${bindir}\`" -dPlatform=x86 `"-dProjectDir=.\`" `"-dProjectExt=.wixproj`" `"-dProjectFileName=${pgmname}.wixproj`" -dProjectName=${pgmname} `"-dProjectPath=${pgmname}.wixproj`" -dTargetDir=${bindir}\ `"-dTargetExt=.exe`" `"-dTargetFileName=${pgmname}.exe`" -dTargetName=${pgmname} `"-dTargetPath=${bindir}\${pgmname}.exe`" -out `"${objdir}\`" -arch x86 -ext `"${wix_dir}\WixUtilExtension.dll`" -ext `"${wix_dir}\WixBalExtension.dll`" $modules"
|
||||
#write-debug "candle_cmd = ${candle_cmd}"
|
||||
# compile
|
||||
#invoke-expression $candle_cmd
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to compile $modules"
|
||||
}
|
||||
# link
|
||||
# invoke-expression "& `"${wix_dir}\Light.exe`" -out ${bindir}\${pgmname}.exe -pdbout ${bindir}\${pgmname}.wixpdb -ext `"${wix_dir}\\WixUtilExtension.dll`" -ext `"${wix_dir}\\WixBalExtension.dll`" -contentsfile ${objdir}\${pgmname}.wixproj.BindContentsFileList.txt -outputsfile ${objdir}\${pgmname}.wixproj.BindOutputsFileList.txt -builtoutputsfile ${objdir}\${pgmname}.wixproj.BindBuiltOutputsFileList.txt -wixprojectfile ${pgmname}.wixproj ${objs}"
|
||||
& ${wix_dir}\Light.exe -out ${bindir}\${pgmname}.exe -pdbout ${bindir}\${pgmname}.wixpdb -ext ${wix_dir}\\WixUtilExtension.dll -ext ${wix_dir}\\WixBalExtension.dll -contentsfile ${objdir}\${pgmname}.wixproj.BindContentsFileList.txt -outputsfile ${objdir}\${pgmname}.wixproj.BindOutputsFileList.txt -builtoutputsfile ${objdir}\${pgmname}.wixproj.BindBuiltOutputsFileList.txt -wixprojectfile "${pgmname}.wixproj" ${objs}
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to link bootstrapper"
|
||||
}
|
||||
}
|
||||
catch [Exception] {
|
||||
Write-Host ".`Aborting build!"
|
||||
throw $error[0]
|
||||
}
|
||||
finally {
|
||||
popd
|
||||
}
|
46
installer/psqlodbc-setup/psqlodbc-setup.wixproj
Normal file
46
installer/psqlodbc-setup/psqlodbc-setup.wixproj
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>3.6</ProductVersion>
|
||||
<ProjectGuid>{748caa18-f40d-4308-bc52-2605d09c38b1}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>psqlodbc-setup</OutputName>
|
||||
<OutputType>Bundle</OutputType>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<DefineConstants>Debug</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bundle.wxs" />
|
||||
<Compile Include="vcredist.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixUtilExtension">
|
||||
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
|
||||
<Name>WixUtilExtension</Name>
|
||||
</WixExtension>
|
||||
<WixExtension Include="WixBalExtension">
|
||||
<HintPath>$(WixExtDir)\WixBalExtension.dll</HintPath>
|
||||
<Name>WixBalExtension</Name>
|
||||
</WixExtension>
|
||||
</ItemGroup>
|
||||
<Import Project="$(WixTargetsPath)" />
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Wix.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
41
installer/psqlodbc-setup/vcredist.wxs
Normal file
41
installer/psqlodbc-setup/vcredist.wxs
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?ifndef VCVER?>
|
||||
<?define VCVER = 14?>
|
||||
<?endif?>
|
||||
<!-- ?define vcredist_x86 = http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe ?>
|
||||
<?define vcredist_x64 = http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x64.exe ? -->
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
||||
<Fragment>
|
||||
<!-- TODO: Put your code here. -->
|
||||
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\$(var.VCVER).0\VC\VCRedist\x86" Value="Installed" Variable="vc$(var.VCVER)0_redist_x86" />
|
||||
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\$(var.VCVER).0\VC\VCRedist\x64" Value="Installed" Variable="vc$(var.VCVER)0_redist_x64" Win64="yes"/>
|
||||
<PackageGroup Id="vcredist">
|
||||
<ExePackage Id="vc$(var.VCVER)0_redist_x86"
|
||||
Cache="no"
|
||||
Compressed="yes"
|
||||
PerMachine="yes"
|
||||
Permanent="yes"
|
||||
Vital="yes"
|
||||
Name="vc$(var.VCVER)0_redist_x86.exe"
|
||||
SourceFile="Redist\vc$(var.VCVER)0_redist_x86.exe"
|
||||
InstallCommand="/q"
|
||||
DetectCondition="vc$(var.VCVER)0_redist_x86 AND (vc$(var.VCVER)0_redist_x86 >= 1)">
|
||||
<ExitCode Value ="3010" Behavior="forceReboot" />
|
||||
</ExePackage>
|
||||
<ExePackage Id="vc$(var.VCVER)0_redist_x64"
|
||||
Cache="no"
|
||||
Compressed="yes"
|
||||
PerMachine="yes"
|
||||
Permanent="yes"
|
||||
Vital="yes"
|
||||
Name="vc$(var.VCVER)0_redist_x64.exe"
|
||||
SourceFile="Redist\vc$(var.VCVER)0_redist_x64.exe"
|
||||
InstallCommand="/q"
|
||||
InstallCondition="VersionNT64"
|
||||
DetectCondition="vc$(var.VCVER)0_redist_x64 AND (vc$(var.VCVER)0_redist_x64 >= 1)">
|
||||
<ExitCode Value ="3010" Behavior="forceReboot" />
|
||||
</ExePackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
Reference in New Issue
Block a user