Pour les clés de registre qui doivent être définies lors de l'installation de l'application, utilisez la méthode d'application Win32. Cela est idéal pour les paramètres de registre spécifiques aux logiciels.
Tout d'abord, téléchargez l'outil Microsoft Win32 Content Prep Tool v1.11.4 depuis :
https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool/releases
Créez une structure de dossiers pour votre application Win32 :
mkdir C:\IntuneApps\RegistryConfig
cd C:\IntuneApps\RegistryConfig
Créez un script install.ps1 :
# install.ps1 - Configuration du registre lors du déploiement de l'application
Start-Transcript -Path "C:\Windows\Temp\RegistryConfig-Install.log"
try {
# Créer des clés de registre spécifiques à l'application
$appRegPath = "HKLM:\SOFTWARE\MyCompany\ApplicationSettings"
New-Item -Path $appRegPath -Force | Out-Null
# Définir les valeurs de configuration
New-ItemProperty -Path $appRegPath -Name "ConfigVersion" -Value "2.1" -PropertyType String -Force
New-ItemProperty -Path $appRegPath -Name "AutoUpdate" -Value 1 -PropertyType DWord -Force
New-ItemProperty -Path $appRegPath -Name "TelemetryEnabled" -Value 0 -PropertyType DWord -Force
Write-Output "Configuration du registre terminée avec succès"
exit 0
}
catch {
Write-Error "Échec de la configuration du registre : $($_.Exception.Message)"
exit 1
}
finally {
Stop-Transcript
}
Créez le package .intunewin :
IntuneWinAppUtil.exe -c "C:\IntuneApps\RegistryConfig" -s "install.ps1" -o "C:\IntuneApps\Output"
Vérification : Vérifiez que le fichier .intunewin a été créé avec succès dans le répertoire de sortie avant de procéder à son téléchargement sur Intune.