Procházet zdrojové kódy

add dd image to image

Tobias Simetsreiter před 3 roky
rodič
revize
2b1ba6646b
2 změnil soubory, kde provedl 64 přidání a 0 odebrání
  1. 47 0
      WinImager/bin/DD_ImageToImageNoTrunc.ps1
  2. 17 0
      build.ps1

+ 47 - 0
WinImager/bin/DD_ImageToImageNoTrunc.ps1

@@ -0,0 +1,47 @@
+
+Import-Module -Name $env:PSLIB
+
+$PSCommandPath
+BecomeAdmin $PSCommandPath
+
+Function Main()
+{
+    "Image To Image Writer"
+
+    $ErrorActionPreference = "Stop"
+
+    $srcfilename = GuiOpenFileName
+    
+    if ( -not $srcfilename ){
+        Write-Output "No File Selected"
+    } else {
+
+        $dstfilename = GuiSaveFileName
+        $dstfilename
+        if ( -not $dstfilename ){
+            Return
+        }
+
+        $dialog = @"
+Going to write Image
+
+"${srcfilename}"
+
+to File:
+
+"${dstfilename}"
+
+Would you like to contine?
+"@ 
+        $dialog
+        $continue = GuiMessageBox $dialog
+
+
+        if ($continue -eq "Yes"){
+
+            WinDD $srcfilename $dstfilename -Create $true
+        }
+    }
+}
+
+Main

+ 17 - 0
build.ps1

@@ -0,0 +1,17 @@
+param(
+    $sevenzip = "C:\Program Files\7-Zip\7z.exe"
+)
+
+$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
+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