AppxPackage.ps1 1003 B

123456789101112131415161718192021222324252627282930313233343536
  1. $ErrorActionPreference = 'Stop'
  2. $env:Path += ";${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.19041.0\x64"
  3. $mapping = "RoslynPad.mapping"
  4. Remove-Item $mapping -ErrorAction Ignore
  5. Remove-Item RoslynPad.appx -ErrorAction Ignore
  6. Remove-Item *.pri
  7. $location = Get-Location
  8. dotnet publish "$PSScriptRoot\..\src\RoslynPad" -c Release --self-contained -r win-x64 -p:UpdateAppSettings=true
  9. . .\GetFiles.ps1 -Published
  10. "[Files]" >> $mapping
  11. ('"' + $location + '\PackageRoot\AppxManifest.xml" "AppxManifest.xml"') >> $mapping
  12. foreach ($asset in Get-ChildItem PackageRoot\Assets) {
  13. ('"' + $asset.FullName + '" "Assets\' + $asset.Name + '"') >> $mapping
  14. }
  15. foreach ($file in $files) {
  16. ('"' + $file + '" "' + $file.Substring($rootPath.Length) + '"') >> $mapping
  17. $file
  18. }
  19. & makepri.exe new /pr PackageRoot /cf priconfig.xml
  20. foreach ($file in Get-ChildItem *.pri) {
  21. ('"' + $file + '" "' + $file.BaseName + '.pri"') >> $mapping
  22. $file
  23. }
  24. MakeAppx.exe pack /f $mapping /l /p RoslynPad.appx
  25. ./SignAppx.ps1