Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions cpp/src/arrow/flight/sql/odbc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)

set(CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../LICENSE.txt")
# Tentative version 1.0.0 (patch version is not set)
# Tentative version 1.0.0
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")

set(CPACK_PACKAGE_NAME "Apache Arrow Flight SQL ODBC")
set(CPACK_PACKAGE_VENDOR "Apache Arrow")
Expand All @@ -115,13 +116,26 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)
DESTINATION bin
COMPONENT flight_sql_odbc_lib
FILES_MATCHING
PATTERN "*.dll"
PATTERN "arrow_flight_testing.dll" EXCLUDE
PATTERN "arrow_testing.dll" EXCLUDE
PATTERN "gflags.dll" EXCLUDE
PATTERN "gmock.dll" EXCLUDE
PATTERN "gtest.dll" EXCLUDE
PATTERN "gtest_main.dll" EXCLUDE)
# Use regex for dll name patterns with versions
PATTERN "abseil_dll.dll"
PATTERN "arrow.dll"
PATTERN "arrow_compute.dll"
PATTERN "arrow_flight.dll"
PATTERN "arrow_flight_sql.dll"
PATTERN "arrow_flight_sql_odbc.dll"
PATTERN "boost_locale*.dll"
PATTERN "cares.dll"
PATTERN "libcrypto*.dll"
PATTERN "libprotobuf.dll"
PATTERN "libssl*.dll"
PATTERN "re2.dll"
PATTERN "utf8proc.dll"
PATTERN "zlib1.dll")

set(CPACK_WIX_EXTRA_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/install/arrow-flight-sql-odbc.wxs")
set(CPACK_WIX_PATCH_FILE
"${CMAKE_CURRENT_SOURCE_DIR}/install/arrow-flight-sql-odbc-patch.xml")
endif()

get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
Expand Down
7 changes: 7 additions & 0 deletions cpp/src/arrow/flight/sql/odbc/README
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ After the build succeeds, the ODBC DLL will be located in

If the registration is successful, then Apache Arrow Flight SQL ODBC Driver
should show as an available ODBC driver in the x64 ODBC Driver Manager.

Steps to Generate Windows Installer
1. Build with `ARROW_FLIGHT_SQL_ODBC=ON` and `ARROW_FLIGHT_SQL_ODBC_INSTALLER=ON`.
2. `cd` to `build` folder.
3. Run `cpack`.

If the generation is successful, you will find `Apache Arrow Flight SQL ODBC-<version>-win64.msi` generated under the `build` folder.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<CPackWiXPatch>
<CPackWiXFragment Id="#PRODUCTFEATURE">
<ComponentRef Id="ODBCRegistryEntries"/>
</CPackWiXFragment>
</CPackWiXPatch>
37 changes: 37 additions & 0 deletions cpp/src/arrow/flight/sql/odbc/install/arrow-flight-sql-odbc.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="windows-1252"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="ODBCRegistryEntries" Guid="C348B9F7-5E8D-415D-A001-D92F2D4EA013">
<RegistryValue Root='HKLM' Key='Software\ODBC\ODBCINST.INI\ODBC Drivers' Name='Apache Arrow Flight SQL ODBC Driver' Type='string' Value='Installed'/>

<RegistryKey Root="HKLM"
Key="Software\ODBC\ODBCINST.INI\Apache Arrow Flight SQL ODBC Driver">
<!-- CM_FP_flight_sql_odbc_lib.bin.arrow_flight_sql_odbc.dll is a generated variable value from build\_CPack_Packages\win64\WIX\files.wxs -->
<RegistryValue Type="string" Name="DriverODBCVer" Value="03.00"/>
<RegistryValue Type="string" Name="Driver" Value="[#CM_FP_flight_sql_odbc_lib.bin.arrow_flight_sql_odbc.dll]"/>
<RegistryValue Type="string" Name="Setup" Value="[#CM_FP_flight_sql_odbc_lib.bin.arrow_flight_sql_odbc.dll]"/>
<RegistryValue Type="integer" Name="UsageCount" Value="1"/>
</RegistryKey>
</Component>
</DirectoryRef>
</Fragment>
</Wix>
Loading