mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01:00
Update monaco package (#26375)
* Update monaco * Update monaco_labgzages.json * Update monaco_languages * Add script to generate MonacoSRC.wxs * Fix merge conflicts * Auto-generate MonacoSRC.wxs * Add guards when parsing json file * Change language definitions to new ones and fix context menu * Fix redunant error message * update monaco_languages.json * Remove json from custom txt extensions --------- Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -183,9 +183,9 @@ call "..\..\..\publish.cmd" arm64
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
</Target> -->
|
||||
<Target Name="BeforeBuild">
|
||||
<HeatDirectory Directory="..\..\src\modules\FileExplorerPreview\monacoSRC"
|
||||
<HeatDirectory Directory="..\..\src\common\FilePreviewCommon\monacoSRC"
|
||||
PreprocessorVariable="var.MonacoSRCHarvestPath"
|
||||
OutputFile="MonacoSRC.wxs"
|
||||
ComponentGroupName="MonacoSRCHeatGenerated"
|
||||
@@ -197,6 +197,6 @@ call "..\..\..\publish.cmd" arm64
|
||||
SuppressFragments="false"
|
||||
SuppressRegistry="false"
|
||||
SuppressRootDirectory="true"/>
|
||||
</Target> -->
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
70
installer/PowerToysSetup/generateMonacoWxs.ps1
Normal file
70
installer/PowerToysSetup/generateMonacoWxs.ps1
Normal file
@@ -0,0 +1,70 @@
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[Parameter(Mandatory = $True, Position = 1)]
|
||||
[string]$monacoWxsFile
|
||||
)
|
||||
|
||||
$fileWxs = Get-Content $monacoWxsFile;
|
||||
|
||||
$fileWxs = $fileWxs -replace " KeyPath=`"yes`" ", " "
|
||||
|
||||
$newFileContent = ""
|
||||
|
||||
$componentId = "error"
|
||||
$directories = @()
|
||||
|
||||
$fileWxs | ForEach-Object {
|
||||
$line = $_;
|
||||
if ($line -match "<Wix xmlns=`".*`">") {
|
||||
$line +=
|
||||
@"
|
||||
`r`n
|
||||
<?include `$(sys.CURRENTDIR)\Common.wxi?>`r`n
|
||||
"@
|
||||
}
|
||||
if ($line -match "<Component Id=`"(.*)`" Directory") {
|
||||
$componentId = $matches[1]
|
||||
}
|
||||
if ($line -match "<Directory Id=`"(.*)`" Name=`".*`" />") {
|
||||
$directories += $matches[1]
|
||||
}
|
||||
if ($line -match "</Component>") {
|
||||
$line =
|
||||
@"
|
||||
<RegistryKey Root="`$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="$($componentId)" Value="" KeyPath="yes"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
"@
|
||||
}
|
||||
|
||||
$newFileContent += $line + "`r`n";
|
||||
}
|
||||
|
||||
$removeFolderEntries =
|
||||
@"
|
||||
`r`n <Component Id="RemoveMonacoSRCFolders" Guid="$((New-Guid).ToString().ToUpper())" Directory="FileExplorerPreviewInstallFolder" >
|
||||
<RegistryKey Root="`$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="RemoveMonacoSRCFolders" Value="" KeyPath="yes"/>
|
||||
</RegistryKey>`r`n
|
||||
"@
|
||||
|
||||
$directories | ForEach-Object {
|
||||
|
||||
$removeFolderEntries +=
|
||||
@"
|
||||
<RemoveFolder Id="Remove$($_)" Directory="$($_)" On="uninstall"/>
|
||||
|
||||
"@
|
||||
}
|
||||
|
||||
$removeFolderEntries +=
|
||||
@"
|
||||
</Component>
|
||||
"@
|
||||
|
||||
|
||||
|
||||
$newFileContent = $newFileContent -replace "\s+(</ComponentGroup>)", "$removeFolderEntries`r`n </ComponentGroup>"
|
||||
|
||||
Set-Content -Path $monacoWxsFile -Value $newFileContent
|
||||
@@ -75,6 +75,7 @@
|
||||
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Tools.wxs"" ""$(ProjectDir)..\PowerToysSetup\Tools.wxs.bk""""
|
||||
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\VideoConference.wxs"" ""$(ProjectDir)..\PowerToysSetup\VideoConference.wxs.bk""""
|
||||
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs"" ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs.bk""""
|
||||
call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetup\generateMonacoWxs.ps1 -monacoWxsFile "$(ProjectDir)..\PowerToysSetup\MonacoSRC.wxs"
|
||||
call powershell.exe -NonInteractive -executionpolicy Unrestricted -File parseRuntimes.ps1 -runtimedepsjsonpath "$(ProjectDir)..\..\$(Platform)\$(Configuration)\Settings\PowerToys.Settings.deps.json" -wpfdepsjsonpath "$(ProjectDir)..\..\$(Platform)\$(Configuration)\modules\ColorPicker\PowerToys.ColorPickerUI.deps.json" -depsfileslistspath "$(ProjectDir)DepsFilesLists.h" -productwxspath "$(ProjectDir)..\PowerToysSetup\Core.wxs"
|
||||
if not "$(PerUser)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetup\generateAllFileComponents.ps1 -platform $(Platform)
|
||||
if "$(PerUser)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetup\generateAllFileComponents.ps1 -platform $(Platform) -installscopeperuser $(PerUser)
|
||||
|
||||
Reference in New Issue
Block a user