Jump to content

trashy
 Share

Recommended Posts

Easy_Dism

Primary goal is an easy to use, user friendly interface!
For amateur and expert alike.

Download Page

Spoiler

12 Tabs and growing
MOUNT: Mount modify add drivers etc commit and UnMount.
DRIVERS: Add drivers to a Mounted Image.
PACKAGES: Add windows Updates to a Mounted Image.
FEATURES: Turn Windows features on or off.
CAPTURE\APPEND: From PE Capture a backup Image of freshly installed Windows OS.
                Append only adds changes made since previous capture.
APPLY: Select a Volume Index and Apply backup Image.
EXPORT: Create your own custom Install wim
        Make New Image: Select a Volume Index and create a new Image.
                        Compression only works when creating a new Image.
                        Can also be used to to convert .esd to .wim.
DELETE: Select a Volume Index and delete it from the Image.
EDIT: Used Imagex for this one. Edit Name and Description of a Volume Index.
SPLIT\MERGE: Split a wim file or put it back together
DRIVER EXPORT\IMPORT: Export Drivers from Online Windows, Hard Drive Partition or Mounted Image Folder.
                      Install (Import) those Drivers to an online PE or Windows OS
DISKMNGMT: Format a Hard Drive or use Windows Disk Management (easy access to Windows tools)
           Browse for and apply a DiskPart text.

 

Windows 8.1 and 10 you can now run Easy_DISM from anywhere. No need to add dism files to Easy_DISM folder.

Requirement: For Windows 7 only, Dism files Must be located in Easy_DISM folder.
Reason for this gives the ability to use Easy_DISM from any version Windows OS or PE
Recommend DISM 10 and can be used on any Windows Image from 7 to 10 (Probably add Vista also).
Use Get Waik Tools "Thanks to JFX" and download Dism for 10. Download GetWaik
Restrictions: Easy_DISM Program folder must not contain any blank spaces in path!

If running from PE just use the plugin and everything will be done automatically.
http://theoven.org/index.php?topic=955.msg11799#msg11799

V 2.4.jpg

Easy_DISM v2.5
Added AppPkg Tab. This was all for Subz and created by Subz.
Primary focus on removing Apps and the process he came up with is really simple to use.
Add AppPkgs Untested and I won't pursue unless requested.
Program Update: In Windows 8.1 and 10 No longer necessary to run from same folder as DISM files.
Removed Edit tab and need for Imagex.
 
Easy_DISM v2.4.1 
Thanks to Subz new process sorting exported drivers
New folder structure will be SaveFolder\ClassName\ProviderName\blahblahblah\driverfiles                                                                                                                       
Easy_DISM v2.4
New Progress Bar!
Driver Export\Import Now uses PnPutil as default installer available in all Windows and PE SE projects
DPinst option still available

Easy_DISM v2.3
Added a Progress Bar and eliminated Cmd Window all tabs except pkgs and features.
As  I added Progress Bar and testing fixed a few bugs already present
and fixed any new bugs caused by the new addition (I Hope).
Biggest source of problems has always been spaces in file path so if you find any let me know.

modify_inline.gif

 

 

Edited by trashy
Link to comment
Share on other sites

I picked Easy_DISM back up recently and started Updating. Need to find a home for it in the download section but I had to start somewhere. I am a total Autoit and DISM amateur with that in mind I will post snippets and answer any questions I can.

My biggest problem has been spaces in file paths. When you break a DISM cmd line up  with different inputs and such it creates chaos. I recently noticed a pattern in the chaos. I was converting cmd lines to variables/handles and I noticed even number of breaks follow this rule as far as how Quotes are placed. Odd number of breaks 3 and 5 seem to follow no rules and refuse to convert

$c = ' /c '
$dismon = '\Dism.exe /Online"'
$miInfo = '\Dism.exe /Get-MountedImageInfo"'
$clean = '\Dism.exe /Cleanup-Mountpoints"'
$iInfo = '\Dism.exe /Get-ImageInfo /ImageFile:"'
$umimage = '\Dism.exe /UnMount-Image /MountDir:"'
$mImage = '\Dism.exe /Mount-Image /ImageFile:"'
$Image = '\Dism.exe /Image:"'
$capture = '\Dism.exe /Capture-Image /ImageFile:"'
$remount = '\Dism /Remount-Wim /MountDir:"'
$append = '\Dism.exe /Append-Image /ImageFile:"'
$apply = '\Dism.exe /apply-image /ImageFile:"'
$mntdir = '" /MountDir:"'
$index = '" /index:"'
$chkinteg = '" /CheckIntegrity"'
$verify = '" /verify"'
$read = '" /ReadOnly"'
$commit = '" /commit"'
$discard = '" /discard"'
$gdrivers = '" /Get-Drivers"'
$adddriver = '" /Add-Driver /Driver:"'
$forceun = '" /ForceUnsigned"'
$recurse = '" /Recurse"'
$remdriver = '" /Remove-Driver /Driver:"'
$getdriall = '" /Get-Drivers /All"'
$capdir = '" /CaptureDir:"'
$name = '" /Name:"'
$descrip = '" /description:"'
$compress = '" /Compress:"'
$scratch = '" /scratchdir:"'
$applydir = '" /applydir:"'
$exdriver = '" /export-driver /destination:"'

$output = Run(@ComSpec & $c & @ScriptDir & $capture & GUICtrlRead($T5Input2) & $capdir & GUICtrlRead($T5Combo1) & $name & GUICtrlRead($T5Input4) & $descrip & GUICtrlRead($T5Input5) & $compress & GUICtrlRead($T5ComboBox1) & $verify, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

I don't know if this helps anyone but I sure found it curious

 

Edited by trashy
Link to comment
Share on other sites

I know there has been quite a bit of discussion about a progress bar for DISM. The first solution I came up with was a splash text that was just awful. Here is what I ended up with

progress0001.jpg

#RequireAdmin ;Add it here
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <ScrollBarsConstants.au3>
#include <WindowsConstants.au3>

$Mount = GUICreate("Mount", 390, 100, 200, 125, -1, -1)
$progress = GUICtrlCreateEdit("UnMount", 5, 5, 380, 50)
GUISetBkColor(0x8899ff)
$Button3 = GUICtrlCreateButton("UnMount", 240, 60, 75, 25)
$Button2 = GUICtrlCreateButton("Exit", 160, 60, 75, 25)
$Button1 = GUICtrlCreateButton("Mount", 80, 60, 75, 25)
GUISetState(@SW_SHOW, $Mount)

$imagefile = '"C:\w7x86 all-in-one 11.20.16\sources\boot.wim"';<<<<< add your own source
$mountdir = '"C:\mount 1"';<<<<< add your destination

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
Case $Button1
$output = Run(@ComSpec & ' /c ' & @ScriptDir & '\Dism.exe /Mount-Image /ImageFile:' & $imagefile & ' /index:1 /MountDir:' & $mountdir, "", @SW_HIDE, $STDOUT_CHILD)
$progout = ""
$progcatch = ""
While 1
    $progout &= StdoutRead($output)
    If $progout <> $progcatch Then
        GUICtrlSetData($progress, $progout)
         _GUICtrlEdit_Scroll($progress, $SB_SCROLLCARET)
        $progcatch = $progout
    EndIf
    If @error Then ExitLoop
WEnd
Case $Button3
$output = Run(@ComSpec & ' /c ' & @ScriptDir & '\Dism.exe /UnMount-Image /MountDir:' & $mountdir & ' /Discard', "", @SW_HIDE, $STDOUT_CHILD)
$progout = ""
$progcatch = ""
While 1
    $progout &= StdoutRead($output)
    If $progout <> $progcatch Then
        GUICtrlSetData($progress, $progout)
         _GUICtrlEdit_Scroll($progress, $SB_SCROLLCARET)
        $progcatch = $progout
    EndIf
    If @error Then ExitLoop
WEnd
Case $GUI_EVENT_CLOSE, $Button2
            Exit
    EndSwitch
WEND
Edited by trashy
Link to comment
Share on other sites

Hey trashy.  First of all, I wanted to compliment you on a job well done.  Very nice tool.  However, as someone who has worked quite extensively with DISM, I wanted to chime in and suggest perhaps you add 2 extra functions to your already amazing tool, so that it really utilizes every aspect the DISM has to offer: the ability to export default app associations to an xml file, then apply them to an image you are servicing (reference), apply an unattend.xml file to online and offline images (reference), and Windows edition servicing (reference).   Just my thoughts on the matter.  Once again, good work.

Edit: By the way, I wouldn't really bother with apply-unattend aspect of dism, as it is very limited and there are easier ways to accomplish same goal, so just the other two really.

Edited by MattHiggs
Link to comment
Share on other sites

Yea Matt I am willing to try but first I owe Subz for helping me with Driver export sorting driver files to recognizable folder structure. (That's a poke at Microsoft the way they name folders). Next function will be Provisioning apps.

I just started looking into all the Windows 10 specific commands. Running Windows 7 and happy with it so the biggest thing I need will be testers. When I add a function I try to cover all the major necessary features only, unless someone make a special request. I may be slow but I am persistent so stick around.

Edit: Looking at all these provisioning functions most seem to be short and sweet. I would wand to group similar or connected functions onto same page to save room.

Thanks for the Thumbs Up!

Edited by trashy
Link to comment
Share on other sites

This is for Subz

His system for removing provisioned apps using an ini file could be a big help to others.

First Draft Not yet Tested I need Subz input.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <GuiTab.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <Constants.au3>
#include <Process.au3>
#include <ComboConstants.au3>
#include <WinAPIDlg.au3>
#include <GuiListView.au3>
#include <ColorConstants.au3>
#include <Array.au3>
#include <String.au3>
#include <FontConstants.au3.>
#include <GuiEdit.au3>
#include <ScrollBarsConstants.au3>
#include <GuiStatusBar.au3>
#include <File.au3>

$Form1 = GUICreate("Easy_DISM", 620, 680, -1, -1, -1, BitOR($WS_EX_WINDOWEDGE, $TCS_TOOLTIPS))

$c = ' /c '
$dismon = '\Dism.exe /Online"'
$miInfo = '\Dism.exe /Get-MountedImageInfo"'

$Tab1 = GUICtrlCreateTab(24, -1, 570, 600, BitOR($TCS_MULTILINE, $TCS_FLATBUTTONS))

;Start AppPkg Tab
$TabSheet12 = GUICtrlCreateTabItem("AppPkg")
$iStart_12 = GUICtrlCreateDummy() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$T12Checkbox1 = GUICtrlCreateCheckbox("Online", 504, 80, 60, 17)
$T12Button1 = GUICtrlCreateButton("Browse", 504, 48, 75, 25)
$T12Button2 = GUICtrlCreateButton("Browse", 416, 298, 75, 25)
$T12Button3 = GUICtrlCreateButton("ADD", 504, 298, 75, 25)
$T12Button4 = GUICtrlCreateButton("Browse", 416, 325, 75, 25)
$T12Button5 = GUICtrlCreateButton("ADD", 504, 325, 75, 25)
$T12Button6 = GUICtrlCreateButton("Remove", 504, 352, 75, 25)
$T12Button7 = GUICtrlCreateButton("Browse", 416, 352, 75, 25)
$T12Button8 = GUICtrlCreateButton("AppPkg Info", 504, 440, 75, 25)
$T12Edit1 = GUICtrlCreateEdit("", 120, 80, 370, 210)
GUICtrlSetData(-1, "")
$T12Edit2 = GUICtrlCreateEdit("", 120, 380, 370, 210)
GUICtrlSetData(-1, "")
$T12Input1 = GUICtrlCreateInput("", 120, 48, 370, 21)
$T12Input2 = GUICtrlCreateInput("", 120, 298, 281, 21)
$T12Input3 = GUICtrlCreateInput("", 120, 325, 281, 21)
$T12Input4 = GUICtrlCreateInput("", 120, 352, 281, 21)
$T12Label1 = GUICtrlCreateLabel("Mount Folder", 45, 48, 62, 17)
$T12Label2 = GUICtrlCreateLabel("Single AppPkg", 45, 298, 70, 17)
$T12Label3 = GUICtrlCreateLabel("AppPkg Folder", 45, 325, 70, 17)
$T12Label4 = GUICtrlCreateLabel("AppPkg .ini", 45, 352, 70, 17)
$iEnd_12 = GUICtrlCreateDummy() ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("EXIT", 272, 650, 75, 25)
$progress = GUICtrlCreateEdit("", 120, 600, 380, 50)
GUISetState(@SW_SHOW, $Form1)

$Run = Run(@ComSpec & $c & @ScriptDir & $miInfo, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
ProcessWaitClose($Run, 2)
$data = StdoutRead($Run)
GUICtrlSetData($T12Edit1, $data)
;GUICtrlSetData($T2Edit1, $data)
;GUICtrlSetData($T3Edit1, $data)
;GUICtrlSetData($T4Edit1, $data)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Exit
        Case $iStart_12 To $iEnd_12
            _Tab_12($nMsg)

    EndSwitch
WEnd

Func _Tab_12($nMsg) ;<<<<< AppPkg Tab
    Switch $nMsg
        Case $T12Checkbox1
            If GUICtrlRead($T12Checkbox1) = $Gui_Checked Then
                GUICtrlSetState($T12Input1, $GUI_DISABLE)
                GUICtrlSetState($T12Button1, $GUI_DISABLE)
            ElseIf GUICtrlRead($T12Checkbox1) = $Gui_UnChecked Then
                GUICtrlSetState($T12Input1, $GUI_ENABLE)
                GUICtrlSetState($T12Button1, $GUI_ENABLE)
            EndIf
        Case $T12Button1
            $of_T3Button1 = FileSelectFolder("Select Mount Folder: ", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 4)
            GUICtrlSetData($T12Input1, $of_T3Button1)
            $aRun = Run(@ComSpec & ' /c "' & @ScriptDir & '\Dism.exe /Get-MountedImageInfo"', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
            ProcessWaitClose($aRun, 0)
            $adata = StdoutRead($aRun)
            GUICtrlSetData($T12Edit1, $adata)
        Case $T12Button2
            $of_T3Button2 = FileOpenDialog("Select Pkg File", @HomeDrive, "Pkg Files (*.*)", 1 + 4, "")
            GUICtrlSetData($T12Input2, $of_T3Button2)
        Case $T12Button3
            If GUICtrlRead($T12Checkbox1) = $Gui_UnChecked Then
                If GUICtrlRead($T12Input1) = "" Then
                    MsgBox(262144, "Empty.....", "No Mount Folder Selected!")
                    Return
                EndIf
                If GUICtrlRead($T12Input2) = "" Then
                    MsgBox(262144, "Empty.....", "No Pkg Selected!")
                    Return
                EndIf
                $output = Run(@ComSpec & ' /c "' & @ScriptDir & '\Dism.exe /Image:"' & GUICtrlRead($T12Input1) & '" /Add-ProvisionedAppxPackages /PackagePath:"' & GUICtrlRead($T12Input2) & '" & Exit"', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
                $progout = ""
                $progcatch = ""
                While 1
                    $progout &= StdoutRead($output)
                    If $progout <> $progcatch Then
                        GUICtrlSetData($progress, $progout)
                        _GUICtrlEdit_Scroll($progress, $SB_SCROLLCARET)
                        $progcatch = $progout
                    EndIf
                    If @error Then ExitLoop
                WEnd
            ElseIf GUICtrlRead($T12Checkbox1) = $Gui_Checked Then
                If GUICtrlRead($T12Input2) = "" Then
                    MsgBox(262144, "Empty.....", "No AppPkg Selected!")
                    Return
                    ;<<<<< Online cmd goes here
                EndIf
            EndIf
        Case $T12Button4
            $of_T3Button4 = FileSelectFolder("Select Pkg : ", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 4)
            GUICtrlSetData($T12Input3, $of_T3Button4)
        Case $T12Button5
            If GUICtrlRead($T12Checkbox1) = $Gui_UnChecked Then
                If GUICtrlRead($T12Input1) = "" Then
                    MsgBox(262144, "Empty.....", "No Mount Folder Selected!")
                    Return
                EndIf
                If GUICtrlRead($T12Input3) = "" Then
                    MsgBox(262144, "Empty.....", "No Pkg Folder Selected!")
                    Return
                EndIf
                $output = Run(@ComSpec & ' /c "' & @ScriptDir & '\Dism.exe /Image:"' & GUICtrlRead($T12Input1) & '" /Add-ProvisionedAppxPackage /FolderPath:"' & GUICtrlRead($T12Input3) & '" & Exit"', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
                $progout = ""
                $progcatch = ""
                While 1
                    $progout &= StdoutRead($output)
                    If $progout <> $progcatch Then
                        GUICtrlSetData($progress, $progout)
                        _GUICtrlEdit_Scroll($progress, $SB_SCROLLCARET)
                        $progcatch = $progout
                    EndIf
                    If @error Then ExitLoop
                WEnd
            ElseIf GUICtrlRead($T12Checkbox1) = $Gui_Checked Then
                If GUICtrlRead($T12Input3) = "" Then
                    MsgBox(262144, "Empty.....", "No AppPkg Folder Selected!")
                    Return
                    ;<<<<< Online cmd goes here
                EndIf
            EndIf
        Case $T12Button6
            If GUICtrlRead($T12Checkbox1) = $Gui_UnChecked Then
                If GUICtrlRead($T12Input1) = "" Then
                    MsgBox(262144, "Empty.....", "No Mount Folder Selected!")
                    Return
                EndIf
                If GUICtrlRead($T12Input4) = "" Then
                    MsgBox(262144, "Empty.....", "Select an AppPkg.ini!")
                    Return
                EndIf
                $sINI_FILEPATH = GUICtrlRead($T12Input4)
                $aINI_PACKAGES = IniReadSection($sINI_FILEPATH, 'Packages')
                If @error <> 0 Then Exit
                For $x = 1 To $aINI_PACKAGES[0][0]
                    If $aINI_PACKAGES[$x][1] = 'False' Then ContinueLoop
                    $zRun = Run(@ComSpec & ' /c "' & @ScriptDir & '\Dism.exe /Image:"' & GUICtrlRead($T12Input1) & '" /Remove-ProvisionedAppxPackage /PackageName:"' & IniRead($sINI_FILEPATH, $aINI_PACKAGES[$x][0], '"PackageName"', ""), "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
                    $progout = ""
                    $progcatch = ""
                    While 1
                        $progout &= StdoutRead($zRun)
                        If $progout <> $progcatch Then
                            GUICtrlSetData($T12Edit2, $progout)
                            _GUICtrlEdit_Scroll($T12Edit2, $SB_SCROLLCARET)
                            $progcatch = $progout
                        EndIf
                        If @error Then ExitLoop
                    WEnd
                Next
            ElseIf GUICtrlRead($T12Checkbox1) = $Gui_Checked Then
                If GUICtrlRead($T12Input4) = "" Then
                    MsgBox(262144, "Empty.....", "Select an AppPkg.ini!")
                    Return
                    ;<<<<< Online cmd goes here
                EndIf
            EndIf
        Case $T12Button7
            $of_T12Button7 = FileOpenDialog("Select AppPkg.ini", @ScriptDir, "AppPkg (*.ini)", 1 + 4, "")
            GUICtrlSetData($T12Input4, $of_T12Button7)
        Case $T12Button8
            If GUICtrlRead($T12Checkbox1) = $Gui_UnChecked Then
                If GUICtrlRead($T12Input1) = "" Then
                    MsgBox(262144, "Empty.....", "No Mount Folder Selected!")
                    Return
                EndIf
                $bRun = Run(@ComSpec & ' /c "' & @ScriptDir & '\Dism.exe /Image:"' & GUICtrlRead($T12Input1) & '" /Get-ProvisionedAppxPackages"', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
                $progout = ""
                $progcatch = ""
                While 1
                    $progout &= StdoutRead($bRun)
                    If $progout <> $progcatch Then
                        GUICtrlSetData($T12Edit2, $progout)
                        _GUICtrlEdit_Scroll($T12Edit2, $SB_SCROLLCARET)
                        $progcatch = $progout
                    EndIf
                    If @error Then ExitLoop
                WEnd
            ElseIf GUICtrlRead($T12Checkbox1) = $Gui_Checked Then
                ;<<<<< Online cmd goes here
            EndIf
    EndSwitch
EndFunc   ;==>_Tab_12

 

Link to comment
Share on other sites

  • 2 weeks later...

Added AppPkg tab. @Subz came up with a system for removing app packages that is just awesome and so easy!

Updated Easy_DISM  for Windows 8.1 and 10 no longer requires DISM in same folder.

Windows 8.1 and 10 >>>>> Run Easy_DISM from any location uses the DISM files located in System32.

Windows 7 Easy_DISM must still be run from same folder as DISM. Recommend DISM 10 use GetWaik Tools only downloads the necessary files less than 10 mb. GetWaik Tool can be found here >>> Download GetWaik

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...