Explorar el Código

Detect shared configuration in ANCM installers and fail if enabled (#3962)

Justin Kotalik hace 7 años
padre
commit
263fb650be

+ 3 - 0
src/Installers/Windows/AspNetCoreModule-Setup/ANCMV1/aspnetcoremodule.wxs

@@ -245,10 +245,13 @@
                           Value=""[IISInetSrvDir]appcmd.exe" unlock config /section:system.webserver/handlers" />
         <CustomAction Id="CA_UNLOCk_HANDLER" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
         <CustomAction Id="UpdateDynamicCompression" BinaryKey="IISCustomActionDll" DllEntry ="RegisterANCMCompressionCA" Execute ="deferred" Return ="ignore" Impersonate ="no" />
+        <CustomAction BinaryKey="IISCustomActionDll" Id="CheckForSharedConfiguration" DllEntry="CheckForSharedConfigurationCA" Execute="deferred" Return="check" Impersonate="no"/>
+
         <InstallExecuteSequence>
             <AppSearch Before="LaunchConditions" />
             <LaunchConditions After="FindRelatedProducts" />
             <MigrateFeatureStates />
+            <Custom Action="CheckForSharedConfiguration" After="InstallInitialize"></Custom>
             <Custom Action="CA_UNLOCk_HANDLER_PROPERTY" After="InstallFiles"><![CDATA[(NOT PATCH)]]></Custom>
             <Custom Action="CA_UNLOCk_HANDLER" After="CA_UNLOCk_HANDLER_PROPERTY"><![CDATA[(NOT PATCH)]]></Custom>
             <Custom Action="UpdateDynamicCompression" After="InstallFiles"><![CDATA[(NOT PATCH)]]></Custom>

+ 2 - 0
src/Installers/Windows/AspNetCoreModule-Setup/ANCMV2/aspnetcoremodulev2.wxs

@@ -279,11 +279,13 @@
                           Value="&quot;[IISInstallDir]appcmd.exe&quot; unlock config /section:system.webserver/handlers" />
         <CustomAction Id="CA_UNLOCk_HANDLER" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
         <CustomAction Id="UpdateDynamicCompression" BinaryKey="IISCustomActionDll" DllEntry ="RegisterANCMCompressionCA" Execute ="deferred" Return ="ignore" Impersonate ="no" />
+        <CustomAction BinaryKey="IISCustomActionDll" Id="CheckForSharedConfiguration" DllEntry="CheckForSharedConfigurationCA" Execute="deferred" Return="check" Impersonate="no"/>
 
         <InstallExecuteSequence>
             <AppSearch Before="LaunchConditions" />
             <LaunchConditions After="FindRelatedProducts" />
             <MigrateFeatureStates />
+            <Custom Action="CheckForSharedConfiguration" After="InstallInitialize"></Custom>
             <Custom Action="CA_UNLOCk_HANDLER_PROPERTY" After="InstallFiles"><![CDATA[(NOT PATCH)]]></Custom>
             <Custom Action="CA_UNLOCk_HANDLER" After="CA_UNLOCk_HANDLER_PROPERTY"><![CDATA[(NOT PATCH)]]></Custom>
             <Custom Action="UpdateDynamicCompression" After="InstallFiles"><![CDATA[(NOT PATCH)]]></Custom>

+ 1 - 1
src/Installers/Windows/AspNetCoreModule-Setup/Directory.Build.props

@@ -1,6 +1,6 @@
 <Project>
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
-  <Import Project="$(RepositoryRoot)\.deps\dependencies.g.props" />
+  <Import Project="$(RepositoryRoot)\.deps\dependencies.g.props" Condition="Exists('$(RepositoryRoot)\.deps\dependencies.g.props')" />
 
   <PropertyGroup>
     <!-- Build number used by ANCM msis -->