You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ab...@apache.org on 2021/05/27 15:45:53 UTC

[nifi-minifi-cpp] branch main updated: MINIFICPP-1559 Add new redistributable file to the msi in VS2019 builds

This is an automated email from the ASF dual-hosted git repository.

aboda pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new ff31971  MINIFICPP-1559 Add new redistributable file to the msi in VS2019 builds
ff31971 is described below

commit ff3197165122b91b3f77a42c3036d355f3844ac6
Author: Ferenc Gerlits <fg...@gmail.com>
AuthorDate: Thu May 13 18:42:30 2021 +0200

    MINIFICPP-1559 Add new redistributable file to the msi in VS2019 builds
    
    add msvcp140_atomic_wait.dll and msvcp140_codecvt_ids.dll
    
    ... and remove vcruntime140_1.dll in 32-bit VS2019 builds
    
    Signed-off-by: Arpad Boda <ab...@apache.org>
    
    This closes #1080
---
 CMakeLists.txt | 18 +++++-------------
 msi/WixWin.wsi | 49 +++++++++++++++++++++----------------------------
 2 files changed, 26 insertions(+), 41 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fc3273..8c80382 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -671,8 +671,8 @@ if(WIN32)
 		list(SORT VCRUNTIME_REDIST_VERSIONS)
 		list(REVERSE VCRUNTIME_REDIST_VERSIONS)
 		list(GET VCRUNTIME_REDIST_VERSIONS 0 VCRUNTIME_REDIST_DIR)
-		message("Using redist directory: ${VCRUNTIME_REDIST_DIR}")
 	endif()
+	message("Using redist directory: ${VCRUNTIME_REDIST_DIR}")
 
 	if (MSI_REDISTRIBUTE_UCRT_NONASL)
 		set(UCRT_DIR_NAT "$ENV{WindowsSdkDir}Redist\\ucrt\\DLLs\\$ENV{Platform}")
@@ -733,20 +733,12 @@ if(WIN32)
 
 		if(CMAKE_SIZEOF_VOID_P EQUAL 8)
 			message("Using ${VCRUNTIME_X64_REDIST_CRT_DIR} VC Redistributables")
-			file(COPY "${VCRUNTIME_X64_REDIST_CRT_DIR}/concrt140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X64_REDIST_CRT_DIR}/msvcp140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X64_REDIST_CRT_DIR}/msvcp140_1.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X64_REDIST_CRT_DIR}/msvcp140_2.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X64_REDIST_CRT_DIR}/vccorlib140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X64_REDIST_CRT_DIR}/vcruntime140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
+			file(GLOB VCRUNTIME_X64_REDIST_CRT_FILES "${VCRUNTIME_X64_REDIST_CRT_DIR}/*.dll")
+			file(COPY ${VCRUNTIME_X64_REDIST_CRT_FILES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
 		elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
 			message("Using ${VCRUNTIME_X86_REDIST_CRT_DIR} VC Redistributables")
-			file(COPY "${VCRUNTIME_X86_REDIST_CRT_DIR}/concrt140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X86_REDIST_CRT_DIR}/msvcp140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X86_REDIST_CRT_DIR}/msvcp140_1.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X86_REDIST_CRT_DIR}/msvcp140_2.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X86_REDIST_CRT_DIR}/vccorlib140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
-			file(COPY "${VCRUNTIME_X86_REDIST_CRT_DIR}/vcruntime140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
+			file(GLOB VCRUNTIME_X86_REDIST_CRT_FILES "${VCRUNTIME_X86_REDIST_CRT_DIR}/*.dll")
+			file(COPY ${VCRUNTIME_X86_REDIST_CRT_FILES} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/redist")
 		else()
 			message(FATAL_ERROR "Could not determine architecture, CMAKE_SIZEOF_VOID_P is unexpected: ${CMAKE_SIZEOF_VOID_P}")
 		endif()
diff --git a/msi/WixWin.wsi b/msi/WixWin.wsi
index fbac160..411e52c 100644
--- a/msi/WixWin.wsi
+++ b/msi/WixWin.wsi
@@ -44,22 +44,16 @@ Licensed to the Apache Software Foundation (ASF) under one or more
     <?ifdef CPACK_WIX_UI_BANNER?>
     <WixVariable Id="WixUIBannerBmp" Value="$(var.CPACK_WIX_UI_BANNER)"/>
     <?endif?>
-    <!-- <InstallExecuteSequence>
-
-      <Custom Action="UpdateConfig" After="InstallFiles">NOT Installed</Custom>
-    </InstallExecuteSequence> -->
-
-<!--
-    <Feature Id="VCRedist64" Title="Visual C++ 14.0 Runtime" AllowAdvertise="yes"  Level="1">
-      <MergeRef Id="VCRedist64"/>
-      <Condition Level="1"><![CDATA[(var.CPACK_SYSTEM_NAME="win64")]]></Condition>
-    </Feature>-->
 
     <Feature Id="InstallService" Title="Apache NiFi MiNiFi C++ Service" AllowAdvertise="no" Display="hidden" Level="1">
       <ComponentRef Id="minifiService"/>
       <ComponentRef Id="minifiServiceNotLocal"/>
     </Feature>
 
+    <Feature Id="InstallVSRedistributableFiles" Title="Visual Studio redistributable files" AllowAdvertise="no" Display="hidden" Level="1">
+      <ComponentRef Id="VSRedistributableFiles"/>
+    </Feature>
+
     <Feature Id="InstallConf" Title="Apache NiFi MiNiFi C++ Configuration" AllowAdvertise="yes"  Level="1">
       <ComponentRef Id="LOGPROP"/>
       <ComponentRef Id="UIDPROP"/>
@@ -70,7 +64,6 @@ Licensed to the Apache Software Foundation (ASF) under one or more
 
     <FeatureRef Id="ProductFeature"/>
 
-
     <?ifdef CPACK_WIX_UI_DIALOG?>
     <WixVariable Id="WixUIDialogBmp" Value="$(var.CPACK_WIX_UI_DIALOG)"/>
     <?endif?>
@@ -129,8 +122,6 @@ Licensed to the Apache Software Foundation (ASF) under one or more
     <UI>
       <!-- Define the installer UI -->
 
-
-
       <Dialog Id="ApacheLicenseDlg" Width="370" Height="270" Title="Please review our license">
         <Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="207" Width="330" Height="18" CheckBoxValue="1" Property="LicenseAccepted" Text="Click here to accept this license" />
         <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back" />
@@ -254,11 +245,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
 -->
       </Dialog>
 
-
       <UIRef Id="WixUI_HK" />
 
-
-
     </UI>
 
     <Property Id="AGENT_CLASS"  Value="Your Agent Class" />
@@ -318,12 +306,6 @@ Licensed to the Apache Software Foundation (ASF) under one or more
             <Directory Id="INSTALLBINDIR" Name="bin">
               <Component Id="minifiService" Guid="87658309-0339-425c-8633-f54ffaaa4921">
                 <File Id="MiNiFiExe" Name="minifi.exe" KeyPath="yes" Source="main\minifi.exe"/>
-                <File Id="MiNiFiExe_concrt140" Name="concrt140.dll" KeyPath="no" Source="redist\concrt140.dll"/>
-                <File Id="MiNiFiExe_msvcp140" Name="msvcp140.dll" KeyPath="no" Source="redist\msvcp140.dll"/>
-                <File Id="MiNiFiExe_msvcp140_1" Name="msvcp140_1.dll" KeyPath="no" Source="redist\msvcp140_1.dll"/>
-                <File Id="MiNiFiExe_msvcp140_2" Name="msvcp140_2.dll" KeyPath="no" Source="redist\msvcp140_2.dll"/>
-                <File Id="MiNiFiExe_vccorlib140" Name="vccorlib140.dll" KeyPath="no" Source="redist\vccorlib140.dll"/>
-                <File Id="MiNiFiExe_vcruntime140" Name="vcruntime140.dll" KeyPath="no" Source="redist\vcruntime140.dll"/>
                 <!--
                 It is not possible to set 'ServiceConfig' for 2 'Component' (error LGHT0130 : The primary key 'Apache NiFi MiNiFi' is duplicated in table 'ServiceConfig').
                 Problem is described: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Installing-a-Service-with-Varying-Dependencies-td693097.html
@@ -362,12 +344,6 @@ Licensed to the Apache Software Foundation (ASF) under one or more
               </Component>
               <Component Id="minifiServiceNotLocal" Guid="87658309-0339-425c-8633-f54ffaaa4922">
                 <File Id="MiNiFiExeWithPassword" Name="minifi.exe" KeyPath="yes" Source="main\minifi.exe"/>
-                <File Id="MiNiFiExeWithPassword_concrt140" Name="concrt140.dll" KeyPath="no" Source="redist\concrt140.dll"/>
-                <File Id="MiNiFiExeWithPassword_msvcp140" Name="msvcp140.dll" KeyPath="no" Source="redist\msvcp140.dll"/>
-                <File Id="MiNiFiExeWithPassword_msvcp140_1" Name="msvcp140_1.dll" KeyPath="no" Source="redist\msvcp140_1.dll"/>
-                <File Id="MiNiFiExeWithPassword_msvcp140_2" Name="msvcp140_2.dll" KeyPath="no" Source="redist\msvcp140_2.dll"/>
-                <File Id="MiNiFiExeWithPassword_vccorlib140" Name="vccorlib140.dll" KeyPath="no" Source="redist\vccorlib140.dll"/>
-                <File Id="MiNiFiExeWithPassword_vcruntime140" Name="vcruntime140.dll" KeyPath="no" Source="redist\vcruntime140.dll"/>
                 <ServiceInstall Id="MiNiFiExeServiceWithPassword"
                                 Type="ownProcess"
                                 Vital="yes"
@@ -395,6 +371,23 @@ Licensed to the Apache Software Foundation (ASF) under one or more
                                   EventMessageFile="[#MiNiFiExeWithPassword]" />
                 <Condition><![CDATA[SERVICEACCOUNT<>"LocalSystem"]]></Condition>
               </Component>
+
+              <Component Id="VSRedistributableFiles" Guid="7923f16d-785a-41cb-aa74-17e0fa5f1314">
+                <File Id="MiNiFiExe_concrt140" Name="concrt140.dll" KeyPath="no" Source="redist\concrt140.dll"/>
+                <File Id="MiNiFiExe_msvcp140" Name="msvcp140.dll" KeyPath="no" Source="redist\msvcp140.dll"/>
+                <File Id="MiNiFiExe_msvcp140_1" Name="msvcp140_1.dll" KeyPath="no" Source="redist\msvcp140_1.dll"/>
+                <File Id="MiNiFiExe_msvcp140_2" Name="msvcp140_2.dll" KeyPath="no" Source="redist\msvcp140_2.dll"/>
+                <File Id="MiNiFiExe_vccorlib140" Name="vccorlib140.dll" KeyPath="no" Source="redist\vccorlib140.dll"/>
+                <File Id="MiNiFiExe_vcruntime140" Name="vcruntime140.dll" KeyPath="no" Source="redist\vcruntime140.dll"/>
+                <?if $(env.VisualStudioVersion) = 16.0 ?>
+                  <File Id="MiNiFiExe_msvcp140_atomic_wait" Name="msvcp140_atomic_wait.dll" KeyPath="no" Source="redist\msvcp140_atomic_wait.dll"/>
+                  <File Id="MiNiFiExe_msvcp140_codecvt_ids" Name="msvcp140_codecvt_ids.dll" KeyPath="no" Source="redist\msvcp140_codecvt_ids.dll"/>
+                  <?if $(env.build_platform) = x64 ?>
+                    <File Id="MiNiFiExe_vcruntime140_1" Name="vcruntime140_1.dll" KeyPath="no" Source="redist\vcruntime140_1.dll"/>
+                  <?endif ?>
+                <?endif ?>
+              </Component>
+
             </Directory>
           </Directory>
     </DirectoryRef>