mirror of
https://github.com/ScoopInstaller/Main.git
synced 2025-11-08 17:51:21 +00:00
swift: Fix pre_install (#5612)
Fix the pre_install script because the msi file and the path to be expanded have changed. --------- Co-authored-by: tech189 <dlloyd189@gmail.com>
This commit is contained in:
parent
50b1bb1e3b
commit
3318d71913
@ -19,22 +19,37 @@
|
||||
},
|
||||
"pre_install": [
|
||||
"Expand-DarkArchive \"$dir\\swiftsetup.exe\" \"$dir\\extract_folder\" -Removal",
|
||||
"Get-ChildItem \"$dir\\extract_folder\\AttachedContainer\\a*\" | ForEach-Object {",
|
||||
" Expand-MsiArchive $_ \"$dir\\extract_folder\"",
|
||||
"$xml = [xml](Get-Content -Raw \"$dir\\extract_folder\\UX\\manifest.xml\" -Encoding utf8)",
|
||||
"$xml.BurnManifest.Payload | ForEach-Object {",
|
||||
" Move-Item -Path \"$dir\\extract_folder\\AttachedContainer\\$($_.SourcePath)\" -Destination \"$dir\\extract_folder\\AttachedContainer\\$($_.FilePath)\"",
|
||||
"}",
|
||||
"Move-Item \"$dir\\extract_folder\\PFiles64\\Swift\" -Destination \"$dir\"",
|
||||
"Move-Item \"$dir\\extract_folder\\Library\\Developer\" -Destination \"$dir\"",
|
||||
"Remove-Item \"$dir\\extract_folder\" -Recurse | Out-Null"
|
||||
"$xml.BurnManifest.Payload | Where-Object { $_.FilePath.EndsWith(\".msi\") } | ForEach-Object {",
|
||||
" if ($($_.FilePath) -eq \"rtl.msi\") {",
|
||||
" Expand-MsiArchive \"$dir\\extract_folder\\AttachedContainer\\$($_.FilePath)\" \"$dir\\extract_folder\\LocalApp\\Programs\\Swift\\Runtimes\\usr\\bin\"",
|
||||
" } else {",
|
||||
" Expand-MsiArchive \"$dir\\extract_folder\\AttachedContainer\\$($_.FilePath)\" \"$dir\\extract_folder\"",
|
||||
" }",
|
||||
"}",
|
||||
"$ver = $xml.BurnManifest.Registration.Version",
|
||||
"Move-Item -Path \"$dir\\extract_folder\\LocalApp\\Programs\\Swift\" -Destination \"$dir\"",
|
||||
"Move-Item -Path \"$dir\\Swift\\Platforms\\$ver\\Windows.platform\" -Destination \"$dir\\Swift\\Platforms\"",
|
||||
"Move-Item -Path \"$dir\\Swift\\Toolchains\\$($ver)+Asserts\\usr\" -Destination \"$dir\\Swift\\Toolchains\"",
|
||||
"Move-Item -Path \"$dir\\Swift\\Tools\\$ver\\*\" -Destination \"$dir\\Swift\\Tools\"",
|
||||
"Remove-Item \"$dir\\Swift\\Platforms\\$ver\" | Out-Null",
|
||||
"Remove-Item \"$dir\\Swift\\Toolchains\\$ver+Asserts\" | Out-Null",
|
||||
"Remove-Item \"$dir\\Swift\\Tools\\$ver\" | Out-Null",
|
||||
"Remove-Item \"$dir\\extract_folder\" -Recurse | Out-Null",
|
||||
"Move-Item -Path \"$dir\\Swift\\*\" -Destination \"$dir\"",
|
||||
"Remove-Item \"$dir\\Swift\" | Out-Null"
|
||||
],
|
||||
"env_add_path": [
|
||||
"Developer\\Toolchains\\unknown-Asserts-development.xctoolchain\\usr\\bin",
|
||||
"Swift\\runtime-development\\usr\\bin"
|
||||
"Runtimes\\usr\\bin",
|
||||
"Toolchains\\usr\\bin",
|
||||
"Tools"
|
||||
],
|
||||
"env_set": {
|
||||
"SDKROOT": "$dir\\Developer\\Platforms\\Windows.platform\\Developer\\SDKs\\Windows.sdk",
|
||||
"DEVELOPER_DIR": "$dir\\Developer"
|
||||
"SDKROOT": "$dir\\Platforms\\Windows.platform\\Developer\\SDKs\\Windows.sdk"
|
||||
},
|
||||
"bin": "Swift\\runtime-development\\usr\\bin\\plutil.exe",
|
||||
"checkver": {
|
||||
"url": "https://github.com/apple/swift",
|
||||
"regex": "/swift-([\\d.]+)-RELEASE"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user