|
|
@@ -2,43 +2,49 @@ param(
|
|
|
$sevenzip = "C:\Program Files\7-Zip\7z.exe"
|
|
|
)
|
|
|
|
|
|
-Set-Location "$PSSCriptRoot\.."
|
|
|
+$GITDIR=Resolve-Path "$PSSCriptRoot\.."
|
|
|
|
|
|
-$dist = "dist"
|
|
|
-$sfx = "sfx"
|
|
|
+$dist = "$GITDIR\dist"
|
|
|
+$sfx = "$GITDIR\sfx"
|
|
|
+$wintermsfx_build="$GITDIR\wintermsfx\build"
|
|
|
+$szpath = "$wintermsfx_build\windowsterminal.7z"
|
|
|
|
|
|
$PSVERSION="7.2.5"
|
|
|
+
|
|
|
$PSFILE="PowerShell-$PSVERSION-win-x64.zip"
|
|
|
+$PSPATH="$wintermsfx_build\$PSFILE"
|
|
|
$PSURL="https://github.com/PowerShell/PowerShell/releases/download/v$PSVERSION/$PSFILE"
|
|
|
|
|
|
$PSTOOLSFILE="PSTools.zip"
|
|
|
+$PSTOOLSPATH="$wintermsfx_build\$PSTOOLSFILE"
|
|
|
$PSTOOLSURL="https://download.sysinternals.com/files/$PSTOOLSFILE"
|
|
|
-$wintermsfx_build="wintermsfx\build"
|
|
|
New-Item -itemtype directory -Path $wintermsfx_build -Force
|
|
|
+New-Item -itemtype directory -Path $dist -Force
|
|
|
|
|
|
if ($null -eq (Get-Item "$wintermsfx_build\windowsterminal")){
|
|
|
.\wintermsfx\wintermportable.ps1
|
|
|
}
|
|
|
Copy-Item -Force .\wintermsfx\main.ps1 "$wintermsfx_build\main.ps1"
|
|
|
|
|
|
-cd $wintermsfx_build
|
|
|
-Remove-Item -Force windowsterminal.7z
|
|
|
+Remove-Item -Force "$szpath"
|
|
|
|
|
|
|
|
|
-if ($null -eq (Get-Item $PSFILE)){
|
|
|
- Invoke-WebRequest -Uri $PSURL -OutFile $PSFILE
|
|
|
+if ($null -eq (Get-Item $PSPATH)){
|
|
|
+ Invoke-WebRequest -Uri $PSURL -OutFile $PSPATH
|
|
|
}
|
|
|
-if ($null -eq (Get-Item $PSTOOLSFILE)){
|
|
|
- Invoke-WebRequest -Uri $PSTOOLSURL -OutFile $PSTOOLSFILE
|
|
|
+if ($null -eq (Get-Item $PSTOOLSPATH)){
|
|
|
+ Invoke-WebRequest -Uri $PSTOOLSURL -OutFile $PSTOOLSPATH
|
|
|
}
|
|
|
|
|
|
-Remove-Item -Recurse -Force windowsterminal\powershell\
|
|
|
-Expand-Archive $PSFILE -DestinationPath windowsterminal\powershell\
|
|
|
-Expand-Archive $PSTOOLSFILE -DestinationPath windowsterminal\powershell\
|
|
|
+Remove-Item -Recurse -Force "$wintermsfx_build\windowsterminal\powershell\"
|
|
|
+Expand-Archive $PSPATH -DestinationPath "$wintermsfx_build\windowsterminal\powershell\"
|
|
|
+Expand-Archive $PSTOOLSPATH -DestinationPath "$wintermsfx_build\windowsterminal\powershell\"
|
|
|
|
|
|
-&$sevenzip a windowsterminal.7z main.ps1 windowsterminal
|
|
|
+pushd $wintermsfx_build && &{
|
|
|
+ &$sevenzip a "$szpath" main.ps1 windowsterminal
|
|
|
+ popd
|
|
|
+}
|
|
|
|
|
|
-cd $PSSCriptRoot
|
|
|
|
|
|
-Get-Content -AsByteStream -Read 512 $sfx/7zsd_All_x64.sfx,$sfx/sfx_main.txt,wintermsfx\build\windowsterminal.7z |
|
|
|
+Get-Content -AsByteStream -Read 512 "$sfx/7zsd_All_x64.sfx","$sfx/sfx_main.txt","$szpath" |
|
|
|
Set-Content -AsByteStream "$dist\wintermsfx.exe"
|