Correction de la façon de désactiver Bitlocker

Désactivation du délai écran noir sur secteur
Suppression de unattend.xml qui reste par endroit avec le mot de passe admin
Mise en place du numéro de version dans le pied de page à droite.
Reste à finaliser le contrôle de mise à jour disponible.
This commit is contained in:
benoit committed 2026-10-19 20:44:58 +02:00
1 parent 5a121718d4
commit a765701fed
8 files changed
+251 -21

No files matched your search

+54 -3
View File
@@ -39,6 +39,8 @@ $script:AutoInstallParameters = @{
}
$script:DeploymentAttempted = $false
$script:ExitCode = 0
$script:ApplicationVersion = '1.0.1'
$script:GiteaReleaseApiUrl = 'https://git.blorand.org/api/v1/repos/benoit/DeployCenter/releases/latest'
$ErrorActionPreference = "Stop"
$localizationModulePath = Join-Path $PSScriptRoot 'Modules\Localization.psm1'
@@ -78,6 +80,7 @@ if (-not (Test-Path -LiteralPath $uiModulePath -PathType Leaf)) { throw "UI modu
Import-Module (Join-Path $PSScriptRoot "Modules\Configuration.psm1") -Force
Import-Module (Join-Path $PSScriptRoot "Modules\HardwareInventory.psm1") -Force
Import-Module (Join-Path $PSScriptRoot "Modules\DriverManagement.psm1") -Force
Import-Module (Join-Path $PSScriptRoot "Modules\VersionCheck.psm1") -Force
# GroupBox is drawn by DeployCenter so its background and border follow the themes.
if (-not ([System.Management.Automation.PSTypeName]'DeployCenter.ThemedGroupBox').Type) {
@@ -597,8 +600,10 @@ $script:form.Controls.Add($script:btnLog)
$script:form.Controls.Add($script:btnRefresh)
$script:form.Controls.Add($script:btnDeploy)
$script:form.Controls.Add($script:btnClose)
Add-SessionFooter -TargetForm $script:form -Theme $script:Theme -Font $script:FontSmall `
-IPv4 $script:DeployIPv4 -VncPassword $script:VncPassword -ShowPassword $true
$mainFooter = Add-SessionFooter -TargetForm $script:form -Theme $script:Theme -Font $script:FontSmall `
-IPv4 $script:DeployIPv4 -VncPassword $script:VncPassword -ShowPassword $true `
-ShowVersion $true -ApplicationVersion $script:ApplicationVersion
$script:VersionFooterLabel = $mainFooter.VersionLabel
# ============================================================
# APPLY THE THEME TO ALL CONTROLS
@@ -914,7 +919,8 @@ $script:btnDeploy.Add_Click({
-Theme $script:Theme -Font $script:FontRegular -FooterFont $script:FontSmall `
-TitleFont $script:FontTitle -SubtitleFont $script:FontSubtitle `
-Steps $deploymentSteps -Owner $script:form -LogoImage $(if ($script:pictureLogo) { $script:pictureLogo.Image } else { $null }) -Windowed:$script:Windowed `
-IPv4 $script:DeployIPv4 -VncPassword $script:VncPassword
-IPv4 $script:DeployIPv4 -VncPassword $script:VncPassword `
-HardwareInfo $script:HardwareInventory
$script:DeploymentAttempted = $true
$script:form.Enabled = $false
try {
@@ -1093,6 +1099,44 @@ $script:form.Add_Shown({
# Use the real maximized client width to position the theme button.
Update-DeployCenterLayout
$script:cmbTheme.BringToFront()
try {
$script:VersionCheck = Start-DeployCenterVersionCheck `
-CurrentVersion $script:ApplicationVersion `
-ReleaseApiUrl $script:GiteaReleaseApiUrl
if ($null -ne $script:VersionCheck) {
$script:VersionCheckStarted = [Diagnostics.Stopwatch]::StartNew()
$script:VersionCheckTimer = New-Object System.Windows.Forms.Timer
$script:VersionCheckTimer.Interval = 250
# $script:VersionCheckTimer.Add_Tick({
# if ($null -eq $script:VersionCheck -or $script:VersionCheck.Completed) {
# $script:VersionCheckTimer.Stop()
# return
# }
# if ($script:VersionCheckStarted.Elapsed.TotalSeconds -ge 8) {
# $script:VersionCheck.Request.Abort()
# $script:VersionCheck.Completed = $true
# $script:VersionCheckTimer.Stop()
# return
# }
# if ($script:VersionCheck.AsyncResult.IsCompleted) {
# $releaseUpdate = Complete-DeployCenterVersionCheck -Check $script:VersionCheck
# $script:VersionCheckTimer.Stop()
# if ($null -ne $releaseUpdate -and $null -ne $script:VersionFooterLabel -and -not $script:VersionFooterLabel.IsDisposed) {
# $currentVersionText = Get-DeployCenterText -Text 'Current version:'
# $newVersionText = Get-DeployCenterText -Text 'New version:'
# $script:VersionFooterLabel.Text = "$currentVersionText $($releaseUpdate.CurrentVersion) | $newVersionText $($releaseUpdate.LatestVersion)"
# $script:VersionFooterLabel.Tag = $true
# $script:VersionFooterLabel.ForeColor = [System.Drawing.ColorTranslator]::FromHtml([string]$script:Theme.Danger)
# $script:VersionFooterLabel.Invalidate()
# }
# }
# }.GetNewClosure())
$script:VersionCheckTimer.Start()
}
} catch {
[System.Windows.Forms.MessageBox]::Show($_.ScriptStackTrace, 'Erreur Gitea')
# The optional release check must never delay or interrupt the interface.
}
& $script:SourceLogAction "DeployCenter started."
& $script:SourceLogAction "Folder: $script:DeployRoot"
& $script:SourceLogAction "Log: $script:LogFile"
@@ -1110,6 +1154,13 @@ $script:form.Add_Shown({
})
$script:form.Add_FormClosed({
if ($script:VersionCheckTimer) {
$script:VersionCheckTimer.Stop()
$script:VersionCheckTimer.Dispose()
}
if ($script:VersionCheck -and -not $script:VersionCheck.Completed) {
$script:VersionCheck.Request.Abort()
}
if ($null -ne $script:pictureLogo -and $null -ne $script:pictureLogo.Image) {
$script:pictureLogo.Image.Dispose()
}