From b729cb1c7de5b10814867381733010dc59381776 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Thu, 24 Jun 2021 12:38:18 +0800 Subject: [PATCH 1/4] remove createdump.exe --- Scripts/post_build.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index ce9944624..8a03d6739 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -47,10 +47,21 @@ function Delete-Unused ($path, $config) { Remove-Item -Path $target -Include "*.xml" -Recurse } +function Remove-CreateDumpExe ($path, $config) { + $target = "$path\Output\$config" + + $depjson = Get-Content $target\Flow.Launcher.deps.json -raw |ConvertFrom-Json -depth 32 + $depjson.targets.'.NETCoreApp,Version=v5.0/win-x64'.'runtimepack.Microsoft.NETCore.App.Runtime.win-x64/5.0.6'.native.PSObject.Properties.Remove("createdump.exe") + $depjson|ConvertTo-Json -Depth 32|Out-File $target\Flow.Launcher.deps.json + Remove-Item -Path $target -Include "*createdump.exe" -Recurse +} + + function Validate-Directory ($output) { New-Item $output -ItemType Directory -Force } + function Pack-Squirrel-Installer ($path, $version, $output) { # msbuild based installer generation is not working in appveyor, not sure why Write-Host "Begin pack squirrel installer" @@ -108,6 +119,8 @@ function Main { Publish-Self-Contained $p + Remove-CreateDumpExe $p $config + $o = "$p\Output\Packages" Validate-Directory $o Pack-Squirrel-Installer $p $v $o From cc9c51d8998bcaf16d67d01e78a19494f7acfc92 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Mon, 28 Jun 2021 11:03:09 +0800 Subject: [PATCH 2/4] Use Regex instead of parsing JsonObject --- Scripts/post_build.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 8a03d6739..7f089a440 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -50,10 +50,8 @@ function Delete-Unused ($path, $config) { function Remove-CreateDumpExe ($path, $config) { $target = "$path\Output\$config" - $depjson = Get-Content $target\Flow.Launcher.deps.json -raw |ConvertFrom-Json -depth 32 - $depjson.targets.'.NETCoreApp,Version=v5.0/win-x64'.'runtimepack.Microsoft.NETCore.App.Runtime.win-x64/5.0.6'.native.PSObject.Properties.Remove("createdump.exe") - $depjson|ConvertTo-Json -Depth 32|Out-File $target\Flow.Launcher.deps.json - Remove-Item -Path $target -Include "*createdump.exe" -Recurse + $depjson = Get-Content $target\Flow.Launcher.deps.json -raw + $depjson -replace '(?s)(.createdump.exe": {.*?}.*?\n)\s*', "" | Out-File $target\Flow.Launcher.deps.json } @@ -127,4 +125,4 @@ function Main { } } -Main \ No newline at end of file +Main From 4443200490f986e959c5dd82ca8ba690b1a4caa7 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Mon, 28 Jun 2021 11:26:18 +0800 Subject: [PATCH 3/4] remove createdump.exe --- Scripts/post_build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 7f089a440..cfa438e10 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -52,6 +52,7 @@ function Remove-CreateDumpExe ($path, $config) { $depjson = Get-Content $target\Flow.Launcher.deps.json -raw $depjson -replace '(?s)(.createdump.exe": {.*?}.*?\n)\s*', "" | Out-File $target\Flow.Launcher.deps.json + Remove-Item -Path $target -Include "*createdump.exe" -Recurse } From 5442a066b86fc8455b4fe9870cc65fead0e78785 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:16:59 +0800 Subject: [PATCH 4/4] Use UTF8 --- Scripts/post_build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index cfa438e10..093f92768 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -51,7 +51,7 @@ function Remove-CreateDumpExe ($path, $config) { $target = "$path\Output\$config" $depjson = Get-Content $target\Flow.Launcher.deps.json -raw - $depjson -replace '(?s)(.createdump.exe": {.*?}.*?\n)\s*', "" | Out-File $target\Flow.Launcher.deps.json + $depjson -replace '(?s)(.createdump.exe": {.*?}.*?\n)\s*', "" | Out-File $target\Flow.Launcher.deps.json -Encoding UTF8 Remove-Item -Path $target -Include "*createdump.exe" -Recurse }