Compare commits

...

22 Commits

Author SHA1 Message Date
832f08c18b Automatic conversion of ESD files
Automatically convert the install.esd file from installation media into a WIM file that can be mounted, then delete the ESD file
2024-03-02 14:00:45 +01:00
a37e435949 Merge branch 'test-2024-02-07-refactor-noapps' into CW-MicroWin 2024-02-21 19:24:11 -06:00
2fbe40a3ee Update files
Updated the Test-CompatibleImage function to compare against a desired version, which is useful for determining if the Specialize pass needs to be added to the unattended answer file
2024-02-09 20:03:05 +01:00
42d13ad735 Merge branch 'test-2024-02-07-refactor-noapps' into CW-MicroWin 2024-02-09 15:57:27 +01:00
744fee6c40 Improve detection for Professional editions 2024-02-02 20:45:31 +01:00
6d4db7dc7a Merge branch 'test-2024-01-30' into CW-MicroWin 2024-02-02 16:29:07 +01:00
32e98c0264 Compile Winutil 2024-02-01 23:04:41 +00:00
26e117c5bf Choosing Alternate Scartch Path and Busy Messages
* Choosing Alternate Scartch Path and Busy Messages

* Change Selected index to be pro
2024-02-01 17:04:17 -06:00
1d35d06c84 Compile Winutil 2024-02-01 22:41:58 +00:00
8069364777 tweaks and fetures tabs clean up automation from inputXML.xaml
* tweaks and fetures tabs clean up automation from inputXML.xaml

* fixed some commas in tweaks.json file

* recompile

* Update tweaks.json
2024-02-01 16:41:36 -06:00
bac37a186b Compile Winutil 2024-02-01 22:25:13 +00:00
090aecc8b0 Remove Nano-Removed bugged Nano package for now
* Remove Nano

-Removed bugged Nano package for now
2024-02-01 16:24:51 -06:00
9a58c9e70e Compile Winutil 2024-02-01 22:23:07 +00:00
5248954e77 Fix Broken Link and add syncthingtray (#1508) 2024-02-01 16:22:45 -06:00
367485c993 Compile Winutil 2024-02-01 22:20:25 +00:00
440f8922bb applications.jsonAdded Foxit Reader app and updated Foxit Editor to show the difference.
* applications.json

Added Foxit Reader app and updated Foxit Editor to show the difference.
2024-02-01 16:19:54 -06:00
369f8a6179 Merge branch 'test-2024-01-25' into CW-MicroWin 2024-01-30 09:10:01 -06:00
6ebf40d373 Compile Winutil 2024-01-30 14:42:42 +00:00
739bb49796 Update screen-install.png (#1464) 2024-01-30 08:42:21 -06:00
c34c804037 Update files
- Add detections for whether the image to be processed by MicroWin is Windows 10 or later
- Add procedure to clear the indexes ComboBox (WinForms term) every time an ISO is specified
2024-01-27 21:43:35 +01:00
aed92704a8 Compile Winutil 2024-01-26 14:40:01 +00:00
b659acb3b3 Update applications.json
Fake app add made by linux fanboy
2024-01-26 08:39:29 -06:00
4 changed files with 116 additions and 36 deletions

View File

@ -18,28 +18,23 @@ function Test-CompatibleImage() {
<# <#
.SYNOPSIS .SYNOPSIS
Checks the version of a Windows image and determines whether or not it is compatible depending on the Major property Checks the version of a Windows image and determines whether or not it is compatible with a specific feature depending on a desired version
.PARAMETER imgVersion .PARAMETER Name
The version of the Windows image imgVersion - The version of the Windows image
desiredVersion - The version to compare the image version with
#> #>
param param
( (
[Parameter(Mandatory = $true)] [string] $imgVersion [Parameter(Mandatory = $true, Position=0)] [string] $imgVersion,
[Parameter(Mandatory = $true, Position=1)] [Version] $desiredVersion
) )
try { try {
$version = [Version]$imgVersion $version = [Version]$imgVersion
if ($version.Major -ge 10) return $version -ge $desiredVersion
{
return $True
}
else
{
return $False
}
} catch { } catch {
return $False return $False
} }
@ -247,7 +242,7 @@ function Remove-FileOrDirectory([string] $pathToDelete, [string] $mask = "", [sw
foreach($itemToDelete in $itemsToDelete) foreach($itemToDelete in $itemsToDelete)
{ {
$status = "Deleteing $($itemToDelete)" $status = "Deleting $($itemToDelete)"
Write-Progress -Activity "Removing Items" -Status $status -PercentComplete ($counter++/$itemsToDelete.Count*100) Write-Progress -Activity "Removing Items" -Status $status -PercentComplete ($counter++/$itemsToDelete.Count*100)
if (Test-Path -Path "$($itemToDelete)" -PathType Container) if (Test-Path -Path "$($itemToDelete)" -PathType Container)
@ -321,7 +316,7 @@ function New-Unattend {
<unattend xmlns="urn:schemas-microsoft-com:unattend" <unattend xmlns="urn:schemas-microsoft-com:unattend"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<#REPLACEME#>
<settings pass="auditUser"> <settings pass="auditUser">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous> <RunSynchronous>
@ -362,6 +357,26 @@ function New-Unattend {
</settings> </settings>
</unattend> </unattend>
'@ '@
$specPass = @'
<settings pass="specialize">
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ConfigureChatAutoInstall>false</ConfigureChatAutoInstall>
</component>
</settings>
'@
if ((Test-CompatibleImage $imgVersion $([System.Version]::new(10,0,22000,1))) -eq $false)
{
# Replace the placeholder text with an empty string to make it valid for Windows 10 Setup
$unattend = $unattend.Replace("<#REPLACEME#>", "").Trim()
}
else
{
# Replace the placeholder text with the Specialize pass
$unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim()
}
$unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force $unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force
} }

View File

@ -160,13 +160,18 @@ function Invoke-WPFGetIso {
$wimFile = "$mountDir\sources\install.wim" $wimFile = "$mountDir\sources\install.wim"
Write-Host "Getting image information $wimFile" Write-Host "Getting image information $wimFile"
if (-not (Test-Path -Path $wimFile -PathType Leaf)) if ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (-not (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf)))
{ {
$msg = "Install.wim file doesn't exist in the image, this could happen if you use unofficial Windows images, or a Media creation tool, which creates a final image that can not be modified. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/" $msg = "Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/"
Write-Host $msg Write-Host $msg
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error) [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
throw throw
} }
elseif ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf))
{
Write-Host "Install.esd found on the image. It needs to be converted to a WIM file in order to begin processing"
$wimFile = $wimFile.Replace(".wim", ".esd").Trim()
}
$sync.MicrowinWindowsFlavors.Items.Clear() $sync.MicrowinWindowsFlavors.Items.Clear()
Get-WindowsImage -ImagePath $wimFile | ForEach-Object { Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
$imageIdx = $_.ImageIndex $imageIdx = $_.ImageIndex

View File

@ -57,10 +57,30 @@ public class PowerManagement {
$mountDir = $sync.MicrowinMountDir.Text $mountDir = $sync.MicrowinMountDir.Text
$scratchDir = $sync.MicrowinScratchDir.Text $scratchDir = $sync.MicrowinScratchDir.Text
# Detect if the Windows image is an ESD file and convert it to WIM
if (-not (Test-Path -Path $mountDir\sources\install.wim -PathType Leaf) -and (Test-Path -Path $mountDir\sources\install.esd -PathType Leaf))
{
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
Export-WindowsImage -SourceImagePath $mountDir\sources\install.esd -SourceIndex $index -DestinationImagePath $mountDir\sources\install.wim -CompressionType "Max"
if ($?)
{
Remove-Item -Path $mountDir\sources\install.esd -Force
# Since we've already exported the image index we wanted, switch to the first one
$index = 1
}
else
{
$msg = "The export process has failed and MicroWin processing cannot continue"
Write-Host "Failed to export the image"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
return
}
}
$imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version $imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version
# Detect image version to avoid performing MicroWin processing on Windows 8 and earlier # Detect image version to avoid performing MicroWin processing on Windows 8 and earlier
if ((Test-CompatibleImage $imgVersion) -eq $false) if ((Test-CompatibleImage $imgVersion $([System.Version]::new(10,0,10240,0))) -eq $false)
{ {
$msg = "This image is not compatible with MicroWin processing. Make sure it isn't a Windows 8 or earlier image." $msg = "This image is not compatible with MicroWin processing. Make sure it isn't a Windows 8 or earlier image."
$dlg_msg = $msg + "`n`nIf you want more information, the version of the image selected is $($imgVersion)`n`nIf an image has been incorrectly marked as incompatible, report an issue to the developers." $dlg_msg = $msg + "`n`nIf you want more information, the version of the image selected is $($imgVersion)`n`nIf an image has been incorrectly marked as incompatible, report an issue to the developers."

View File

@ -10,7 +10,7 @@
Author : Chris Titus @christitustech Author : Chris Titus @christitustech
Runspace Author: @DeveloperDurp Runspace Author: @DeveloperDurp
GitHub : https://github.com/ChrisTitusTech GitHub : https://github.com/ChrisTitusTech
Version : 24.02.22 Version : 24.03.02
#> #>
param ( param (
[switch]$Debug, [switch]$Debug,
@ -47,7 +47,7 @@ Add-Type -AssemblyName System.Windows.Forms
# Variable to sync between runspaces # Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{}) $sync = [Hashtable]::Synchronized(@{})
$sync.PSScriptRoot = $PSScriptRoot $sync.PSScriptRoot = $PSScriptRoot
$sync.version = "24.02.22" $sync.version = "24.03.02"
$sync.configs = @{} $sync.configs = @{}
$sync.ProcessRunning = $false $sync.ProcessRunning = $false
@ -751,28 +751,23 @@ function Test-CompatibleImage() {
<# <#
.SYNOPSIS .SYNOPSIS
Checks the version of a Windows image and determines whether or not it is compatible depending on the Major property Checks the version of a Windows image and determines whether or not it is compatible with a specific feature depending on a desired version
.PARAMETER imgVersion .PARAMETER Name
The version of the Windows image imgVersion - The version of the Windows image
desiredVersion - The version to compare the image version with
#> #>
param param
( (
[Parameter(Mandatory = $true)] [string] $imgVersion [Parameter(Mandatory = $true, Position=0)] [string] $imgVersion,
[Parameter(Mandatory = $true, Position=1)] [Version] $desiredVersion
) )
try { try {
$version = [Version]$imgVersion $version = [Version]$imgVersion
if ($version.Major -ge 10) return $version -ge $desiredVersion
{
return $True
}
else
{
return $False
}
} catch { } catch {
return $False return $False
} }
@ -980,7 +975,7 @@ function Remove-FileOrDirectory([string] $pathToDelete, [string] $mask = "", [sw
foreach($itemToDelete in $itemsToDelete) foreach($itemToDelete in $itemsToDelete)
{ {
$status = "Deleteing $($itemToDelete)" $status = "Deleting $($itemToDelete)"
Write-Progress -Activity "Removing Items" -Status $status -PercentComplete ($counter++/$itemsToDelete.Count*100) Write-Progress -Activity "Removing Items" -Status $status -PercentComplete ($counter++/$itemsToDelete.Count*100)
if (Test-Path -Path "$($itemToDelete)" -PathType Container) if (Test-Path -Path "$($itemToDelete)" -PathType Container)
@ -1054,7 +1049,7 @@ function New-Unattend {
<unattend xmlns="urn:schemas-microsoft-com:unattend" <unattend xmlns="urn:schemas-microsoft-com:unattend"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<#REPLACEME#>
<settings pass="auditUser"> <settings pass="auditUser">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous> <RunSynchronous>
@ -1095,6 +1090,26 @@ function New-Unattend {
</settings> </settings>
</unattend> </unattend>
'@ '@
$specPass = @'
<settings pass="specialize">
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ConfigureChatAutoInstall>false</ConfigureChatAutoInstall>
</component>
</settings>
'@
if ((Test-CompatibleImage $imgVersion $([System.Version]::new(10,0,22000,1))) -eq $false)
{
# Replace the placeholder text with an empty string to make it valid for Windows 10 Setup
$unattend = $unattend.Replace("<#REPLACEME#>", "").Trim()
}
else
{
# Replace the placeholder text with the Specialize pass
$unattend = $unattend.Replace("<#REPLACEME#>", $specPass).Trim()
}
$unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force $unattend | Out-File -FilePath "$env:temp\unattend.xml" -Force
} }
@ -3193,13 +3208,18 @@ function Invoke-WPFGetIso {
$wimFile = "$mountDir\sources\install.wim" $wimFile = "$mountDir\sources\install.wim"
Write-Host "Getting image information $wimFile" Write-Host "Getting image information $wimFile"
if (-not (Test-Path -Path $wimFile -PathType Leaf)) if ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (-not (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf)))
{ {
$msg = "Install.wim file doesn't exist in the image, this could happen if you use unofficial Windows images, or a Media creation tool, which creates a final image that can not be modified. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/" $msg = "Neither install.wim nor install.esd exist in the image, this could happen if you use unofficial Windows images. Please don't use shady images from the internet, use only official images. Here are instructions how to download ISO images if the Microsoft website is not showing the link to download and ISO. https://www.techrepublic.com/article/how-to-download-a-windows-10-iso-file-without-using-the-media-creation-tool/"
Write-Host $msg Write-Host $msg
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error) [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
throw throw
} }
elseif ((-not (Test-Path -Path $wimFile -PathType Leaf)) -and (Test-Path -Path $wimFile.Replace(".wim", ".esd").Trim() -PathType Leaf))
{
Write-Host "Install.esd found on the image. It needs to be converted to a WIM file in order to begin processing"
$wimFile = $wimFile.Replace(".wim", ".esd").Trim()
}
$sync.MicrowinWindowsFlavors.Items.Clear() $sync.MicrowinWindowsFlavors.Items.Clear()
Get-WindowsImage -ImagePath $wimFile | ForEach-Object { Get-WindowsImage -ImagePath $wimFile | ForEach-Object {
$imageIdx = $_.ImageIndex $imageIdx = $_.ImageIndex
@ -3427,10 +3447,30 @@ public class PowerManagement {
$mountDir = $sync.MicrowinMountDir.Text $mountDir = $sync.MicrowinMountDir.Text
$scratchDir = $sync.MicrowinScratchDir.Text $scratchDir = $sync.MicrowinScratchDir.Text
# Detect if the Windows image is an ESD file and convert it to WIM
if (-not (Test-Path -Path $mountDir\sources\install.wim -PathType Leaf) -and (Test-Path -Path $mountDir\sources\install.esd -PathType Leaf))
{
Write-Host "Exporting Windows image to a WIM file, keeping the index we want to work on. This can take several minutes, depending on the performance of your computer..."
Export-WindowsImage -SourceImagePath $mountDir\sources\install.esd -SourceIndex $index -DestinationImagePath $mountDir\sources\install.wim -CompressionType "Max"
if ($?)
{
Remove-Item -Path $mountDir\sources\install.esd -Force
# Since we've already exported the image index we wanted, switch to the first one
$index = 1
}
else
{
$msg = "The export process has failed and MicroWin processing cannot continue"
Write-Host "Failed to export the image"
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
return
}
}
$imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version $imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version
# Detect image version to avoid performing MicroWin processing on Windows 8 and earlier # Detect image version to avoid performing MicroWin processing on Windows 8 and earlier
if ((Test-CompatibleImage $imgVersion) -eq $false) if ((Test-CompatibleImage $imgVersion $([System.Version]::new(10,0,10240,0))) -eq $false)
{ {
$msg = "This image is not compatible with MicroWin processing. Make sure it isn't a Windows 8 or earlier image." $msg = "This image is not compatible with MicroWin processing. Make sure it isn't a Windows 8 or earlier image."
$dlg_msg = $msg + "`n`nIf you want more information, the version of the image selected is $($imgVersion)`n`nIf an image has been incorrectly marked as incompatible, report an issue to the developers." $dlg_msg = $msg + "`n`nIf you want more information, the version of the image selected is $($imgVersion)`n`nIf an image has been incorrectly marked as incompatible, report an issue to the developers."