From 36715fbaf308188f7122f4abcd9911e00d46ae81 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Fri, 8 Nov 2024 13:42:01 -0800 Subject: [PATCH 1/9] DevCheck -CheckDependencies exitcode. Fix depednencies --- ...ndowsAppRuntime_UniversalBGTaskDLL.vcxproj | 26 ++++++++----------- .../packages.config | 7 +++-- eng/Version.Dependencies.props | 1 + eng/Version.Dependencies.xml | 1 + tools/DevCheck/DevCheck.ps1 | 2 ++ 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj index b8203d6a99..955f88045c 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj @@ -1,8 +1,7 @@ - - - + + true true @@ -147,21 +146,18 @@ - - - - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - + + + + + - \ No newline at end of file + diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config b/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config index df5f654653..ae178ef5df 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config @@ -1,7 +1,6 @@ - + - + - - \ No newline at end of file + diff --git a/eng/Version.Dependencies.props b/eng/Version.Dependencies.props index b5789e71cf..c6fb91f9fc 100644 --- a/eng/Version.Dependencies.props +++ b/eng/Version.Dependencies.props @@ -25,5 +25,6 @@ $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.WindowsAppSDK.Protobuf"\s+Version="(.*?)"').Groups[1].Value) $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.Windows.CppWinRT"\s+Version="(.*?)"').Groups[1].Value) $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.Windows.ImplementationLibrary"\s+Version="(.*?)"').Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.Windows.SDK.BuildTools"\s+Version="(.*?)"').Groups[1].Value) diff --git a/eng/Version.Dependencies.xml b/eng/Version.Dependencies.xml index 2b871b0695..9639526ffc 100644 --- a/eng/Version.Dependencies.xml +++ b/eng/Version.Dependencies.xml @@ -33,5 +33,6 @@ + diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index e3b0010f8b..7bfcef05cd 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -1709,9 +1709,11 @@ if (($RemoveAll -ne $false) -Or ($RemoveTestPfx -ne $false)) if ($global:issues -eq 0) { Write-Output "Coding time!" + Exit 0 } else { $n = $global:issues Write-Output "$n issue(s) detected" + Exit 1 } From 50a42df6776d219833f89429dceec76ab89d5ded Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Fri, 8 Nov 2024 14:20:35 -0800 Subject: [PATCH 2/9] Added Windows Platform SDK 10.0.26100 --- docs/Coding-Guidelines/GettingStarted.md | 1 + docs/Coding-Guidelines/VisualStudio2022.vsconfig | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Coding-Guidelines/GettingStarted.md b/docs/Coding-Guidelines/GettingStarted.md index b5b5aa15cf..a0ec95b5cd 100644 --- a/docs/Coding-Guidelines/GettingStarted.md +++ b/docs/Coding-Guidelines/GettingStarted.md @@ -52,6 +52,7 @@ or via the browser: * Windows 10 SDK (10.0.20348.0) * Windows 10 SDK (10.0.22000.0) * Windows 10 SDK (10.0.22621.0) + * Windows 10 SDK (10.0.26100.0) * Windows Universal C Runtime * and more! See [VisualStudio2022.vsconfig](https://github.com/microsoft/WindowsAppSDK/blob/develop/docs/Coding-Guidelines/VisualStudio2022.vsconfig) for the complete list diff --git a/docs/Coding-Guidelines/VisualStudio2022.vsconfig b/docs/Coding-Guidelines/VisualStudio2022.vsconfig index 9992a03d1d..77386b14e8 100644 --- a/docs/Coding-Guidelines/VisualStudio2022.vsconfig +++ b/docs/Coding-Guidelines/VisualStudio2022.vsconfig @@ -41,7 +41,6 @@ "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "Microsoft.VisualStudio.Component.Graphics.Tools", "Microsoft.VisualStudio.Component.VC.DiagnosticTools", - "Microsoft.VisualStudio.Component.Windows10SDK.19041", "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", "Microsoft.ComponentGroup.Blend", "Microsoft.VisualStudio.Component.DotNetModelBuilder", @@ -57,7 +56,9 @@ "Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest", "Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest", "Microsoft.VisualStudio.Component.VC.ASAN", + "Microsoft.VisualStudio.Component.Windows11SDK.26100", "Microsoft.VisualStudio.Component.Windows11SDK.22000", + "Microsoft.VisualStudio.Component.Windows10SDK.19041", "Microsoft.VisualStudio.Component.Windows10SDK.18362", "Microsoft.VisualStudio.Component.VC.Tools.ARM64EC", "Microsoft.VisualStudio.Workload.NativeDesktop", From a5bbbf6d28d4267b261ef23fc0b12a0177ddc2dd Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Fri, 8 Nov 2024 14:21:37 -0800 Subject: [PATCH 3/9] Add DevCheck test for Windows Platform SDK 1.0.026100.0 --- tools/DevCheck/DevCheck.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index 7bfcef05cd..028fc55f11 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -1617,7 +1617,7 @@ if (($CheckAll -ne $false) -Or ($CheckVisualStudio -ne $false)) $null = Test-VisualStudioComponents } $null = Test-WindowsSDKInstall '10.0.17763.0' [uri]'https://go.microsoft.com/fwlink/p/?LinkID=2033908' - #TODO Uncomment to require new SDK: $null = Test-WindowsSDKInstall '10.0.26100.0' [uri]'https://go.microsoft.com/fwlink/?linkid=2272610' + $null = Test-WindowsSDKInstall '10.0.26100.0' [uri]'https://go.microsoft.com/fwlink/?linkid=2272610' } if (($CheckAll -ne $false) -Or ($CheckTestPfx -ne $false)) From bf7f2a8d7e9b9cb6fb080da5e165b6d9d6cf19e3 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Mon, 11 Nov 2024 21:13:15 -0800 Subject: [PATCH 4/9] Removed WindowsAppRuntime_UniversalBGTaskDLL's dependency on Microsoft.Windows.SDK.BuildTools. The tools are already present in the Windows Platform SDK so there shouldn't be a need for this addition. Hopefully this is the root problem behind the build failures --- .../WindowsAppRuntime_UniversalBGTaskDLL.vcxproj | 4 ---- dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config | 1 - eng/Version.Dependencies.props | 1 - eng/Version.Dependencies.xml | 1 - 4 files changed, 7 deletions(-) diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj index 955f88045c..58c9f1da41 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj @@ -1,6 +1,5 @@ - true @@ -147,7 +146,6 @@ - @@ -156,8 +154,6 @@ - - diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config b/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config index ae178ef5df..d9d5e64e06 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config @@ -2,5 +2,4 @@ - diff --git a/eng/Version.Dependencies.props b/eng/Version.Dependencies.props index c6fb91f9fc..b5789e71cf 100644 --- a/eng/Version.Dependencies.props +++ b/eng/Version.Dependencies.props @@ -25,6 +25,5 @@ $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.WindowsAppSDK.Protobuf"\s+Version="(.*?)"').Groups[1].Value) $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.Windows.CppWinRT"\s+Version="(.*?)"').Groups[1].Value) $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.Windows.ImplementationLibrary"\s+Version="(.*?)"').Groups[1].Value) - $([System.Text.RegularExpressions.Regex]::Match($(VersionDependenciesXml), 'Name="Microsoft.Windows.SDK.BuildTools"\s+Version="(.*?)"').Groups[1].Value) diff --git a/eng/Version.Dependencies.xml b/eng/Version.Dependencies.xml index 9639526ffc..2b871b0695 100644 --- a/eng/Version.Dependencies.xml +++ b/eng/Version.Dependencies.xml @@ -33,6 +33,5 @@ - From 9c3d936bf335d56b7166c649417fd0c682f85d12 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Tue, 12 Nov 2024 16:00:55 -0800 Subject: [PATCH 5/9] Quick'n'Dirty hack to verify theory. Actual change to come after discussing with @godlytalias --- ...ndowsAppRuntime_UniversalBGTaskDLL.vcxproj | 41 +++++++++++-------- .../pch.h | 22 +--------- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj index 58c9f1da41..7c7947d5e8 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj @@ -1,21 +1,7 @@ - - - true - true - true - {0c4405e6-029e-4363-8273-a9e1fcf057de} - Microsoft.Windows.ApplicationModel.Background.UniversalBGTask - en-US - 16.0 - false - 10.0 - 10.0 - true - true - + Debug @@ -42,6 +28,30 @@ ARM64 + + 16.0 + {0c4405e6-029e-4363-8273-a9e1fcf057de} + Microsoft.Windows.ApplicationModel.Background.UniversalBGTask + 10.0 + true + true + true + + + true + 9 + + + + DynamicLibrary v143 @@ -90,7 +100,6 @@ Use pch.h $(IntDir)pch.pch - Level4 %(AdditionalOptions) /bigobj _WINRT_DLL;%(PreprocessorDefinitions) $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/pch.h b/dev/WindowsAppRuntime_UniversalBGTaskDLL/pch.h index 5a962aa2dc..5a9e6e458a 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/pch.h +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/pch.h @@ -2,29 +2,9 @@ // Licensed under the MIT License. #pragma once -#include -#include -#include -#include -// Undefine GetCurrentTime macro to prevent -// conflict with Storyboard::GetCurrentTime -#undef GetCurrentTime +#include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include From 727ff9df435100dd2d83ebe734d819817b0f84f3 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 13 Nov 2024 13:44:40 -0800 Subject: [PATCH 6/9] Fixed Redundant WARNING: WARNING:... output --- tools/DevCheck/DevCheck.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index 028fc55f11..d01cff63c1 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -700,7 +700,7 @@ function Test-WindowsSDKInstall } elseif ($InstallWindowsSDK -eq $true) { - Write-Warning "WARNING: Windows SDK $($version) not found. Installing..." + Write-Warning "Windows SDK $($version) not found. Installing..." $null = Install-WindowsSDK $version $url } else @@ -997,12 +997,12 @@ function Test-TAEFServiceVersion if ($cmp -lt 0) { - Write-Warning "WARNING: TAEF service older than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)" + Write-Warning "TAEF service older than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)" return 'OlderVersion' } elseif ($cmp -gt 0) { - Write-Warning "WARNING: TAEF service newer than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)" + Write-Warning "TAEF service newer than the expected version (expected=$expected_taef_version, actual=$actual_taef_version)" return 'NewerVersion' } else From c01327a4cc5714810cc756b85155cde5f68999f9 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 13 Nov 2024 13:47:27 -0800 Subject: [PATCH 7/9] Updated WindowsAppRuntime_UniversalBGTaskDLL - ordering of some logic in .vcxproj, fixed explicit versions to use central versioning (eng\Version.*), removed unnecessary dependencies, removed compiler/linker settings set project wide (see Directory.Build.props), adding missing Copyright, etc. Same output (and hopefully build pipeline won't choke now) --- .../Task.cpp | 19 +++++------ .../Task.idl | 6 ++-- .../WindowsAppRuntime_UniversalBGTaskDLL.def | 3 ++ ...ndowsAppRuntime_UniversalBGTaskDLL.vcxproj | 34 ++----------------- .../packages.config | 3 +- .../readme.txt | 27 --------------- 6 files changed, 19 insertions(+), 73 deletions(-) delete mode 100644 dev/WindowsAppRuntime_UniversalBGTaskDLL/readme.txt diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.cpp b/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.cpp index 72b235117d..4a28bfe527 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.cpp +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.cpp @@ -3,9 +3,7 @@ #include "pch.h" #include "Task.h" -#if __has_include("Task.g.cpp") #include "Task.g.cpp" -#endif using namespace winrt; using namespace winrt::Windows::ApplicationModel::Background; @@ -13,17 +11,18 @@ using namespace winrt::Windows::Storage; namespace winrt::Microsoft::Windows::ApplicationModel::Background::UniversalBGTask::implementation { - inline constexpr CLSID IID_IBackgroundTask = { 2098451764, 64786, 17358, 140, 34, 234, 31, 241, 60, 6, 223 }; + inline constexpr CLSID IID_IBackgroundTask{ 2098451764, 64786, 17358, 140, 34, 234, 31, 241, 60, 6, 223 }; + void Task::Run(winrt::Windows::ApplicationModel::Background::IBackgroundTaskInstance taskInstance) { - winrt::hstring lookupStr = winrt::to_hstring(taskInstance.Task().TaskId()); - ApplicationDataContainer localSettings = ApplicationData::Current().LocalSettings(); - auto values = localSettings.Values(); - auto lookupobj = values.Lookup(lookupStr); - winrt::guid comClsId = winrt::unbox_value(lookupobj); + winrt::hstring lookupKey{ winrt::to_hstring(taskInstance.Task().TaskId()) }; + ApplicationDataContainer localSettings{ ApplicationData::Current().LocalSettings() }; + auto values{ localSettings.Values() }; + auto lookupValue{ values.Lookup(lookupKey) }; + winrt::guid comClsId{ winrt::unbox_value(lookupValue) }; - winrt::Windows::ApplicationModel::Background::IBackgroundTask bgTask = nullptr; - winrt::hresult hr = CoCreateInstance(comClsId, nullptr, CLSCTX_LOCAL_SERVER, IID_IBackgroundTask, reinterpret_cast(&bgTask)); + winrt::Windows::ApplicationModel::Background::IBackgroundTask bgTask; + winrt::hresult hr{ CoCreateInstance(comClsId, nullptr, CLSCTX_LOCAL_SERVER, IID_IBackgroundTask, reinterpret_cast(&bgTask)) }; bgTask.Run(taskInstance); } } diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.idl b/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.idl index bcc31e8c74..326df8b8e1 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.idl +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/Task.idl @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation and Contributors. // Licensed under the MIT License. - - namespace Microsoft.Windows.ApplicationModel.Background.UniversalBGTask { + [contractversion(1)] + apicontract UniversalBGTaskContract{}; + + [contract(UniversalBGTaskContract, 1)] [default_interface] runtimeclass Task : Windows.ApplicationModel.Background.IBackgroundTask { diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.def b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.def index d04a02ea81..0e3b54f49a 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.def +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.def @@ -1,3 +1,6 @@ +; Copyright (c) Microsoft Corporation. All rights reserved. +; Licensed under the MIT License. See LICENSE in the project root for license information. + EXPORTS DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj index 7c7947d5e8..2a9f953da5 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/WindowsAppRuntime_UniversalBGTaskDLL.vcxproj @@ -31,33 +31,19 @@ 16.0 {0c4405e6-029e-4363-8273-a9e1fcf057de} + Win32Proj Microsoft.Windows.ApplicationModel.Background.UniversalBGTask 10.0 true true true - - true 9 - - - DynamicLibrary v143 Unicode - false - true true @@ -99,14 +85,9 @@ Use pch.h - $(IntDir)pch.pch - %(AdditionalOptions) /bigobj - _WINRT_DLL;%(PreprocessorDefinitions) - $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) - Console - true + Windows WindowsAppRuntime_UniversalBGTaskDLL.def @@ -119,10 +100,6 @@ NDEBUG;%(PreprocessorDefinitions) - - true - true - @@ -147,15 +124,9 @@ - - - false - - - @@ -163,6 +134,5 @@ - diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config b/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config index d9d5e64e06..315eb1aca6 100644 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config +++ b/dev/WindowsAppRuntime_UniversalBGTaskDLL/packages.config @@ -1,5 +1,4 @@ - + - diff --git a/dev/WindowsAppRuntime_UniversalBGTaskDLL/readme.txt b/dev/WindowsAppRuntime_UniversalBGTaskDLL/readme.txt deleted file mode 100644 index 312359a40d..0000000000 --- a/dev/WindowsAppRuntime_UniversalBGTaskDLL/readme.txt +++ /dev/null @@ -1,27 +0,0 @@ -======================================================================== - WindowsAppRuntime_UniversalBGTaskDLL Project Overview -======================================================================== - -This project demonstrates how to get started authoring Windows Runtime -classes directly with standard C++, using the Windows App SDK and -C++/WinRT packages to generate implementation headers from interface -(IDL) files. The generated Windows Runtime component binary and WinMD -files should then be bundled with the app consuming them. - -Steps: -1. Create an interface (IDL) file to define your Windows Runtime class, - its default interface, and any other interfaces it implements. -2. Build the project once to generate module.g.cpp, module.h.cpp, and - implementation templates under the "Generated Files" folder, as - well as skeleton class definitions under "Generated Files\sources". -3. Use the skeleton class definitions for reference to implement your - Windows Runtime classes. - -======================================================================== -Learn more about Windows App SDK here: -https://docs.microsoft.com/windows/apps/windows-app-sdk/ -Learn more about WinUI3 here: -https://docs.microsoft.com/windows/apps/winui/winui3/ -Learn more about C++/WinRT here: -http://aka.ms/cppwinrt/ -======================================================================== From d77e584d2a92c3104db880ff5cf04134462264e7 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 13 Nov 2024 14:17:02 -0800 Subject: [PATCH 8/9] Fixed bug in issue counting math (issue found but fixed = 1 issue but should be 0) --- tools/DevCheck/DevCheck.ps1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index d01cff63c1..d15d189cb1 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -163,6 +163,7 @@ Set-StrictMode -Version 3.0 $ErrorActionPreference = "Stop" $global:issues = 0 +$global:issues_test_certificate_thumbprint_not_found = 0 $global:isadmin = $null @@ -171,6 +172,11 @@ $global:vswhere_url = '' $global:dependency_paths = ('dev', 'test', 'installer', 'tools') +function Get-Issues +{ + return $global:issues + $global:issues_test_certificate_thumbprint_not_found +} + function Get-SettingsFile { if ([string]::IsNullOrEmpty($SettingsFile)) @@ -723,7 +729,7 @@ function Test-DevTestPfx if (-not(Test-Path -Path $pfx_thumbprint -PathType Leaf)) { Write-Host "Test certificate thumbprint $pfx_thumbprint...Not Found" - $global:issues++ + $global:issues_test_certificate_thumbprint_not_found = 1 return $false } @@ -1706,14 +1712,15 @@ if (($RemoveAll -ne $false) -Or ($RemoveTestPfx -ne $false)) $null = Remove-DevTestPfx } -if ($global:issues -eq 0) +$issues_count = Get-Issues +if ($issues_count -eq 0) { Write-Output "Coding time!" Exit 0 } else { - $n = $global:issues + $n = $issues_count Write-Output "$n issue(s) detected" Exit 1 } From 27029d19e592ac13bfbe65ac7e8cd8b790f5a8d0 Mon Sep 17 00:00:00 2001 From: Howard Kapustein Date: Wed, 13 Nov 2024 16:39:30 -0800 Subject: [PATCH 9/9] Fixed typo --- tools/DevCheck/DevCheck.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/DevCheck/DevCheck.ps1 b/tools/DevCheck/DevCheck.ps1 index d15d189cb1..2eaa74545a 100644 --- a/tools/DevCheck/DevCheck.ps1 +++ b/tools/DevCheck/DevCheck.ps1 @@ -847,7 +847,7 @@ function Repair-DevTestPfx $pfx = Join-Path $user 'winappsdk.certificate.test.pfx' $export_pfx = Export-PfxCertificate -Cert $cert_personal -FilePath $pfx -Password $password - # Delete the personal certiicate + # Delete the personal certificate Remove-Item -Path $cert_personal -DeleteKey $ok = $true