Run dotnet new after install to prime cache for deb

Copy postinst to correct directory

Can only rely on env for get dotnet command

Print telemetry notice anyway
This commit is contained in:
William Li 2017-04-26 12:12:25 -07:00 committed by William Lee
parent 9f8ab82a6c
commit c9295d1df7
3 changed files with 36 additions and 11 deletions

View file

@ -41,6 +41,14 @@
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False" />
<!-- Create layout: postinst -->
<Copy
DestinationFiles= "$(DebianPostinstFile)"
SourceFiles="$(DebianPostinstTemplateFile)"
OverwriteReadOnlyFiles="True"
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False" />
<!-- Create layout: Generate and Place debian_config.json -->
<ReplaceFileContents
InputFile="$(DebianConfigTemplateFile)"

View file

@ -75,6 +75,11 @@
<DebianConfigJsonFile>$(LayoutDirectory)/debian_config.json</DebianConfigJsonFile>
</PropertyGroup>
<PropertyGroup>
<DebianPostinstTemplateFile>$(RepoRoot)/packaging/deb/postinst</DebianPostinstTemplateFile>
<DebianPostinstFile>$(LayoutDirectory)/debian/postinst</DebianPostinstFile>
</PropertyGroup>
<ItemGroup>
<DebianConfigTokenValues Include="%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%">
<ReplacementString>$(SharedFxDebianPackageName)</ReplacementString>

12
packaging/deb/postinst Normal file → Executable file
View file

@ -1,3 +1,15 @@
#!/usr/bin/env sh
echo "This software may collect information about you and your use of the software, and send that to Microsoft."
echo "Please visit http://aka.ms/dotnet-cli-eula for more information."
# Run 'dotnet new' to trigger the first time experience to initialize the cache
echo "Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry."
dotnet new > /dev/null 2>&1 || true