diff --git a/FFUDevelopment/Apps/InstallAppsandSysprep.cmd b/FFUDevelopment/Apps/InstallAppsandSysprep.cmd
index 2178783..aba7da8 100644
--- a/FFUDevelopment/Apps/InstallAppsandSysprep.cmd
+++ b/FFUDevelopment/Apps/InstallAppsandSysprep.cmd
@@ -30,11 +30,8 @@ for /d %%D in ("%basepath%\*") do (
)
)
)
- @REM for %%F in ("!appfolder!\*.xml") do (
- @REM set "licensefile=%%F"
- @REM )
if defined mainpackage (
- set "dism_command=DISM /Online /Add-ProvisionedAppxPackage /PackagePath:"!mainpackage!""
+ set "dism_command=DISM /Online /Add-ProvisionedAppxPackage /PackagePath:"!mainpackage!" /Region:all /StubPackageOption:installfull"
if exist "!dependenciesfolder!" (
for %%G in ("!dependenciesfolder!\*") do (
set "dism_command=!dism_command! /DependencyPackagePath:"%%G""
@@ -48,7 +45,6 @@ for /d %%D in ("%basepath%\*") do (
) else (
set "dism_command=!dism_command! /SkipLicense"
)
- set "dism_command=!dism_command! /Region:All"
echo !dism_command!
!dism_command!
)
diff --git a/FFUDevelopment/BuildFFUVM.ps1 b/FFUDevelopment/BuildFFUVM.ps1
index 68cc570..7829a3f 100644
--- a/FFUDevelopment/BuildFFUVM.ps1
+++ b/FFUDevelopment/BuildFFUVM.ps1
@@ -336,7 +336,7 @@ param(
[bool]$AllowExternalHardDiskMedia,
[bool]$PromptExternalHardDiskMedia = $true
)
-$version = '2409.1'
+$version = '2409.2'
#Check if Hyper-V feature is installed (requires only checks the module)
$osInfo = Get-WmiObject -Class Win32_OperatingSystem
@@ -541,6 +541,163 @@ function Start-BitsTransferWithRetry {
return $false
}
+# function Get-MicrosoftDrivers {
+# param (
+# [string]$Make,
+# [string]$Model,
+# [int]$WindowsRelease
+# )
+
+# $url = "https://support.microsoft.com/en-us/surface/download-drivers-and-firmware-for-surface-09bb2e09-2a4b-cb69-0951-078a7739e120"
+
+# # Download the webpage content
+# WriteLog "Getting Surface driver information from $url"
+# $OriginalVerbosePreference = $VerbosePreference
+# $VerbosePreference = 'SilentlyContinue'
+# $webContent = Invoke-WebRequest -Uri $url -UseBasicParsing -Headers $Headers -UserAgent $UserAgent
+# $VerbosePreference = $OriginalVerbosePreference
+# WriteLog "Complete"
+
+# # Parse the content of the relevant nested divs
+# WriteLog "Parsing web content for models and download links"
+# $html = $webContent.Content
+# $nestedDivPattern = '
(.*?)
'
+# $nestedDivMatches = [regex]::Matches($html, $nestedDivPattern, [System.Text.RegularExpressions.RegexOptions]::Singleline)
+
+# $models = @()
+# $modelPattern = '(.*?)
\s*\s*\s* \s*window.__DLCDetails__={(.*?)}'
+# $scriptMatch = [regex]::Match($downloadPageContent.Content, $scriptPattern)
+
+# if ($scriptMatch.Success) {
+# $scriptContent = $scriptMatch.Groups[1].Value
+
+# # Extract the download file information from the script tag
+# $downloadFilePattern = '"name":"(.*?)",.*?"url":"(.*?)"'
+# $downloadFileMatches = [regex]::Matches($scriptContent, $downloadFilePattern)
+
+# $downloadLink = $null
+# foreach ($downloadFile in $downloadFileMatches) {
+# $fileName = $downloadFile.Groups[1].Value
+# $fileUrl = $downloadFile.Groups[2].Value
+
+# if ($fileName -match "Win$WindowsRelease") {
+# $downloadLink = $fileUrl
+# break
+# }
+# }
+
+# if ($downloadLink) {
+# WriteLog "Download Link for Windows ${WindowsRelease}: $downloadLink"
+
+# # Create directory structure
+# if (-not (Test-Path -Path $DriversFolder)) {
+# WriteLog "Creating Drivers folder: $DriversFolder"
+# New-Item -Path $DriversFolder -ItemType Directory -Force | Out-Null
+# WriteLog "Drivers folder created"
+# }
+# $surfaceDriversPath = Join-Path -Path $DriversFolder -ChildPath $Make
+# $modelPath = Join-Path -Path $surfaceDriversPath -ChildPath $Model
+# if (-Not (Test-Path -Path $modelPath)) {
+# WriteLog "Creating model folder: $modelPath"
+# New-Item -Path $modelPath -ItemType Directory | Out-Null
+# WriteLog "Complete"
+# }
+
+# # Download the file
+# $filePath = Join-Path -Path $surfaceDriversPath -ChildPath ($fileName)
+# WriteLog "Downloading $Model driver file to $filePath"
+# Start-BitsTransferWithRetry -Source $downloadLink -Destination $filePath
+# WriteLog "Download complete"
+
+# # Determine file extension
+# $fileExtension = [System.IO.Path]::GetExtension($filePath).ToLower()
+
+# if ($fileExtension -eq ".msi") {
+# # Extract the MSI file using an administrative install
+# WriteLog "Extracting MSI file to $modelPath"
+# $arguments = "/a `"$($filePath)`" /qn TARGETDIR=`"$($modelPath)`""
+# Invoke-Process -FilePath "msiexec.exe" -ArgumentList $arguments
+# WriteLog "Extraction complete"
+# } elseif ($fileExtension -eq ".zip") {
+# # Extract the ZIP file
+# WriteLog "Extracting ZIP file to $modelPath"
+# $ProgressPreference = 'SilentlyContinue'
+# Expand-Archive -Path $filePath -DestinationPath $modelPath -Force
+# $ProgressPreference = 'Continue'
+# WriteLog "Extraction complete"
+# } else {
+# WriteLog "Unsupported file type: $fileExtension"
+# }
+# # Remove the downloaded file
+# WriteLog "Removing $filePath"
+# Remove-Item -Path $filePath -Force
+# WriteLog "Complete"
+# } else {
+# WriteLog "No download link found for Windows $WindowsRelease."
+# }
+# } else {
+# WriteLog "Failed to parse the download page for the MSI file."
+# }
+# }
function Get-MicrosoftDrivers {
param (
[string]$Make,
@@ -558,23 +715,39 @@ function Get-MicrosoftDrivers {
$VerbosePreference = $OriginalVerbosePreference
WriteLog "Complete"
- # Parse the content of the relevant nested divs
+ # Parse the HTML content
WriteLog "Parsing web content for models and download links"
$html = $webContent.Content
- $nestedDivPattern = '(.*?) '
- $nestedDivMatches = [regex]::Matches($html, $nestedDivPattern, [System.Text.RegularExpressions.RegexOptions]::Singleline)
+ $document = New-Object -ComObject "HTMLFILE"
+ $document.IHTMLDocument2_write($html)
+ $document.Close()
$models = @()
- $modelPattern = '(.*?) \s* | \s*\s* \s* |