Re: Programme automatisch installieren nach Installation
Verfasst: 05.12.2024, 14:52
kaum hatte ich geschrieben:
"die Installation erfolgt über Winget mit --configure und einer angepassten Configuration.xml (ProPlus2024Volume.xml). Das funktioniert nur, wenn eine Internetverbindung während der Installation vorhanden ist, da die .xml auf einem eigenen FTP-Server liegt (müßte auch mit einer Fritz.Box gehen)."
dachte ich: warum eigentlich die Configuration.xml von extern beziehen? Zur Not muss die ebenfalls mit Echo Befehlen erstellt werden. > funktioniert!
der Winget Befehl sieht dann etwas anders aus, da die ProPlus2024VL.xml unter C:\Windows\Setup\Scripts erstellt wird:
Die configuration.xml muss schon vorhanden sein, wenn winget das Office mit dieser installieren soll. Also wird sie unter "settings pass="specialize" erstellt:
in Verbindung mit:
der Rest kann so bleiben.
"die Installation erfolgt über Winget mit --configure und einer angepassten Configuration.xml (ProPlus2024Volume.xml). Das funktioniert nur, wenn eine Internetverbindung während der Installation vorhanden ist, da die .xml auf einem eigenen FTP-Server liegt (müßte auch mit einer Fritz.Box gehen)."
dachte ich: warum eigentlich die Configuration.xml von extern beziehen? Zur Not muss die ebenfalls mit Echo Befehlen erstellt werden. > funktioniert!
der Winget Befehl sieht dann etwas anders aus, da die ProPlus2024VL.xml unter C:\Windows\Setup\Scripts erstellt wird:
Code: Alles auswählen
<SynchronousCommand wcm:action="add">
<Order>12</Order>
<Description>Office</Description>
<CommandLine>cmd /c winget install --id "Microsoft.Office" --override "/configure C:\Windows\Setup\Scripts\ProPlus2024VL.xml"</CommandLine>
</SynchronousCommand>
Code: Alles auswählen
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>91</Order>
<Path>powershell.exe -NoProfile -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path>
</RunSynchronousCommand>
<RunSynchronousCommand wcm:action="add">
<Order>92</Order>
<Path>powershell.exe -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\Specialize.ps1' -Raw | Invoke-Expression;"</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
Code: Alles auswählen
<File path="C:\Windows\Setup\Scripts\unattend-01.cmd" transformation="Text">
@Echo off
(
ECHO ^<Configuration^>
ECHO ^<Add OfficeClientEdition="64" Channel="PerpetualVL2024" AllowCdnFallback="TRUE"^>
ECHO ^<Product ID="ProPlus2024Volume" PIDKEY="XJ2XN-FW8RK-P4HMP-DKDBV-GCVGB"^>
ECHO ^<Language ID="de-de" /^>
ECHO ^<ExcludeApp ID="Access" /^>
ECHO ^<ExcludeApp ID="Lync" /^>
ECHO ^<ExcludeApp ID="OneDrive" /^>
ECHO ^<ExcludeApp ID="OneNote" /^>
ECHO ^<ExcludeApp ID="Outlook" /^>
ECHO ^<ExcludeApp ID="SHARED" /^>
ECHO ^<ExcludeApp ID="Publisher" /^>
ECHO ^</Product^>
ECHO ^</Add^>
ECHO ^<Property Name="SharedComputerLicensing" Value="0" /^>
ECHO ^<Property Name="FORCEAPPSHUTDOWN" Value="FALSE" /^>
ECHO ^<Property Name="DeviceBasedLicensing" Value="0" /^>
ECHO ^<Property Name="SCLCacheOverride" Value="0" /^>
ECHO ^<Property Name="AUTOACTIVATE" Value="1" /^>
ECHO ^<Updates Enabled="TRUE" /^>
ECHO ^<RemoveMSI /^>
ECHO ^<Display Level="None" AcceptEULA="TRUE" /^>
ECHO ^</Configuration^>
) > "C:\Windows\Setup\Scripts\ProPlus2024VL.xml"
</File>
<File path="C:\Windows\Setup\Scripts\Specialize.ps1" transformation="Text">
$scripts = @(
{
net.exe accounts /maxpwage:UNLIMITED;
};
{
C:\Windows\Setup\Scripts\unattend-01.cmd;
};
);
& {
[float] $complete = 0;
[float] $increment = 100 / $scripts.Count;
foreach( $script in $scripts ) {
Write-Progress -Activity 'Running scripts to customize your Windows installation. Do not close this window.' -PercentComplete $complete;
& $script;
$complete += $increment;
}
} *>&1 >> "C:\Windows\Setup\Scripts\Specialize.log";
</File>