Merge pull request #7285 from livarcocc/native_installers_use_installed_sdk

Updating the native installers to use the SDK just installed for first run
This commit is contained in:
William Lee 2017-07-27 15:25:37 -07:00 committed by GitHub
commit fa4bf8d0fb
9 changed files with 52 additions and 13 deletions

View file

@ -43,13 +43,15 @@
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False" />
<!-- Create layout: postinst -->
<Copy
DestinationFiles= "$(DebianPostinstFile)"
SourceFiles="$(DebianPostinstTemplateFile)"
OverwriteReadOnlyFiles="True"
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False" />
<!-- Create layout: Generate and Place postinst -->
<ReplaceFileContents
InputFile="$(DebianPostinstTemplateFile)"
DestinationFile="$(DebianPostinstFile)"
ReplacementItems="@(DebianPostInstTokenValues)" />
<Chmod
Glob="$(DebianPostinstFile)"
Mode="ugo+x" />
<!-- Create layout: Generate and Place debian_config.json -->
<ReplaceFileContents

View file

@ -105,6 +105,10 @@
<DebianConfigTokenValues Include="%CLI_SDK_BRAND_NAME%">
<ReplacementString>$(SdkBrandName)</ReplacementString>
</DebianConfigTokenValues>
<DebianPostInstTokenValues Include="%SDK_VERSION%">
<ReplacementString>$(SdkVersion)</ReplacementString>
</DebianPostInstTokenValues>
</ItemGroup>
<ItemGroup>

View file

@ -14,6 +14,9 @@
<SdkPkgSourcesRootDirectory>$(RepoRoot)/packaging/osx/clisdk</SdkPkgSourcesRootDirectory>
<SdkPkgScriptsDirectory>$(SdkPkgSourcesRootDirectory)/scripts</SdkPkgScriptsDirectory>
<SdkPkgScriptTemplateFile>$(SdkPkgScriptsDirectory)/postinstall</SdkPkgScriptTemplateFile>
<SdkPkgDestinationScriptsDirectory>$(PkgIntermediateDirectory)/scripts</SdkPkgDestinationScriptsDirectory>
<SdkPkgScriptFile>$(SdkPkgDestinationScriptsDirectory)/postinstall</SdkPkgScriptFile>
<SdkProductArchiveResourcesDirectory>$(SdkPkgSourcesRootDirectory)/resources</SdkProductArchiveResourcesDirectory>
<SdkProductArchiveDistributionTemplateFile>$(SdkPkgSourcesRootDirectory)/Distribution-Template</SdkProductArchiveDistributionTemplateFile>
@ -54,6 +57,10 @@
<DistributionTemplateReplacement Include="{HostFxrBrandName}">
<ReplacementString>$(HostFxrBrandName)</ReplacementString>
</DistributionTemplateReplacement>
<PostInstallScriptReplacement Include="%SDK_VERSION%">
<ReplacementString>$(SdkVersion)</ReplacementString>
</PostInstallScriptReplacement>
</ItemGroup>
<!-- Consumed By Publish -->
@ -83,12 +90,22 @@
<Copy SourceFiles="@(AspNetRuntimeFilesInput)"
DestinationFiles="@(AspNetRuntimeFilesInput->'$(SdkLayoutOutputDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
<ReplaceFileContents
InputFile="$(SdkPkgScriptTemplateFile)"
DestinationFile="$(SdkPkgScriptFile)"
ReplacementPatterns="@(PostInstallScriptReplacement -> '%(Identity)')"
ReplacementStrings="@(PostInstallScriptReplacement -> '%(ReplacementString)')" />
<Chmod
Glob="$(SdkPkgScriptFile)"
Mode="ugo+x" />
<Exec Command="pkgbuild
--root '$(SdkLayoutOutputDirectory)'
--identifier '$(SdkComponentId)'
--version '$(SdkVersion)'
--install-location '$(PkgInstallDirectory)'
--scripts '$(SdkPkgScriptsDirectory)'
--scripts '$(SdkPkgDestinationScriptsDirectory)'
'$(SdkInstallerFile)'" />
</Target>

View file

@ -4,5 +4,6 @@
<RpmConfigJsonName>rpm_config.json</RpmConfigJsonName>
<TemplatesDir>$(RepoRoot)/packaging/rpm/templates</TemplatesDir>
<ScriptsDir>$(RepoRoot)/packaging/rpm/scripts</ScriptsDir>
<AfterInstallHostScriptName>after_install_host.sh</AfterInstallHostScriptName>
</PropertyGroup>
</Project>

View file

@ -55,6 +55,8 @@
<AspNetCoreRuntimePackageName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimePackageName>
<AspNetCoreRuntimePackageVersion>$(AspNetCoreVersion)-$(AspNetCoreRelease)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimePackageVersion>
<AspNetCoreRuntimeRpmInstallerFileName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)-$(HostRidInAspNetCoreRuntimeRpmInstallerFileName).rpm</AspNetCoreRuntimeRpmInstallerFileName>
<AfterInstallHostScriptTemplateFile>$(ScriptsDir)/$(AfterInstallHostScriptName)</AfterInstallHostScriptTemplateFile>
<AfterInstallHostScriptDestinationFile>$(RpmLayoutScripts)/$(AfterInstallHostScriptName)</AfterInstallHostScriptDestinationFile>
</PropertyGroup>
<PropertyGroup>
@ -78,7 +80,7 @@
<SDKFiles Include="$(InputRoot)/**/*"/>
<SDKManpages Include="$(ManPagesDir)/**/*"/>
<SDKTemplatesFiles Include="$(TemplatesDir)/**/*"/>
<SDKScriptsFiles Include="$(ScriptsDir)/**/*"/>
<SDKScriptsFiles Include="$(ScriptsDir)/after_remove_host.sh"/>
</ItemGroup>
<Copy SourceFiles="@(SDKFiles)"
@ -128,6 +130,10 @@
<SDKTokenValue Include="%SDK_RPM_PACKAGE_NAME%">
<ReplacementString>$(SdkRpmPackageName)</ReplacementString>
</SDKTokenValue>
<AfterInstallHostTokenValue Include="%SDK_VERSION%">
<ReplacementString>$(SdkVersion)</ReplacementString>
</AfterInstallHostTokenValue>
</ItemGroup>
<ItemGroup>
@ -135,6 +141,14 @@
<GeneratedInstallers Include="$(SdkInstallerFile)" />
</ItemGroup>
<ReplaceFileContents InputFile="$(AfterInstallHostScriptTemplateFile)"
DestinationFile="$(AfterInstallHostScriptDestinationFile)"
ReplacementItems="@(AfterInstallHostTokenValue)"/>
<Chmod
Glob="$(AfterInstallHostScriptDestinationFile)"
Mode="ugo+x" />
<ReplaceFileContents InputFile="$(ConfigJsonFile)"
DestinationFile="$(RpmLayoutDirectory)$(RpmConfigJsonName)"
ReplacementItems="@(SDKTokenValue)"/>

View file

@ -19,4 +19,4 @@ Installation Note
--------------
A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete."
dotnet internal-reportinstallsuccess "debianpackage" > /dev/null 2>&1 || true
/usr/share/dotnet/dotnet exec /usr/share/dotnet/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "debianpackage" > /dev/null 2>&1 || true

View file

@ -11,6 +11,6 @@ INSTALL_DESTINATION=$2
# A temporary fix for the permissions issue(s)
chmod -R 755 $INSTALL_DESTINATION
$INSTALL_DESTINATION/dotnet internal-reportinstallsuccess "$1" > /dev/null 2>&1 || true
$INSTALL_DESTINATION/dotnet exec $INSTALL_DESTINATION/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "$1" > /dev/null 2>&1 || true
exit 0

View file

@ -23,4 +23,4 @@ Installation Note
--------------
A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete."
dotnet internal-reportinstallsuccess "rpmpackage" > /dev/null 2>&1 || true
/usr/share/dotnet/dotnet exec /usr/share/dotnet/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "rpmpackage" > /dev/null 2>&1 || true

View file

@ -20,6 +20,7 @@
<Property Id="ProductCPU" Value="$(var.Platform)" />
<Property Id="RTM_ProductVersion" Value="$(var.Dotnet_ProductVersion)" />
<Property Id="MSIFASTINSTALL" Value="7" />
<Property Id="NUGETVERSION" Value="$(var.NugetVersion)" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.MicrosoftEula)" />
<Property Id="DOTNETEXE">
@ -32,7 +33,7 @@
<CustomAction Id="PropertyAssignPrimeCacheAndTelemetry"
Property="QtExecPrimeCacheAndTelemetryTarget"
Value="&quot;[DOTNETHOME]\dotnet.exe&quot; internal-reportinstallsuccess &quot;[EXEFULLPATH]&quot;"
Value="&quot;[DOTNETHOME]\dotnet.exe&quot; exec &quot;[DOTNETHOME]\sdk\[NUGETVERSION]\dotnet.dll&quot; internal-reportinstallsuccess &quot;[EXEFULLPATH]&quot;"
Execute="immediate" />
<CustomAction Id="QtExecPrimeCacheAndTelemetryTarget"
BinaryKey="WixCA"