Skip to content

Commit

Permalink
Add C++ runtime framework binaries to self-contained exe (#181)
Browse files Browse the repository at this point in the history
* add copy task

* try **

* test

* test 2

* addappx task

* show dir

* install dependency directly

* fix formatting

* show directory

* add double quotes

* remove show dir

* try again

* Revert pipeline and include binary items in build

* specify source folder

* fix /

* try without quotes

* extract appx

* test build

* fix csproj

* remove line changes
  • Loading branch information
ryfu-msft committed Sep 30, 2021
1 parent 317eda2 commit 625b734
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
16 changes: 16 additions & 0 deletions pipelines/azure-pipelines.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ jobs:
source: 'minkernel\published\internal\telemetry\TelemetryEventSource.cs'
destination: '$(workingDirectory)\WingetCreateCLI\Telemetry\'

# Copies binary dependencies from VCLibs package to be included in standalone exe
- task: PowerShell@2
displayName: Download VCLibs package
inputs:
targetType: 'inline'
script: |
iwr https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
- task: ExtractFiles@1
displayName: Extract files from VCLibs appx
inputs:
archiveFilePatterns: 'Microsoft.VCLibs.x64.14.00.Desktop.appx'
destinationFolder: '$(workingDirectory)\WingetCreateCLI'
cleanDestinationFolder: false
overwriteExistingFiles: false

# NuGetCommand task, but since there are two duplicate tasks by this name in the org, must refer to it by GUID
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: Restore Packages
Expand Down
14 changes: 13 additions & 1 deletion src/WingetCreateCLI/WingetCreateCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
</ItemGroup>

<!--Include VCLib binary dependencies-->
<ItemGroup Condition="'$(SelfContained)' == true">
<None Update="msvcp140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="vcruntime140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="vcruntime140_1.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<SettingSchema Include="$(ProjectDir)\Schemas\settings.schema.0.1.json" ModelName="Settings" />
Expand All @@ -100,5 +113,4 @@
<SdkToolsPathMaybeWithx64Architecture>$(TargetFrameworkSDKToolsDirectory)$(PlatformTarget)\</SdkToolsPathMaybeWithx64Architecture>
</PropertyGroup>
</Target>

</Project>

0 comments on commit 625b734

Please sign in to comment.