@@ -24,8 +24,9 @@ public static bool VerifyAllComponentsArePresent()
2424 var BlankVHD = @"blank.vhdx" ;
2525 var wimlib = @"wimlib-imagex.exe" ;
2626 var Img2Ffu = @"Img2Ffu.exe" ;
27+ var DriverUpdater = @"DriverUpdater.exe" ;
2728
28- if ( ! ( File . Exists ( wimlib ) && File . Exists ( Img2Ffu ) && File . Exists ( BlankVHD ) ) )
29+ if ( ! ( File . Exists ( wimlib ) && File . Exists ( Img2Ffu ) && File . Exists ( BlankVHD ) && File . Exists ( DriverUpdater ) ) )
2930 {
3031 Logging . Log ( "Some components could not be found" , Logging . LoggingLevel . Error ) ;
3132 return false ;
@@ -46,7 +47,6 @@ public static bool VerifyAllComponentsArePresent()
4647 public static string MountVHD ( string VHDPath , bool readOnly )
4748 {
4849 Logging . Log ( "Mounting " + VHDPath + ( readOnly ? " as read only" : "" ) + "..." ) ;
49- //RunProgram("powershell.exe", $"-command \"Import-module hyper-v; Mount-VHD -Path '{VHDPath}'" + (readOnly ? " -ReadOnly" : "") + "\"");
5050 var id = VHDUtils . MountVHD ( VHDPath , readOnly ) ;
5151 Logging . Log ( id , Logging . LoggingLevel . Warning ) ;
5252 return id ;
@@ -55,7 +55,6 @@ public static string MountVHD(string VHDPath, bool readOnly)
5555 public static void DismountVHD ( string VHDPath )
5656 {
5757 Logging . Log ( "Dismounting " + VHDPath + "..." ) ;
58- //RunProgram("powershell.exe", $"-command \"Import-module hyper-v; Dismount-VHD -Path '{VHDPath}'\"");
5958 VHDUtils . UnmountVHD ( VHDPath ) ;
6059 }
6160
@@ -146,6 +145,7 @@ public static void GenerateWindowsFFU(GenerateWindowsFFUOptions options)
146145 var tmp = @"tmp" ;
147146 var SystemPartition = "Y:" ;
148147 var Img2Ffu = @"Img2Ffu.exe" ;
148+ var DriverUpdater = @"DriverUpdater.exe" ;
149149
150150 if ( ! Directory . Exists ( tmp ) )
151151 Directory . CreateDirectory ( tmp ) ;
@@ -183,17 +183,13 @@ public static void GenerateWindowsFFU(GenerateWindowsFFUOptions options)
183183 }
184184
185185 Logging . Log ( "Adding drivers" ) ;
186- RunProgram ( "dism.exe" , $ "/Image: { TVHDLetter } /Add-Driver " + deviceProfile . DriverCommand ( options . DriverPack ) ) ;
186+ RunProgram ( DriverUpdater , $ "{ deviceProfile . DriverCommand ( options . DriverPack ) } { options . DriverPack } { TVHDLetter } DisablePostUpgrade" ) ;
187187
188188 DismountVHD ( TmpVHD ) ;
189189
190- //DiskId = MountVHD(TmpVHD, true);
191-
192190 Logging . Log ( "Making FFU" ) ;
193191 RunProgram ( Img2Ffu , $ "-i { TmpVHD } -f \" { options . Output + "\\ " + deviceProfile . FFUFileName ( options . WindowsVer , "EN-US" , "PRO" ) } \" -p { deviceProfile . PlatformID ( ) } -o { options . WindowsVer } ") ;
194192
195- //DismountVHD(TmpVHD);
196-
197193 Logging . Log ( "Deleting Temp VHD" ) ;
198194 File . Delete ( TmpVHD ) ;
199195 }
0 commit comments