|
|
@@ -1,17 +1,54 @@
|
|
|
param(
|
|
|
$sevenzip = "C:\Program Files\7-Zip\7z.exe"
|
|
|
)
|
|
|
+cd $PSSCriptRoot
|
|
|
+
|
|
|
+$dist = "dist"
|
|
|
+$src = "WinImager"
|
|
|
+$sfx = "sfx"
|
|
|
|
|
|
-$dist = "$PSScriptRoot\dist"
|
|
|
-$src = "$PSScriptRoot\WinImager"
|
|
|
-$sfx = "$PSScriptRoot\sfx"
|
|
|
|
|
|
$szfile = "$dist/WinImager.7z"
|
|
|
$exefile = "$dist/WinImager.exe"
|
|
|
|
|
|
-New-Item -itemtype directory -Path "$PSScriptRoot\dist" -Force
|
|
|
+New-Item -itemtype directory -Path "$dist" -Force
|
|
|
Remove-Item -Force $szfile
|
|
|
|
|
|
&$sevenzip a $szfile $src "-xr0!*.log"
|
|
|
|
|
|
-Get-Content -Encoding Byte -Read 512 -Path "$sfx/7zsd_All_x64.sfx","$sfx/sfx_config.txt",$szfile | Set-Content -Encoding Byte $exefile
|
|
|
+Get-Content -Encoding Byte -Read 512 -Path "$sfx/7zsd_All_x64.sfx","$sfx/sfx_config.txt",$szfile | Set-Content -Encoding Byte $exefile
|
|
|
+
|
|
|
+
|
|
|
+$wintermsfx_build="wintermsfx\build"
|
|
|
+
|
|
|
+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
|
|
|
+
|
|
|
+$PSVERSION="7.2.5"
|
|
|
+$PSFILE="PowerShell-$PSVERSION-win-x64.zip"
|
|
|
+$PSURL="https://github.com/PowerShell/PowerShell/releases/download/v$PSVERSION/$PSFILE"
|
|
|
+
|
|
|
+$PSTOOLSFILE="PSTools.zip"
|
|
|
+$PSTOOLSURL="https://download.sysinternals.com/files/$PSTOOLSFILE"
|
|
|
+
|
|
|
+if ($null -eq (Get-Item $PSFILE)){
|
|
|
+ Invoke-WebRequest -Uri $PSURL -OutFile $PSFILE
|
|
|
+}
|
|
|
+if ($null -eq (Get-Item $PSTOOLSFILE)){
|
|
|
+ Invoke-WebRequest -Uri $PSTOOLSURL -OutFile $PSTOOLSFILE
|
|
|
+}
|
|
|
+
|
|
|
+Remove-Item -Recurse -Force windowsterminal\powershell\
|
|
|
+Expand-Archive $PSFILE -DestinationPath windowsterminal\powershell\
|
|
|
+Expand-Archive $PSTOOLSFILE -DestinationPath windowsterminal\powershell\
|
|
|
+
|
|
|
+&$sevenzip a windowsterminal.7z main.ps1 windowsterminal
|
|
|
+
|
|
|
+cd $PSSCriptRoot
|
|
|
+
|
|
|
+gc $sfx/7zsd_All_x64.sfx,$sfx/sfx_main.txt,wintermsfx\build\windowsterminal.7z -Encoding Byte -Read 512 | sc -Encoding Byte "$dist\wintermsfx.exe"
|