mirror of
https://github.com/PhoenixPE/PhoenixPE.git
synced 2025-09-17 02:28:09 +02:00
remove GetWAIKTools dependency for BCDEdit and DISM.
Win10 has these tools builtin, use the native binaries instead.
This commit is contained in:
@@ -34,8 +34,8 @@ Description=.NET Framework is a software development framework for building and
|
|||||||
Selected=True
|
Selected=True
|
||||||
Level=4
|
Level=4
|
||||||
Author=Homes32
|
Author=Homes32
|
||||||
Version=1.2.0.0
|
Version=1.3.0.0
|
||||||
Date=2021-07-14
|
Date=2021-10-31
|
||||||
Mandatory=False
|
Mandatory=False
|
||||||
|
|
||||||
[Variables]
|
[Variables]
|
||||||
@@ -153,9 +153,6 @@ Echo,"Preparing to enable feature: .NET Framework v3..."
|
|||||||
StrFormat,PATH,%DismLog%,%DismLogPath%
|
StrFormat,PATH,%DismLog%,%DismLogPath%
|
||||||
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
||||||
|
|
||||||
If,%HostArch%,Equal,x86,Set,%Dism.exe%,"%Tools%\x86\DISM\dism.exe"
|
|
||||||
Else,Set,%Dism.exe%,"%Tools%\x64\DISM\dism.exe"
|
|
||||||
|
|
||||||
// Make sure our source is Read-Write (ie. not a mounted ISO)
|
// Make sure our source is Read-Write (ie. not a mounted ISO)
|
||||||
FileCreateBlank,"%SourceDir%\RW-TEST",NOWARN
|
FileCreateBlank,"%SourceDir%\RW-TEST",NOWARN
|
||||||
If,Not,ExistFile,"%SourceDir%\RW-TEST",Begin,
|
If,Not,ExistFile,"%SourceDir%\RW-TEST",Begin,
|
||||||
@@ -164,33 +161,23 @@ If,Not,ExistFile,"%SourceDir%\RW-TEST",Begin,
|
|||||||
End
|
End
|
||||||
FileDelete,"%SourceDir%\RW-TEST"
|
FileDelete,"%SourceDir%\RW-TEST"
|
||||||
|
|
||||||
If,ExistFile,%Dism.exe%,Begin
|
// Mount our install.wim image
|
||||||
// Everything is good. let's get to work.
|
Echo,"Mounting source image [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
||||||
StrFormat,PATH,%Dism.exe%,%Dism.exePath%
|
DirMake,%MountDir%
|
||||||
|
WimMount,%SourceInstallWim%,%SourceInstallWimImage%,%MountDir%,READWRITE
|
||||||
|
|
||||||
// Mount our install.wim image
|
// Check for .NET 3 and Enable if necessary
|
||||||
Echo,"Mounting source image [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
Echo,"Enabling feature: .NET Framework 3..."
|
||||||
DirMake,%MountDir%
|
If,Not,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
||||||
WimMount,%SourceInstallWim%,%SourceInstallWimImage%,%MountDir%,READWRITE
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:#$q%SourceDir%\sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,AbortFeature
|
||||||
// Check for .NET 3 and Enable if necessary
|
|
||||||
Echo,"Enabling feature: .NET Framework 3..."
|
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:#$q%SourceDir%\sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,AbortFeature
|
|
||||||
End
|
|
||||||
Else,Message,".NET Framework 3 is already enabled!",Warning
|
|
||||||
|
|
||||||
// Dism doesn't always unload hives correctly. Force unload just to make sure WimUnmout doesn't freak out.
|
|
||||||
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
|
||||||
Echo,"Committing changes and unmounting source image:#$x [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
|
||||||
WimUnmount,%MountDir%,COMMIT
|
|
||||||
End
|
|
||||||
Else,Begin
|
|
||||||
// Dism.exe is missing. Run Pre-Flight Check to download.
|
|
||||||
Message,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools.",Warning
|
|
||||||
Halt,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools."
|
|
||||||
End
|
End
|
||||||
|
Else,Message,".NET Framework 3 is already enabled!",Warning
|
||||||
|
|
||||||
|
// Dism doesn't always unload hives correctly. Force unload just to make sure WimUnmout doesn't freak out.
|
||||||
|
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
||||||
|
Echo,"Committing changes and unmounting source image:#$x [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
||||||
|
WimUnmount,%MountDir%,COMMIT
|
||||||
|
|
||||||
[#DisableFx3#]
|
[#DisableFx3#]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
@@ -210,9 +197,6 @@ Echo,"Preparing to disable feature: .NET Framework v3..."
|
|||||||
StrFormat,PATH,%DismLog%,%DismLogPath%
|
StrFormat,PATH,%DismLog%,%DismLogPath%
|
||||||
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
||||||
|
|
||||||
If,%HostArch%,Equal,x86,Set,%Dism.exe%,"%Tools%\x86\DISM\dism.exe"
|
|
||||||
Else,Set,%Dism.exe%,"%Tools%\x64\DISM\dism.exe"
|
|
||||||
|
|
||||||
// Make sure our source is Read-Write (ie. not a mounted ISO)
|
// Make sure our source is Read-Write (ie. not a mounted ISO)
|
||||||
FileCreateBlank,"%SourceDir%\RW-TEST",NOWARN
|
FileCreateBlank,"%SourceDir%\RW-TEST",NOWARN
|
||||||
If,Not,ExistFile,"%SourceDir%\RW-TEST",Begin,
|
If,Not,ExistFile,"%SourceDir%\RW-TEST",Begin,
|
||||||
@@ -221,33 +205,23 @@ If,Not,ExistFile,"%SourceDir%\RW-TEST",Begin,
|
|||||||
End
|
End
|
||||||
FileDelete,"%SourceDir%\RW-TEST"
|
FileDelete,"%SourceDir%\RW-TEST"
|
||||||
|
|
||||||
If,ExistFile,%Dism.exe%,Begin
|
// Mount our install.wim image
|
||||||
// Everything is good. let's get to work.
|
Echo,"Mounting source image [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
||||||
StrFormat,PATH,%Dism.exe%,%Dism.exePath%
|
DirMake,%MountDir%
|
||||||
|
WimMount,%SourceInstallWim%,%SourceInstallWimImage%,%MountDir%,READWRITE
|
||||||
|
|
||||||
// Mount our install.wim image
|
// Check for .NET 3 and Enable if necessary
|
||||||
Echo,"Mounting source image [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
Echo,"Disabling feature: .NET Framework 3..."
|
||||||
DirMake,%MountDir%
|
If,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
||||||
WimMount,%SourceInstallWim%,%SourceInstallWimImage%,%MountDir%,READWRITE
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:NetFx3 /LogPath:#$q%DismLog%#$q"
|
||||||
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,AbortFeature
|
||||||
// Check for .NET 3 and Enable if necessary
|
|
||||||
Echo,"Disabling feature: .NET Framework 3..."
|
|
||||||
If,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:NetFx3 /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,AbortFeature
|
|
||||||
End
|
|
||||||
Else,Message,".NET Framework 3 is already disabled!",Warning
|
|
||||||
|
|
||||||
// Dism doesn't always unload hives correctly. Force unload just to make sure WimUnmout doesn't freak out.
|
|
||||||
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
|
||||||
Echo,"Committing changes and unmounting source image:#$x [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
|
||||||
WimUnmount,%MountDir%,COMMIT
|
|
||||||
End
|
|
||||||
Else,Begin
|
|
||||||
// Dism.exe is missing. Run Pre-Flight Check to download.
|
|
||||||
Message,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools.",Warning
|
|
||||||
Halt,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools."
|
|
||||||
End
|
End
|
||||||
|
Else,Message,".NET Framework 3 is already disabled!",Warning
|
||||||
|
|
||||||
|
// Dism doesn't always unload hives correctly. Force unload just to make sure WimUnmout doesn't freak out.
|
||||||
|
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
||||||
|
Echo,"Committing changes and unmounting source image:#$x [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
||||||
|
WimUnmount,%MountDir%,COMMIT
|
||||||
|
|
||||||
[#AbortFeature#]
|
[#AbortFeature#]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
|
@@ -186,8 +186,6 @@ If,Not,ExistFile,"%Tools%\x86\SetACL.exe",Run,%ScriptFile%,ErrMissingTool,SetACL
|
|||||||
If,Not,ExistFile,"%Tools%\x86\xml.exe",Run,%ScriptFile%,ErrMissingTool,xml.exe
|
If,Not,ExistFile,"%Tools%\x86\xml.exe",Run,%ScriptFile%,ErrMissingTool,xml.exe
|
||||||
|
|
||||||
// WaikTools
|
// WaikTools
|
||||||
If,Not,ExistFile,"%Tools%\%HostArch%\BCDBoot\bcdedit.exe",Run,%ScriptFile%,GetWaikTools
|
|
||||||
If,Not,ExistFile,"%Tools%\%HostArch%\DISM\dism.exe",Run,%ScriptFile%,GetWaikTools
|
|
||||||
If,Not,ExistFile,"%Tools%\%HostArch%\Oscdimg\oscdimg.exe",Run,%ScriptFile%,GetWaikTools
|
If,Not,ExistFile,"%Tools%\%HostArch%\Oscdimg\oscdimg.exe",Run,%ScriptFile%,GetWaikTools
|
||||||
|
|
||||||
[#ErrMissingTool#]
|
[#ErrMissingTool#]
|
||||||
@@ -208,21 +206,28 @@ Halt,"The build cannot continue because [ #1 ] is missing."
|
|||||||
[#GetWaikTools#]
|
[#GetWaikTools#]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
// Name...........: GetWaikTools
|
// Name...........: GetWaikTools
|
||||||
// Description....: Download missing/required WAIK tools (dism, oscdimg, etc.) using JFX's GWT.exe
|
// Description....: Download missing/required WAIK tools (oscdimg, etc.) using JFX's GWT.exe
|
||||||
// Syntax.........:
|
// Syntax.........:
|
||||||
// Parameters.....:
|
// Parameters.....:
|
||||||
// Return values..:
|
// Return values..:
|
||||||
// Author.........: Homes32
|
// Author.........: Homes32
|
||||||
// Remarks........:
|
// Remarks........: Note: GetWaikTools has been discontinued as of v21.04. Will need to rewrite this function to use adksetup.exe
|
||||||
// Related........: Called by [CheckTools]
|
// Related........: Called by [CheckTools]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
[GetWaikTools]
|
[GetWaikTools]
|
||||||
Echo,"Downloading required tools from Windows 10 ADK...#$x#$xThis will only need to be done once."
|
Echo,"Downloading required tools from Windows 10 ADK...#$x#$xThis will only need to be done once."
|
||||||
ShellExecute,Open,"%Tools%\%HostArch%\GWT.exe","-Win10 -Win10Dism -Silent -folder:%ProjectTemp%"
|
ShellExecute,Open,"%Tools%\%HostArch%\GWT.exe","-Win10 -Silent -folder:%ProjectTemp%"
|
||||||
DirCopy,"%ProjectTemp%\ADK_6\x86\*.*","%Tools%\x86"
|
DirCopy,"%ProjectTemp%\ADK_6\x86\*.*","%Tools%\x86"
|
||||||
DirCopy,"%ProjectTemp%\ADK_6\amd64\*.*","%Tools%\x64"
|
DirCopy,"%ProjectTemp%\ADK_6\amd64\*.*","%Tools%\x64"
|
||||||
If,Not,ExistFile,"%Tools%\x64\Oscdimg\oscdimg.exe",Halt,"Error downloading required Windows 10 ADK tools. The build cannot continue."
|
If,Not,ExistFile,"%Tools%\x64\Oscdimg\oscdimg.exe",Halt,"Error downloading required Windows 10 ADK tools. The build cannot continue."
|
||||||
|
|
||||||
|
// Don't waste disk space with these, we will use the OS versions
|
||||||
|
DirDeleteEx,"%Tools%\x86\DISM"
|
||||||
|
DirDeleteEx,"%Tools%\x86\BCDBOOT"
|
||||||
|
DirDeleteEx,"%Tools%\x64\DISM"
|
||||||
|
DirDeleteEx,"%Tools%\x64\BCDBOOT"
|
||||||
|
|
||||||
|
|
||||||
[#CheckKnownBuilds#]
|
[#CheckKnownBuilds#]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
// Name...........: CheckKnownBuilds
|
// Name...........: CheckKnownBuilds
|
||||||
|
@@ -77,24 +77,13 @@ Echo,"Integrating Drivers...#$x#$xThis can take awhile, please be patient."
|
|||||||
StrFormat,PATH,%DismLog%,%DismLogPath%
|
StrFormat,PATH,%DismLog%,%DismLogPath%
|
||||||
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
||||||
|
|
||||||
If,%HostArch%,Equal,x86,Set,%Dism.exe%,"%Tools%\x86\DISM\dism.exe"
|
|
||||||
Else,Set,%Dism.exe%,"%Tools%\x64\DISM\dism.exe"
|
|
||||||
|
|
||||||
If,%cb_ForceUnsignedDrivers%,Equal,True,Set,%DismForceUnsigned%," /ForceUnsigned"
|
If,%cb_ForceUnsignedDrivers%,Equal,True,Set,%DismForceUnsigned%," /ForceUnsigned"
|
||||||
Else,Set,%DismForceUnsigned%,""
|
Else,Set,%DismForceUnsigned%,""
|
||||||
|
|
||||||
If,ExistFile,%Dism.exe%,Begin
|
ShellExecute,Hide,"Dism.exe","/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%DriversSrc%#$q /recurse /LogPath:#$q%DismLog%#$q%DismForceUnsigned%"
|
||||||
StrFormat,PATH,%Dism.exe%,%Dism.exePath%
|
If,Not,%ExitCode%,Equal,0,Halt,"Error: Dism.exe terminated with error code: [%ExitCode%]. Check the log for details."
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%TargetDir%#$q /Add-Driver /Driver:#$q%DriversSrc%#$q /recurse /LogPath:#$q%DismLog%#$q%DismForceUnsigned%",%Dism.exePath%
|
// Dism doesn't always unload hives correctly. Force unload just to make sure.
|
||||||
If,Not,%ExitCode%,Equal,0,Halt,"Error: Dism.exe terminated with error code: [%ExitCode%]. Check the log for details."
|
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
||||||
// Dism doesn't always unload hives correctly. Force unload just to make sure.
|
|
||||||
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
|
||||||
End
|
|
||||||
Else,Begin
|
|
||||||
// Dism.exe is missing. Run Pre-Flight Check to download.
|
|
||||||
Message,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools.",Warning
|
|
||||||
Halt,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools."
|
|
||||||
End
|
|
||||||
|
|
||||||
[#ExportHostDrivers-ExportHostDrv#]
|
[#ExportHostDrivers-ExportHostDrv#]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
@@ -148,27 +137,17 @@ System,GetEnv,COMPUTERNAME,%hostname%
|
|||||||
Echo,"Exporting Drivers from Host [%hostname%]...#$x#$xThis can take awhile, please be patient."
|
Echo,"Exporting Drivers from Host [%hostname%]...#$x#$xThis can take awhile, please be patient."
|
||||||
|
|
||||||
If,%HostArch%,Equal,x86,Begin
|
If,%HostArch%,Equal,x86,Begin
|
||||||
Set,%Dism.exe%,"%Tools%\x86\DISM\dism.exe"
|
|
||||||
Set,%ExportDest%,"%fb_DriversX86%\Exported-%hostname%"
|
Set,%ExportDest%,"%fb_DriversX86%\Exported-%hostname%"
|
||||||
End
|
End
|
||||||
Else,Begin
|
Else,Begin
|
||||||
Set,%Dism.exe%,"%Tools%\x64\DISM\dism.exe"
|
|
||||||
Set,%ExportDest%,"%fb_DriversX64%\Exported-%hostname%"
|
Set,%ExportDest%,"%fb_DriversX64%\Exported-%hostname%"
|
||||||
End
|
End
|
||||||
|
|
||||||
If,ExistDir,%ExportDest%,DirDeleteEx,%ExportDest%
|
If,ExistDir,%ExportDest%,DirDeleteEx,%ExportDest%
|
||||||
DirMake,%ExportDest%
|
DirMake,%ExportDest%
|
||||||
|
|
||||||
If,ExistFile,%Dism.exe%,Begin
|
// Export Drivers
|
||||||
// Export Drivers
|
ShellExecute,Hide,"Dism.exe","/online /Export-Driver /Destination:#$q%ExportDest%#$q"
|
||||||
StrFormat,PATH,%Dism.exe%,%Dism.exePath%
|
|
||||||
ShellExecute,Hide,%Dism.exe%,"/online /Export-Driver /Destination:#$q%ExportDest%#$q",%Dism.ExePath%
|
|
||||||
End
|
|
||||||
Else,Begin
|
|
||||||
// Dism.exe is missing. Run Pre-Flight Check to download.
|
|
||||||
Message,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools.",Warning
|
|
||||||
Halt,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools."
|
|
||||||
End
|
|
||||||
|
|
||||||
DirSize,%ExportDest%,%DirSize%
|
DirSize,%ExportDest%,%DirSize%
|
||||||
StrFormat,Bytes,%DirSize%,%StrDirSize%
|
StrFormat,Bytes,%DirSize%,%StrDirSize%
|
||||||
|
@@ -35,11 +35,10 @@ Author=Homes32
|
|||||||
Level=7
|
Level=7
|
||||||
Selected=True
|
Selected=True
|
||||||
Mandatory=True
|
Mandatory=True
|
||||||
Version=1.0.1.0
|
Version=1.1.0.0
|
||||||
Date=2019-04-18
|
Date=2021-10-31
|
||||||
|
|
||||||
[Variables]
|
[Variables]
|
||||||
%bcdedit.exe%="%Tools%\%HostArch%\BCDBoot\bcdedit.exe"
|
|
||||||
|
|
||||||
[Process]
|
[Process]
|
||||||
Echo,"Preparing to create bootable ISO file..."
|
Echo,"Preparing to create bootable ISO file..."
|
||||||
@@ -154,33 +153,31 @@ System,EndLocal
|
|||||||
[ConfigBcd]
|
[ConfigBcd]
|
||||||
Echo,"Localizing and Configuring Boot Configuration Data..."
|
Echo,"Localizing and Configuring Boot Configuration Data..."
|
||||||
|
|
||||||
StrFormat,PATH,%bcdedit.exe%,%bcdedit.exePath%
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// BIOS
|
// BIOS
|
||||||
|
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {bootmgr} locale %SourceLang%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {bootmgr} locale %SourceLang%"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {bootmgr} timeout %num_BootMenuDelay%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {bootmgr} timeout %num_BootMenuDelay%"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {bootmgr} displaybootmenu True",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {bootmgr} displaybootmenu True"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {default} locale %SourceLang%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {default} locale %SourceLang%"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {default} description #$q%ProjectTitle% %SourceArch%#$q",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {default} description #$q%ProjectTitle% %SourceArch%#$q"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {memdiag} locale %SourceLang%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {memdiag} locale %SourceLang%"
|
||||||
|
|
||||||
// Show progress bar
|
// Show progress bar
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {default} bootmenupolicy legacy",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {default} bootmenupolicy legacy"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// UEFI
|
// UEFI
|
||||||
|
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {bootmgr} locale %SourceLang%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {bootmgr} locale %SourceLang%"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\Boot\bcd#$q /set {bootmgr} timeout %num_BootMenuDelay%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\Boot\bcd#$q /set {bootmgr} timeout %num_BootMenuDelay%"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\Boot\bcd#$q /set {bootmgr} displaybootmenu True",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\Boot\bcd#$q /set {bootmgr} displaybootmenu True"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {default} locale %SourceLang%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {default} locale %SourceLang%"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {default} description #$q%ProjectTitle% %SourceArch% UEFI#$q",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {default} description #$q%ProjectTitle% %SourceArch% UEFI#$q"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {memdiag} locale %SourceLang%",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {memdiag} locale %SourceLang%"
|
||||||
|
|
||||||
// Show progress bar
|
// Show progress bar
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {default} bootmenupolicy legacy",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q /set {default} bootmenupolicy legacy"
|
||||||
|
|
||||||
[#BypassDriverSigning#]
|
[#BypassDriverSigning#]
|
||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
@@ -195,9 +192,8 @@ ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\boot\bcd#$q
|
|||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
[BypassDriverSigning]
|
[BypassDriverSigning]
|
||||||
If,%SourceArch%,Equal,x64,Begin
|
If,%SourceArch%,Equal,x64,Begin
|
||||||
StrFormat,PATH,%bcdedit.exe%,%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\Boot\bcd#$q /set {default} loadoptions DDISABLE_INTEGRITY_CHECKS"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\Boot\bcd#$q /set {default} loadoptions DDISABLE_INTEGRITY_CHECKS",%bcdedit.exePath%
|
ShellExecute,Hide,"bcdedit.exe","/store #$q%OutputDir%\efi\microsoft\Boot\bcd#$q /set {default} loadoptions DDISABLE_INTEGRITY_CHECKS"
|
||||||
ShellExecute,Hide,%bcdedit.exe%,"/store #$q%OutputDir%\efi\microsoft\Boot\bcd#$q /set {default} loadoptions DDISABLE_INTEGRITY_CHECKS",%bcdedit.exePath%
|
|
||||||
End
|
End
|
||||||
|
|
||||||
[#SetDefaultOptions#]
|
[#SetDefaultOptions#]
|
||||||
|
@@ -50,50 +50,37 @@ Echo,"Enabling Additional Features..."
|
|||||||
StrFormat,PATH,%DismLog%,%DismLogPath%
|
StrFormat,PATH,%DismLog%,%DismLogPath%
|
||||||
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
||||||
|
|
||||||
If,%HostArch%,Equal,x86,Set,%Dism.exe%,"%Tools%\x86\DISM\dism.exe"
|
|
||||||
Else,Set,%Dism.exe%,"%Tools%\x64\DISM\dism.exe"
|
|
||||||
|
|
||||||
// Make sure our source is Read-Write (ie. not a mounted ISO)
|
// Make sure our source is Read-Write (ie. not a mounted ISO)
|
||||||
FileCreateBlank,"%SourceDir%\RW-TEST",NOWARN
|
FileCreateBlank,"%SourceDir%\RW-TEST",NOWARN
|
||||||
If,Not,ExistFile,"%SourceDir%\RW-TEST",Halt,"ERROR: You cannot modify features on Read-Only media."
|
If,Not,ExistFile,"%SourceDir%\RW-TEST",Halt,"ERROR: You cannot modify features on Read-Only media."
|
||||||
FileDelete,"%SourceDir%\RW-TEST"
|
FileDelete,"%SourceDir%\RW-TEST"
|
||||||
|
|
||||||
If,ExistFile,%Dism.exe%,Begin
|
// Mount our install.wim image
|
||||||
// Everything is good. let's get to work.
|
Echo,"Mounting source image [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
||||||
StrFormat,PATH,%Dism.exe%,%Dism.exePath%
|
DirMake,%MountDir%
|
||||||
|
WimMount,%SourceInstallWim%,%SourceInstallWimImage%,%MountDir%,READWRITE
|
||||||
|
|
||||||
// Mount our install.wim image
|
Run,%ScriptFile%,ToggleFx3
|
||||||
Echo,"Mounting source image [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
Run,%ScriptFile%,ToggleFx4
|
||||||
DirMake,%MountDir%
|
Run,%ScriptFile%,ToggleTelentClient
|
||||||
WimMount,%SourceInstallWim%,%SourceInstallWimImage%,%MountDir%,READWRITE
|
Run,%ScriptFile%,ToggleTFTP
|
||||||
|
Run,%ScriptFile%,ToggleLegacyComponents
|
||||||
|
Run,%ScriptFile%,ToggleLinuxSubsystem
|
||||||
|
Run,%ScriptFile%,TogglePrintComponents
|
||||||
|
|
||||||
Run,%ScriptFile%,ToggleFx3
|
// Dism doesn't always unload hives correctly. Force unload just to make sure WimUnmout doesn't freak out.
|
||||||
Run,%ScriptFile%,ToggleFx4
|
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
||||||
Run,%ScriptFile%,ToggleTelentClient
|
Echo,"Committing changes and unmounting source image:#$x [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
||||||
Run,%ScriptFile%,ToggleTFTP
|
WimUnmount,%MountDir%,COMMIT
|
||||||
Run,%ScriptFile%,ToggleLegacyComponents
|
|
||||||
Run,%ScriptFile%,ToggleLinuxSubsystem
|
|
||||||
Run,%ScriptFile%,TogglePrintComponents
|
|
||||||
|
|
||||||
// Dism doesn't always unload hives correctly. Force unload just to make sure WimUnmout doesn't freak out.
|
|
||||||
ShellExecute,Hide,%Tools%\x86\HiveUnload.exe,"/HKLM /Target:%TargetSystem32%\config"
|
|
||||||
Echo,"Committing changes and unmounting source image:#$x [%SourceInstallWim%]...#$x#$xThis can take awhile, please be patient."
|
|
||||||
WimUnmount,%MountDir%,COMMIT
|
|
||||||
End
|
|
||||||
Else,Begin
|
|
||||||
// Dism.exe is missing. Run Pre-Flight Check to download.
|
|
||||||
Message,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools.",Warning
|
|
||||||
Halt,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools."
|
|
||||||
End
|
|
||||||
|
|
||||||
[ToggleSMB1]
|
[ToggleSMB1]
|
||||||
If,%cb_SMBv1%,Equal,True,Begin
|
If,%cb_SMBv1%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: Server Message Block v1..."
|
Echo,"Enabling feature: Server Message Block v1..."
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\System32\drivers\mrxsmb10.sys",Begin
|
If,Not,ExistFile,"%MountDir%\Windows\System32\drivers\mrxsmb10.sys",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol-Client /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol-Client /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol-Server /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol-Server /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol-Deprecation /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:SMB1Protocol-Deprecation /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Server Message Block v1 is already enabled!"
|
Else,Echo,"Server Message Block v1 is already enabled!"
|
||||||
@@ -101,10 +88,10 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: Server Message Block v1..."
|
Echo,"Disabling feature: Server Message Block v1..."
|
||||||
If,ExistFile,"%MountDir%\Windows\System32\drivers\mrxsmb10.sys",Begin
|
If,ExistFile,"%MountDir%\Windows\System32\drivers\mrxsmb10.sys",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol-Client /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol-Client /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol-Server /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol-Server /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol-Deprecation /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:SMB1Protocol-Deprecation /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Server Message Block v1 is already disabled!"
|
Else,Echo,"Server Message Block v1 is already disabled!"
|
||||||
@@ -114,7 +101,7 @@ End
|
|||||||
If,%cb_NetFX3%,Equal,True,Begin
|
If,%cb_NetFX3%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: .NET Framework 3..."
|
Echo,"Enabling feature: .NET Framework 3..."
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
If,Not,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,".NET Framework 3 is already enabled!"
|
Else,Echo,".NET Framework 3 is already enabled!"
|
||||||
@@ -122,7 +109,7 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: .NET Framework 3..."
|
Echo,"Disabling feature: .NET Framework 3..."
|
||||||
If,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
If,ExistFile,"%MountDir%\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:NetFx3 /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:NetFx3 /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,".NET Framework 3 is already disabled!"
|
Else,Echo,".NET Framework 3 is already disabled!"
|
||||||
@@ -132,7 +119,7 @@ End
|
|||||||
If,%cb_NetFX4%,Equal,True,Begin
|
If,%cb_NetFX4%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: .NET Framework 4 Extended..."
|
Echo,"Enabling feature: .NET Framework 4 Extended..."
|
||||||
If,Not,ExistDir,"%MountDir%\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files",Begin
|
If,Not,ExistDir,"%MountDir%\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:NetFx4Extended-ASPNET45 /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:NetFx4Extended-ASPNET45 /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,".NET Framework 4 Extended is already enabled!"
|
Else,Echo,".NET Framework 4 Extended is already enabled!"
|
||||||
@@ -140,7 +127,7 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: .NET Framework 4 Extended..."
|
Echo,"Disabling feature: .NET Framework 4 Extended..."
|
||||||
If,ExistDir,"%MountDir%\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files",Begin
|
If,ExistDir,"%MountDir%\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:NetFx4Extended-ASPNET45 /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:NetFx4Extended-ASPNET45 /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,".NET Framework 4 Extended is already disabled!"
|
Else,Echo,".NET Framework 4 Extended is already disabled!"
|
||||||
@@ -150,7 +137,7 @@ End
|
|||||||
If,%cb_TelentClient%,Equal,True,Begin
|
If,%cb_TelentClient%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: Telnet Client..."
|
Echo,"Enabling feature: Telnet Client..."
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\System32\telnet.exe",Begin
|
If,Not,ExistFile,"%MountDir%\Windows\System32\telnet.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:TelnetClient /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:TelnetClient /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Telnet Client is already enabled!"
|
Else,Echo,"Telnet Client is already enabled!"
|
||||||
@@ -158,7 +145,7 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: Telnet Client..."
|
Echo,"Disabling feature: Telnet Client..."
|
||||||
If,ExistFile,"%MountDir%\Windows\System32\telnet.exe",Begin
|
If,ExistFile,"%MountDir%\Windows\System32\telnet.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:TelnetClient /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:TelnetClient /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Telnet Client is already disabled!"
|
Else,Echo,"Telnet Client is already disabled!"
|
||||||
@@ -168,7 +155,7 @@ End
|
|||||||
If,%cb_TFTP%,Equal,True,Begin
|
If,%cb_TFTP%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: TFTP..."
|
Echo,"Enabling feature: TFTP..."
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\System32\tftp.exe",Begin
|
If,Not,ExistFile,"%MountDir%\Windows\System32\tftp.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:TFTP /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:TFTP /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"TFTP is already enabled!"
|
Else,Echo,"TFTP is already enabled!"
|
||||||
@@ -176,7 +163,7 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: TFTP Client..."
|
Echo,"Disabling feature: TFTP Client..."
|
||||||
If,ExistFile,"%MountDir%\Windows\System32\tftp.exe",Begin
|
If,ExistFile,"%MountDir%\Windows\System32\tftp.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:TFTP /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:TFTP /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"TFTP Client is already disabled!"
|
Else,Echo,"TFTP Client is already disabled!"
|
||||||
@@ -186,7 +173,7 @@ End
|
|||||||
If,%cb_Linux%,Equal,True,Begin
|
If,%cb_Linux%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: Legacy Components (DirectPlay)..."
|
Echo,"Enabling feature: Legacy Components (DirectPlay)..."
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\System32\bash.exe",Begin
|
If,Not,ExistFile,"%MountDir%\Windows\System32\bash.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:LegacyComponents /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:LegacyComponents /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Legacy Components (DirectPlay) are already enabled!"
|
Else,Echo,"Legacy Components (DirectPlay) are already enabled!"
|
||||||
@@ -194,7 +181,7 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: Legacy Components (DirectPlay)..."
|
Echo,"Disabling feature: Legacy Components (DirectPlay)..."
|
||||||
If,ExistFile,"%MountDir%\Windows\System32\bash.exe",Begin
|
If,ExistFile,"%MountDir%\Windows\System32\bash.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:LegacyComponents /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:LegacyComponents /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Legacy Components (DirectPlay) is already disabled!"
|
Else,Echo,"Legacy Components (DirectPlay) is already disabled!"
|
||||||
@@ -204,7 +191,7 @@ End
|
|||||||
If,%cb_Linux%,Equal,True,Begin
|
If,%cb_Linux%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: Linux Subsystem..."
|
Echo,"Enabling feature: Linux Subsystem..."
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\System32\bash.exe",Begin
|
If,Not,ExistFile,"%MountDir%\Windows\System32\bash.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Linux Subsystem is already enabled!"
|
Else,Echo,"Linux Subsystem is already enabled!"
|
||||||
@@ -212,7 +199,7 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: Linux Subsystem..."
|
Echo,"Disabling feature: Linux Subsystem..."
|
||||||
If,ExistFile,"%MountDir%\Windows\System32\bask.exe",Begin
|
If,ExistFile,"%MountDir%\Windows\System32\bask.exe",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Linux Subsystem is already disabled!"
|
Else,Echo,"Linux Subsystem is already disabled!"
|
||||||
@@ -222,8 +209,8 @@ End
|
|||||||
If,%cb_Print%,Equal,True,Begin
|
If,%cb_Print%,Equal,True,Begin
|
||||||
Echo,"Enabling feature: Print Components..."
|
Echo,"Enabling feature: Print Components..."
|
||||||
If,Not,ExistFile,"%MountDir%\Windows\System32\lpdsvc.dll",Begin
|
If,Not,ExistFile,"%MountDir%\Windows\System32\lpdsvc.dll",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:Printing-Foundation-LPDPrintService /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:Printing-Foundation-LPDPrintService /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:Printing-Foundation-LPRPortMonitor /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Enable-Feature /FeatureName:Printing-Foundation-LPRPortMonitor /All /LimitAccess /Source:#$q%SourceDir%\Sources\sxs#$q /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Print Components are already installed!"
|
Else,Echo,"Print Components are already installed!"
|
||||||
@@ -231,8 +218,8 @@ End
|
|||||||
Else,Begin
|
Else,Begin
|
||||||
Echo,"Disabling feature: Print Components..."
|
Echo,"Disabling feature: Print Components..."
|
||||||
If,ExistFile,"%MountDir%\Windows\System32\lpdsvc.dll",Begin
|
If,ExistFile,"%MountDir%\Windows\System32\lpdsvc.dll",Begin
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:Printing-Foundation-LPDPrintService /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:Printing-Foundation-LPDPrintService /LogPath:#$q%DismLog%#$q"
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:Printing-Foundation-LPRPortMonitor /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"Dism.exe","/image:#$q%MountDir%#$q /Disable-Feature /FeatureName:Printing-Foundation-LPRPortMonitor /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
If,Not,%ExitCode%,Equal,0,Run,%ScriptFile%,Abort
|
||||||
End
|
End
|
||||||
Else,Echo,"Print Components are already disabled!"
|
Else,Echo,"Print Components are already disabled!"
|
||||||
|
@@ -40,8 +40,8 @@ Author=Homes32
|
|||||||
Level=4
|
Level=4
|
||||||
Selected=True
|
Selected=True
|
||||||
Mandatory=False
|
Mandatory=False
|
||||||
Version=1.2.0.0
|
Version=1.3.0.0
|
||||||
Date=2019-05-03
|
Date=2021-10-31
|
||||||
|
|
||||||
[Variables]
|
[Variables]
|
||||||
%DismLog%="%TargetWindows%\Logs\DISM\dism.log"
|
%DismLog%="%TargetWindows%\Logs\DISM\dism.log"
|
||||||
@@ -84,16 +84,6 @@ StrFormat,CTRIM,%TimeZone%," ",%TimeZone%
|
|||||||
StrFormat,PATH,%DismLog%,%DismLogPath%
|
StrFormat,PATH,%DismLog%,%DismLogPath%
|
||||||
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
If,Not,ExistDir,%DismLogPath%,DirMake,%DismLogPath%
|
||||||
|
|
||||||
If,%HostArch%,Equal,x86,Set,%Dism.exe%,"%Tools%\x86\DISM\dism.exe"
|
|
||||||
Else,Set,%Dism.exe%,"%Tools%\x64\DISM\dism.exe"
|
|
||||||
|
|
||||||
If,Not,ExistFile,%Dism.exe%,Begin
|
|
||||||
// Dism.exe is missing. Prompt the user to run Pre-Flight Check to download.
|
|
||||||
Message,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools.",Warning
|
|
||||||
Halt,"Error: Dism.exe is missing from the [%Tools%] directory. Please run Pre-Flight Check first to download the required tools."
|
|
||||||
End
|
|
||||||
Else,StrFormat,PATH,%Dism.exe%,%Dism.exePath%
|
|
||||||
|
|
||||||
// Get HostOS Settings if needed
|
// Get HostOS Settings if needed
|
||||||
If,%cmb_InputLocale1%,Equal,HostOS,Run,%ScriptFile%,GetHostInternationalSettings
|
If,%cmb_InputLocale1%,Equal,HostOS,Run,%ScriptFile%,GetHostInternationalSettings
|
||||||
Else,If,%cmb_InputLocale2%,Equal,HostOS,Run,%ScriptFile%,GetHostInternationalSettings
|
Else,If,%cmb_InputLocale2%,Equal,HostOS,Run,%ScriptFile%,GetHostInternationalSettings
|
||||||
@@ -125,7 +115,7 @@ If,%cb_PinToStartMenu%,Equal,True,PinShortcut,StartMenu,Auto,"%WinDir%\System32\
|
|||||||
// ===============================================================================================================================
|
// ===============================================================================================================================
|
||||||
[GetHostInternationalSettings]
|
[GetHostInternationalSettings]
|
||||||
Echo,"Retrieving Host International Settings...#$x#$xThis can take awhile, please be patient."
|
Echo,"Retrieving Host International Settings...#$x#$xThis can take awhile, please be patient."
|
||||||
ShellExecute,Hide,"cmd.exe","/D /C %Dism.exe% /online /Get-Intl /English /LogPath:#$q%DismLog%#$q > #$q%ProjectTemp%\Get-Intl.ini#$q",%Dism.exePath%
|
ShellExecute,Hide,"cmd.exe","/D /C dism.exe /online /Get-Intl /English /LogPath:#$q%DismLog%#$q > #$q%ProjectTemp%\Get-Intl.ini#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Halt,"Error: Dism.exe terminated with error code: [%ExitCode%]. Check the log for details."
|
If,Not,%ExitCode%,Equal,0,Halt,"Error: Dism.exe terminated with error code: [%ExitCode%]. Check the log for details."
|
||||||
|
|
||||||
If,ExistFile,"%ProjectTemp%\Get-Intl.ini",Begin
|
If,ExistFile,"%ProjectTemp%\Get-Intl.ini",Begin
|
||||||
@@ -174,7 +164,7 @@ If,Not,%TimeZone%,Equal,Default,Set,%DismArg%,"%DismArg% /Set-TimeZone:#$q%TimeZ
|
|||||||
// Set Keyboard, Format and Timezone with DISM
|
// Set Keyboard, Format and Timezone with DISM
|
||||||
If,Not,%DismArg%,Equal,"",Begin
|
If,Not,%DismArg%,Equal,"",Begin
|
||||||
Echo,"Configuring International Settings...#$x#$xThis can take awhile, please be patient."
|
Echo,"Configuring International Settings...#$x#$xThis can take awhile, please be patient."
|
||||||
ShellExecute,Hide,%Dism.exe%,"/image:#$q%TargetDir%#$q %DismArg% /LogPath:#$q%DismLog%#$q",%Dism.exePath%
|
ShellExecute,Hide,"dism.exe","/image:#$q%TargetDir%#$q %DismArg% /LogPath:#$q%DismLog%#$q"
|
||||||
If,Not,%ExitCode%,Equal,0,Halt,"Error: Dism.exe terminated with error code: [%ExitCode%]. Check the log for details."
|
If,Not,%ExitCode%,Equal,0,Halt,"Error: Dism.exe terminated with error code: [%ExitCode%]. Check the log for details."
|
||||||
End
|
End
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user