PowerToys/.pipelines/versionAndSignCheck.ps1

64 lines
1.8 KiB
PowerShell
Raw Normal View History

[CmdletBinding()]
# todo: send in arch / conf, could send in actual path
Param(
[Parameter(Mandatory=$True,Position=1)]
[AllowEmptyString()]
[string]$targetDir = $PSScriptRoot + '/../extractedMsi/File'
)
$DirPath = $targetDir; #this file is in pipeline, we need root.
Preview Handler for developer files (#15138) * Create Readme.md * Update Readme.md * Rebased to master * started integrating * Resolve merge conflict * Fixed merge conflict * Edited expect.txt * Tried implementig interfaces * Push * Push * push * push * Deleted no longer used files * push * push * Thanks @jaimecbernando for helping * can load via url * getting stuff semi stubbed out * full render without passing vars * making sure we clearly label the file was us * push * push * push (does not work) * Push * push * Added file size limit of 3 Kilobyte in standalone App (MoncaoPreview) * Added monacosrc to excludes.txt (spell checker) * Fixed XAMLHost loading issue and changed namespace of Settings.cs * push * Restructred some code in MonacoPreviewHandler (not functional) * MonacoPreview changes: Added maximal file size and error message as values in Settings.cs Increased maxFileSize to 10 KB Renamed variables and formed code according to style guidelines Added many comments Deleted usused code Added unimplemented(?) NavigationStarted method to prevent navigation in WebView Fixed scrollbar issues (Not beautiful, but still better) Removed never seen laoding window Added some debug information as well as some Exceptions. MonacoPreviewHandler Changes: Changed order of code executions (still not usable) * Push * Push * Push * push * Oh my god, it works * Added loading screen and resize * Added some comments, changed variable names and integrated some stuff from MonacoPreview to MonacoPreviewHandler; * Monaco Preview Handler: * Removed accessibilityhelpurl * Made background of loading screen like theme selected * dev tools open now in Debug mode automatically * Fixed error message for too big file size * push * Fixed a tiny bug * Updated a NuGet Pasckage * Removed some to-do points in FileHandler.cs and added them to #14957 * Removed some to-do points in FileHandler.cs and added them to #14957. Supressed a warning and styled a function better in PrebiewHandlerCommon * Fixed 2 comment typos and a font that didn't load. (Sadly his required enable CORS again :( ) * Removed old standalone project * Removed old unused files & rebase to master #1 * Deleted everything from the monaco source code expect the minified version * Push * Added summary of all functions. Restructred/simplified/clarified some code. * Added resources * Update bug_report.yml * Update translation_issue.yml * Update expect.txt * Update ProofOfConcept/MonacoPreview/monacoPreviewHandler/index.html Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * Update ProofOfConcept/MonacoPreview/monacoPreviewHandler/MonacoPreviewHandlerControl.cs Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * Update ProofOfConcept/MonacoPreview/monacoPreviewHandler/Resources.resx Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * Added some additional file types * Added additional file types * Moved to a json file for the available languages and some other changes * Added error message when WebView2 is not installed * Remoing throw error * Update expect.txt * Update excludes.txt * Update excludes.txt * Integrate Monaco preview handler into PowerToys * Update excludes.txt * Ignore .svg extension * Update signing list * Update signing list #2 * Changed monaco string * fix * Fixed wrong JSON field and changed date of Copyright * Added check if WebView is installed * Added error when webview2 is not installed * Increased file size limit to 50kb * Added new file generator for languages.json * Remove unvisible symbol at the beggining of the file * Regenerate resx file * Update MonacoPreviewHandler.csproj * tweaking script to ignore 1.0 check on theme dll * Update src/modules/previewpane/MonacoPreviewHandler/Properties/Resources.resx Co-authored-by: Franky Chen <franky920920+gpg@gmail.com> * Update src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandlerControl.cs Co-authored-by: Franky Chen <franky920920+gpg@gmail.com> * Update src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandlerControl.cs Co-authored-by: Franky Chen <franky920920+gpg@gmail.com> * Update src/settings-ui/Settings.UI/Strings/en-us/Resources.resw Co-authored-by: Franky Chen <franky920920+gpg@gmail.com> * Update excludes.txt * Update src/modules/previewpane/powerpreview/Resources.resx Co-authored-by: Franky Chen <franky920920+gpg@gmail.com> * Check and install WebView2 if needed * Run spellcheck script * Update ESRPSigning_core.json adding font * Update versionAndSignCheck.ps1 adding fonts to verify * Adding in Monaco usage * Update NOTICE.md * Update ESRPSigning_core.json * expect.txt update * Use Common.UI/ThemeManager.cs * No user facing strings should reference Monaco * Fix build error * monaco devdocs (#15691) * Create update-monaco-editor.md * Update and rename update-monaco-editor.md to readme.md * Update doc/devdocs/modules/powerpreview/monaco/readme.md Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com> * Update doc/devdocs/modules/powerpreview/monaco/readme.md Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com> * Update doc/devdocs/modules/powerpreview/monaco/readme.md Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com> * Update readme.md * Update readme.md Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com> * Fix WebView installer condition * Using system.text.json * Update ESRPSigning_core.json * Remove Newtonsoft.Json.dll from installer * Revert "WinUI bump (#15707)" This reverts commit b6a207c4b69b797dc5589aebbe162ef1f95fe83f. * Revert "Update Settings.UI.csproj (#15704)" This reverts commit 1a25dacc735621dc62a060fd8e6f52c86a1013cc. Co-authored-by: Clint Rutkas <clint@rutkas.com> Co-authored-by: Aaron Junker <aaron.junker@sus.schulen-stadtsh.ch> Co-authored-by: Clint Rutkas <crutkas@microsoft.com> Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Stefan Markovic <stefan@janeasystems.com> Co-authored-by: Franky Chen <franky920920+gpg@gmail.com> Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
2022-01-26 04:02:10 +08:00
$items = Get-ChildItem -Path $DirPath -File -Include *.exe,*.dll,*.ttf -Recurse -Force -ErrorAction SilentlyContinue
$totalFailure = 0;
Write-Host $DirPath;
if(-not (Test-Path $DirPath))
{
Write-Host "Folder does not exist!"
}
Write-Host "Total items: " $items.Count
if($items.Count -eq 0)
{
# no items means something bad happened. We should fail ASAP
exit 1;
}
$items | ForEach-Object {
if($_.VersionInfo.FileVersion -eq "1.0.0.0" )
{
[settings-ui] Settings WinUI3 (#17797) * Add Settings.WinUI3 project * New namespace * Activation and Services * Assets and Behaviors * Converters and Helpers * Controls * View and ViewModels * Styles and Themes * OOBE * Strings * Small App moves * [check] Project files - publish profiles and launchSettings.json * [using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name workaround * [WIP] Workarounds to make it work * Fix suppressed warnings - naming * Add code analysis * Fix KBMPage and App dispatcher Fix MessageBox - replace with MessageDialog * Fix ImageResizerPage & mark ColorPickerButton with TODO * Add icon to windows Cleanup MainWindow.xaml.cs and OobeWindow.xaml.cs MainWindows and OobeWindow management * App Icon No framework and runtime subdirs * Remove PowerToys.Settings and Settings.UI from solution Update output paths * Installer work & publish.cmd * Fix dispatcher crashes * Fix crashes * Add all dlls to installer Cleanup installer Add OpenOOBE and OpenScoobe logic Fix minor issues Fix update scenario - REINSTALLMODE * Rename back namespaces, project name and project dir * [wip] move to winappsdk 1.1 * Fix propagating isElevated & installer runtimes dlls * Remove obsolete dir/file * PowerToys.Interop to netstandard2.0 * Move everything to .Net6 * [Settings] Always launch settings process non-elevated (#17791) * Move back to WinAppSdk 1.0.1 * Add Settings.WinUI3 project * New namespace * Activation and Services * Assets and Behaviors * Converters and Helpers * Controls * View and ViewModels * Styles and Themes * OOBE * Strings * Small App moves * [check] Project files - publish profiles and launchSettings.json * [using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name workaround * [WIP] Workarounds to make it work * Fix suppressed warnings - naming * Add code analysis * Fix KBMPage and App dispatcher Fix MessageBox - replace with MessageDialog * Fix ImageResizerPage & mark ColorPickerButton with TODO * Add icon to windows Cleanup MainWindow.xaml.cs and OobeWindow.xaml.cs MainWindows and OobeWindow management * App Icon No framework and runtime subdirs * Remove PowerToys.Settings and Settings.UI from solution Update output paths * Installer work & publish.cmd * Fix dispatcher crashes * Fix crashes * Add all dlls to installer Cleanup installer Add OpenOOBE and OpenScoobe logic Fix minor issues Fix update scenario - REINSTALLMODE * Rename back namespaces, project name and project dir * [wip] move to winappsdk 1.1 * Fix propagating isElevated & installer runtimes dlls * Remove obsolete dir/file * PowerToys.Interop to netstandard2.0 * Move everything to .Net6 * [Settings] Always launch settings process non-elevated (#17791) * Move back to WinAppSdk 1.0.1 * Revert merge conflict ARM64 removal * Fix KBM Browse overlay image button * Bring back settings publish profile * Update release.yml * Change target frameworkd windows version * [Setup] Add Windows Application Runtime SDK (#17809) * Update requirements doc * Update compiling docs * Fix signing * Fix Settings exe and dll versions * Add exception for dlls that have version 1.0.0.0 * Fix powershell condition Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
2022-04-20 04:00:28 +08:00
# These items are exceptions that actually have the 1.0.0.0 version.
if ((-not $_.Name.EndsWith("Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Windows.ApplicationModel.Resources.Projection.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Windows.AppLifecycle.Projection.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Windows.System.Power.Projection.dll")) -and
(-not $_.Name.EndsWith("Microsoft.WindowsAppRuntime.Bootstrap.Net.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Xaml.Interactions.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Xaml.Interactivity.dll")) -and
(-not $_.Name.EndsWith("Microsoft.WindowsAppRuntime.Release.Net.dll"))
[settings-ui] Settings WinUI3 (#17797) * Add Settings.WinUI3 project * New namespace * Activation and Services * Assets and Behaviors * Converters and Helpers * Controls * View and ViewModels * Styles and Themes * OOBE * Strings * Small App moves * [check] Project files - publish profiles and launchSettings.json * [using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name workaround * [WIP] Workarounds to make it work * Fix suppressed warnings - naming * Add code analysis * Fix KBMPage and App dispatcher Fix MessageBox - replace with MessageDialog * Fix ImageResizerPage & mark ColorPickerButton with TODO * Add icon to windows Cleanup MainWindow.xaml.cs and OobeWindow.xaml.cs MainWindows and OobeWindow management * App Icon No framework and runtime subdirs * Remove PowerToys.Settings and Settings.UI from solution Update output paths * Installer work & publish.cmd * Fix dispatcher crashes * Fix crashes * Add all dlls to installer Cleanup installer Add OpenOOBE and OpenScoobe logic Fix minor issues Fix update scenario - REINSTALLMODE * Rename back namespaces, project name and project dir * [wip] move to winappsdk 1.1 * Fix propagating isElevated & installer runtimes dlls * Remove obsolete dir/file * PowerToys.Interop to netstandard2.0 * Move everything to .Net6 * [Settings] Always launch settings process non-elevated (#17791) * Move back to WinAppSdk 1.0.1 * Add Settings.WinUI3 project * New namespace * Activation and Services * Assets and Behaviors * Converters and Helpers * Controls * View and ViewModels * Styles and Themes * OOBE * Strings * Small App moves * [check] Project files - publish profiles and launchSettings.json * [using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name workaround * [WIP] Workarounds to make it work * Fix suppressed warnings - naming * Add code analysis * Fix KBMPage and App dispatcher Fix MessageBox - replace with MessageDialog * Fix ImageResizerPage & mark ColorPickerButton with TODO * Add icon to windows Cleanup MainWindow.xaml.cs and OobeWindow.xaml.cs MainWindows and OobeWindow management * App Icon No framework and runtime subdirs * Remove PowerToys.Settings and Settings.UI from solution Update output paths * Installer work & publish.cmd * Fix dispatcher crashes * Fix crashes * Add all dlls to installer Cleanup installer Add OpenOOBE and OpenScoobe logic Fix minor issues Fix update scenario - REINSTALLMODE * Rename back namespaces, project name and project dir * [wip] move to winappsdk 1.1 * Fix propagating isElevated & installer runtimes dlls * Remove obsolete dir/file * PowerToys.Interop to netstandard2.0 * Move everything to .Net6 * [Settings] Always launch settings process non-elevated (#17791) * Move back to WinAppSdk 1.0.1 * Revert merge conflict ARM64 removal * Fix KBM Browse overlay image button * Bring back settings publish profile * Update release.yml * Change target frameworkd windows version * [Setup] Add Windows Application Runtime SDK (#17809) * Update requirements doc * Update compiling docs * Fix signing * Fix Settings exe and dll versions * Add exception for dlls that have version 1.0.0.0 * Fix powershell condition Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
2022-04-20 04:00:28 +08:00
)
{
Write-Host "Version not set: " + $_.FullName
$totalFailure++;
}
}
}
$items | ForEach-Object {
$auth = Get-AuthenticodeSignature $_.FullName
if($auth.SignerCertificate -eq $null)
{
Write-Host "Not Signed: " + $_.FullName
$totalFailure++;
}
}
if($totalFailure -gt 0)
{
exit 1
}
exit 0