The first cut of psqlodbc setup project. It builds a setup program which
authorHiroshi Inoue <inoue@tpf.co.p>
Sun, 14 Jul 2013 11:51:17 +0000 (20:51 +0900)
committerHiroshi Inoue <inoue@tpf.co.p>
Sun, 14 Jul 2013 22:59:15 +0000 (07:59 +0900)
can't be done by a single MSI. It would install VC++ redistributable, 32
bit psqlodbc driver and 64 bit psqlodbc driver (on 64 bit windows).

.gitignore
installer/psqlodbc-setup/Bundle.wxs [new file with mode: 0755]
installer/psqlodbc-setup/Make.bat [new file with mode: 0755]
installer/psqlodbc-setup/psqlodbc-setup.wixproj [new file with mode: 0755]
installer/psqlodbc-setup/vcredist.wxs [new file with mode: 0755]

index 621fab8a3a5bc31a1b3b08af23b1da9a8d3d0161..05422ec57c7529654b01dd744161c854d313fae8 100644 (file)
@@ -49,5 +49,6 @@ lib*.pc
 
 # WIX tools (candle, light) generate
 *.wix*
+!*.wixproj
 *.msm
 *.msi
diff --git a/installer/psqlodbc-setup/Bundle.wxs b/installer/psqlodbc-setup/Bundle.wxs
new file mode 100755 (executable)
index 0000000..1b63cdd
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">\r
+   <Bundle Name="psqlodbc" Version="09.02.01.00" Manufacturer="PostgreSQL Global Development Group" UpgradeCode="7f9f14ee-2f3a-4120-a300-ee3fbd585627">\r
+       <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />\r
+\r
+    <WixVariable Id="WixStdbaLicenseRtf" Value="..\lgpl.rtf" />\r
+    <Chain>\r
+           <!-- TODO: Define the list of chained packages. -->\r
+      <PackageGroupRef Id="vcredist"/>\r
+      <MsiPackage SourceFile="..\psqlodbc.msi" DisplayInternalUI="yes" />\r
+      <MsiPackage SourceFile="..\x64\psqlodbc_x64.msi" DisplayInternalUI="yes" InstallCondition="VersionNT64" />\r
+    </Chain>\r
+   </Bundle>\r
+</Wix>\r
diff --git a/installer/psqlodbc-setup/Make.bat b/installer/psqlodbc-setup/Make.bat
new file mode 100755 (executable)
index 0000000..616698b
--- /dev/null
@@ -0,0 +1,32 @@
+setlocal
+set wix_dir=%WIX%bin
+set pgmname=psqlodbc
+set build_config=Release
+set objdir=obj\%build_config%
+set bindir=bin\%build_config%
+
+"%wix_dir%\candle.exe" -v ^
+-dConfiguration=%build_config% ^
+-dOutDir=%bindir%\ -dPlatform=x86 ^
+-d"ProjectDir=\\" -dProjectExt=.wixproj ^
+-dProjectFileName=%pgmname%.wixproj -dProjectName=%pgmname% ^
+-d"ProjectPath=%pgmname%.wixproj" ^
+-d"TargetDir=%bindir%\\" -dTargetExt=.exe ^
+-dTargetFileName=%pgmname%.exe -dTargetName=%pgmname% ^
+-d"TargetPath=%bindir%\%pgmname%.exe" ^
+-out %objdir%\ -arch x86 ^
+-ext "%wix_dir%\WixUtilExtension.dll" ^
+-ext "%wix_dir%\WixBalExtension.dll" ^
+Bundle.wxs vcredist.wxs
+
+"%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 ^
+%objdir%\Bundle.wixobj %objdir%\vcredist.wixobj
+
+endlocal
diff --git a/installer/psqlodbc-setup/psqlodbc-setup.wixproj b/installer/psqlodbc-setup/psqlodbc-setup.wixproj
new file mode 100755 (executable)
index 0000000..38d2899
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup>\r
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>\r
+    <ProductVersion>3.6</ProductVersion>\r
+    <ProjectGuid>{748caa18-f40d-4308-bc52-2605d09c38b1}</ProjectGuid>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
+    <OutputName>psqlodbc-setup</OutputName>\r
+    <OutputType>Bundle</OutputType>\r
+    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>\r
+    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
+    <OutputPath>bin\$(Configuration)\</OutputPath>\r
+    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>\r
+    <DefineConstants>Debug</DefineConstants>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">\r
+    <OutputPath>bin\$(Configuration)\</OutputPath>\r
+    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Compile Include="Bundle.wxs" />\r
+    <Compile Include="vcredist.wxs" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <WixExtension Include="WixUtilExtension">\r
+      <HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>\r
+      <Name>WixUtilExtension</Name>\r
+    </WixExtension>\r
+    <WixExtension Include="WixBalExtension">\r
+      <HintPath>$(WixExtDir)\WixBalExtension.dll</HintPath>\r
+      <Name>WixBalExtension</Name>\r
+    </WixExtension>\r
+  </ItemGroup>\r
+  <Import Project="$(WixTargetsPath)" />\r
+  <!--\r
+   To modify your build process, add your task inside one of the targets below and uncomment it.\r
+   Other similar extension points exist, see Wix.targets.\r
+   <Target Name="BeforeBuild">\r
+   </Target>\r
+   <Target Name="AfterBuild">\r
+   </Target>\r
+   -->\r
+</Project>\r
diff --git a/installer/psqlodbc-setup/vcredist.wxs b/installer/psqlodbc-setup/vcredist.wxs
new file mode 100755 (executable)
index 0000000..7342729
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!-- ?define vcredist_x86 =  http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x86.exe ?>\r
+<?define vcredist_x64 =  http://download.microsoft.com/download/d/d/9/dd9a82d0-52ef-40db-8dab-795376989c03/vcredist_x64.exe ? -->\r
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"\r
+     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
+  <Fragment>\r
+       <!-- TODO: Put your code here. -->\r
+    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" Value="Installed" Variable="vc100_redist_x86" />\r
+    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64" Value="Installed" Variable="vc100_redist_x64" Win64="yes"/>\r
+    <PackageGroup Id="vcredist">\r
+      <ExePackage Id="vc100_redist_x86"\r
+        Cache="no"\r
+        Compressed="yes"\r
+        PerMachine="yes"\r
+        Permanent="yes"\r
+        Vital="yes"\r
+        Name="Redist\vc100_redist_x86.exe"\r
+        SourceFile="vc100_redist_x86.exe"\r
+        InstallCommand="/q"\r
+        DetectCondition="vc100_redist_x86 AND (vc100_redist_x86 &gt;= 1)">\r
+        <ExitCode Value ="3010" Behavior="forceReboot" />\r
+      </ExePackage>\r
+      <ExePackage Id="vc100_redist_x64"\r
+        Cache="no"\r
+        Compressed="yes"\r
+        PerMachine="yes"\r
+        Permanent="yes"\r
+        Vital="yes"\r
+        Name="Redist\vc100_redist_x64.exe"\r
+        SourceFile="vc100_redist_x64.exe"\r
+        InstallCommand="/q"\r
+        InstallCondition="VersionNT64"\r
+        DetectCondition="vc100_redist_x64 AND (vc100_redist_x64 &gt;= 1)">\r
+        <ExitCode Value ="3010" Behavior="forceReboot" />\r
+      </ExePackage>\r
+    </PackageGroup>\r
+  </Fragment>\r
+</Wix>\r