diff --git a/.pipelines/UpdateVersions.ps1 b/.pipelines/UpdateVersions.ps1 index c19dfb5dec..a1bc5bef9a 100644 --- a/.pipelines/UpdateVersions.ps1 +++ b/.pipelines/UpdateVersions.ps1 @@ -1,16 +1,24 @@ Param( - # Using the default value of 1.6 for winAppSdkVersionNumber and useExperimentalVersion as false + # Using the default value of 1.7 for winAppSdkVersionNumber and useExperimentalVersion as false [Parameter(Mandatory=$False,Position=1)] - [string]$winAppSdkVersionNumber = "1.6", + [string]$winAppSdkVersionNumber = "1.7", # When the pipeline calls the PS1 file, the passed parameters are converted to string type [Parameter(Mandatory=$False,Position=2)] - [boolean]$useExperimentalVersion = $False + [boolean]$useExperimentalVersion = $False, + + # Root folder Path for processing + [Parameter(Mandatory=$False,Position=3)] + [string]$rootPath = $(Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)), + + # Root folder Path for processing + [Parameter(Mandatory=$False,Position=4)] + [string]$sourceLink = "https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json" ) function Update-NugetConfig { param ( - [string]$filePath = "nuget.config" + [string]$filePath = [System.IO.Path]::Combine($rootPath, "nuget.config") ) Write-Host "Updating nuget.config file" @@ -35,7 +43,33 @@ function Update-NugetConfig { $xml.Save($filePath) } -$sourceLink = "https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json" +function Read-FileWithEncoding { + param ( + [string]$Path + ) + + $reader = New-Object System.IO.StreamReader($Path, $true) # auto-detect encoding + $content = $reader.ReadToEnd() + $encoding = $reader.CurrentEncoding + $reader.Close() + + return [PSCustomObject]@{ + Content = $content + Encoding = $encoding + } +} + +function Write-FileWithEncoding { + param ( + [string]$Path, + [string]$Content, + [System.Text.Encoding]$Encoding + ) + + $writer = New-Object System.IO.StreamWriter($Path, $false, $Encoding) + $writer.Write($Content) + $writer.Close() +} # Execute nuget list and capture the output if ($useExperimentalVersion) { @@ -79,50 +113,54 @@ if ($latestVersion) { } # Update packages.config files -Get-ChildItem -Recurse packages.config | ForEach-Object { - $content = Get-Content $_.FullName -Raw +Get-ChildItem -Path $rootPath -Recurse packages.config | ForEach-Object { + $file = Read-FileWithEncoding -Path $_.FullName + $content = $file.Content if ($content -match 'package id="Microsoft.WindowsAppSDK"') { $newVersionString = 'package id="Microsoft.WindowsAppSDK" version="' + $WinAppSDKVersion + '"' $oldVersionString = 'package id="Microsoft.WindowsAppSDK" version="[-.0-9a-zA-Z]*"' $content = $content -replace $oldVersionString, $newVersionString - Set-Content -Path $_.FullName -Value $content + Write-FileWithEncoding -Path $_.FullName -Content $content -Encoding $file.encoding Write-Host "Modified " $_.FullName } } # Update Directory.Packages.props file -$propsFile = "Directory.Packages.props" +$propsFile = [System.IO.Path]::Combine($rootPath,"Directory.Packages.props") if (Test-Path $propsFile) { - $content = Get-Content $propsFile -Raw + $file = Read-FileWithEncoding -Path $propsFile + $content = $file.Content if ($content -match '' $oldVersionString = '' $content = $content -replace $oldVersionString, $newVersionString - Set-Content -Path $propsFile -Value $content + Write-FileWithEncoding -Path $propsFile -Content $content -Encoding $file.encoding Write-Host "Modified " $propsFile } } # Update .vcxproj files -Get-ChildItem -Recurse *.vcxproj | ForEach-Object { - $content = Get-Content $_.FullName -Raw +Get-ChildItem -Path $rootPath -Recurse *.vcxproj | ForEach-Object { + $file = Read-FileWithEncoding -Path $_.FullName + $content = $file.Content if ($content -match '\\Microsoft.WindowsAppSDK.') { $newVersionString = '\Microsoft.WindowsAppSDK.' + $WinAppSDKVersion + '\' $oldVersionString = '\\Microsoft.WindowsAppSDK.[-.0-9a-zA-Z]*\\' $content = $content -replace $oldVersionString, $newVersionString - Set-Content -Path $_.FullName -Value $content + Write-FileWithEncoding -Path $_.FullName -Content $content -Encoding $file.encoding Write-Host "Modified " $_.FullName } } # Update .csproj files -Get-ChildItem -Recurse *.csproj | ForEach-Object { - $content = Get-Content $_.FullName -Raw +Get-ChildItem -Path $rootPath -Recurse *.csproj | ForEach-Object { + $file = Read-FileWithEncoding -Path $_.FullName + $content = $file.Content if ($content -match 'PackageReference Include="Microsoft.WindowsAppSDK"') { $newVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="'+ $WinAppSDKVersion + '"' $oldVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="[-.0-9a-zA-Z]*"' $content = $content -replace $oldVersionString, $newVersionString - Set-Content -Path $_.FullName -Value $content + Write-FileWithEncoding -Path $_.FullName -Content $content -Encoding $file.encoding Write-Host "Modified " $_.FullName } } diff --git a/.pipelines/v2/ci-using-the-latest-winappsdk.yml b/.pipelines/v2/ci-using-the-latest-winappsdk.yml index cc9f00f80d..3d628b13a9 100644 --- a/.pipelines/v2/ci-using-the-latest-winappsdk.yml +++ b/.pipelines/v2/ci-using-the-latest-winappsdk.yml @@ -33,7 +33,7 @@ parameters: default: true - name: winAppSDKVersionNumber type: string - default: 1.6 + default: 1.7 - name: useExperimentalVersion type: boolean default: false diff --git a/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml b/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml index 1fccd6de74..9c59312844 100644 --- a/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml +++ b/.pipelines/v2/templates/steps-update-winappsdk-and-restore-nuget.yml @@ -17,6 +17,7 @@ steps: arguments: > -winAppSdkVersionNumber ${{ parameters.versionNumber }} -useExperimentalVersion $${{ parameters.useExperimentalVersion }} + -rootPath "$(build.sourcesdirectory)" - script: echo $(WinAppSDKVersion) displayName: 'Display WinAppSDK Version Found' diff --git a/Directory.Packages.props b/Directory.Packages.props index 0d8879746d..b3b404ea51 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -55,7 +55,7 @@ --> - + diff --git a/NOTICE.md b/NOTICE.md index edf8e75c51..d604be7d7f 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -1472,7 +1472,7 @@ SOFTWARE. - Microsoft.Windows.CsWin32 0.2.46-beta - Microsoft.Windows.CsWinRT 2.2.0 - Microsoft.Windows.SDK.BuildTools 10.0.22621.2428 -- Microsoft.WindowsAppSDK 1.6.250205002 +- Microsoft.WindowsAppSDK 1.7.250401001 - Microsoft.WindowsPackageManager.ComInterop 1.10.340 - Microsoft.Xaml.Behaviors.WinUI.Managed 2.0.9 - Microsoft.Xaml.Behaviors.Wpf 1.1.39 diff --git a/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj b/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj index 86d258854f..f0b12187ad 100644 --- a/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj +++ b/src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj @@ -1,6 +1,6 @@  - + @@ -141,7 +141,7 @@ - + @@ -153,7 +153,7 @@ - - + + \ No newline at end of file diff --git a/src/modules/MeasureTool/MeasureToolCore/packages.config b/src/modules/MeasureTool/MeasureToolCore/packages.config index 61ff4b9f07..996736442d 100644 --- a/src/modules/MeasureTool/MeasureToolCore/packages.config +++ b/src/modules/MeasureTool/MeasureToolCore/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props index 782ec68bf5..18f07f5f10 100644 --- a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props +++ b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props @@ -9,7 +9,7 @@ - + diff --git a/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj b/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj index 039bf41817..69e3c64635 100644 --- a/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj +++ b/src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj @@ -3,7 +3,7 @@ ..\..\..\..\ - $(PathToRoot)packages\Microsoft.WindowsAppSDK.1.6.250205002 + $(PathToRoot)packages\Microsoft.WindowsAppSDK.1.7.250401001 diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/Microsoft.CommandPalette.Extensions.vcxproj b/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/Microsoft.CommandPalette.Extensions.vcxproj index 1090e58f25..0f87df5625 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/Microsoft.CommandPalette.Extensions.vcxproj +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/Microsoft.CommandPalette.Extensions.vcxproj @@ -2,7 +2,7 @@ ..\..\..\..\..\ - $(PathToRoot)packages\Microsoft.WindowsAppSDK.1.6.250205002 + $(PathToRoot)packages\Microsoft.WindowsAppSDK.1.7.250401001 $(PathToRoot)packages\Microsoft.Windows.CppWinRT.2.0.240111.5 $(PathToRoot)packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428 $(PathToRoot)packages\Microsoft.Web.WebView2.1.0.2903.40 diff --git a/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/packages.config b/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/packages.config index 93d095a2b1..608661db25 100644 --- a/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/packages.config +++ b/src/modules/cmdpal/extensionsdk/Microsoft.CommandPalette.Extensions/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj b/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj index 40bbb7a682..806da3904b 100644 --- a/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj +++ b/src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj @@ -1,6 +1,6 @@  - + @@ -207,7 +207,7 @@ - + @@ -221,8 +221,8 @@ - - + + diff --git a/src/modules/powerrename/PowerRenameUILib/packages.config b/src/modules/powerrename/PowerRenameUILib/packages.config index c8aa0dc6df..77b75fad7e 100644 --- a/src/modules/powerrename/PowerRenameUILib/packages.config +++ b/src/modules/powerrename/PowerRenameUILib/packages.config @@ -6,5 +6,5 @@ - + \ No newline at end of file