Seite 27 von 33
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 07:03
von Holgi
Erst mal testen, ob Winget wirklich nicht so funktioniert!
Hast du in einer Eingabeaufforderung mal winget eingegeben?
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 07:06
von Scoty
Ja das hat funktioniert. Problem wird sein wie schon früher das die Winget welche eh dabei ist zu alt ist. Das war ja vorher auch das Problem, warum du ja dann Winget hast neu installieren lassen mit einer neueren Version.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 07:51
von Holgi
könnte sein. Du wirst es getestet haben.
Zuletzt habe ich dieses hier für eine Windows Installation genutzt; damit hat Winget immer funktioniert.
Das war aber noch Firstlogon.cmd
Müßte man umschreiben für autounattend.xml > FirstLogonCommands>
Code: Alles auswählen
cd "%homepath%\downloads"
powershell -noprofile "Start-BitsTransfer -DisplayName Winget-install.ps1 "https://github.com/asheroto/winget-install/releases/latest/download/winget-install.ps1"
start /wait /min "" PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%homepath%\downloads\winget-install.ps1"' -Verb RunAs}"
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 07:59
von Scoty
Ich kann ja die firstlogon in die auto integrieren, wäre aber dann wieder alles gleich wie vorher. Die wenigen Apps die installiert werden kann ich auch selbst installieren und den winrar key kopieren. Finde es so eigentlich praktisch nur noch eine auto zu haben, die fast alles macht wie die firstlogon.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 08:04
von Holgi
ich finde die Idee, alles in der autounattend.xml unterzubringen ebenfalls sehr interessant.
Kriegen wir bestimmt hin.
Wenn die vorherig beschriebene Methode für die Winget Installation nicht angenehm ist, dann ginge ja noch die bewährte:
Code: Alles auswählen
powershell -noprofile "Start-BitsTransfer -DisplayName Microsoft.VCLibs.x64 "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx"
powershell -noprofile "Start-BitsTransfer -DisplayName Microsoft.DesktopAppInstaller "https://github.com/microsoft/winget-cli/releases/download/v1.8.1911/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
powershell -noprofile "Start-BitsTransfer -DisplayName Microsoft.UI.Xaml "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx"
powershell -noprofile Add-AppxPackage ".\Microsoft.VCLibs.x64.14.00.Desktop.appx"
powershell -noprofile Add-AppxPackage ".\Microsoft.UI.Xaml.2.8.x64.appx"
powershell -noprofile Add-AppxPackage ".\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
powershell Add-AppPackage -Register "'C:\Program Files\WindowsApps\*Microsoft.DesktopAppInstaller*neutra
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 08:10
von Scoty
Genau so ist es ja in der firstlogon. Problem ist ja den winget befehl hatte ich schon in der auto getestet (siehe oben) und hat nicht funktioniert bzw wurde die App nicht installiert.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 08:55
von Holgi
hier habe ich noch einen Einzzeiler. Der funktioniert eigentlich auch super. Gerade noch mal in einer Sandbox getestet:
Code: Alles auswählen
powershell -command "$ProgressPreference = 'SilentlyContinue' ; write-host "Downloade und installiere Abhängigkeiten" ; Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.8.6 -OutFile .\microsoft.ui.xaml.2.8.6.nupkg.zip ; Expand-Archive -Path .\microsoft.ui.xaml.2.8.6.nupkg.zip -Force ; Add-AppXPackage -Path .\microsoft.ui.xaml.2.8.6.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.8.appx; Add-AppXPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; write-host "Installiere Winget" ; Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.8.1911/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle ; Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle" 2> nul
Alles in einer Zeile!
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 09:11
von Holgi
im Netz gibt es eine autounattend.xml mit einer Winget Funktion. Da sieht es so aus:
Code: Alles auswählen
<SynchronousCommand wcm:action="add">
<CommandLine>cmd /c powershell iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/jbrek/winget-autoinstall/main/install-winget.ps1'))</CommandLine>
<Description>test</Description>
<Order>2</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
Das "cmd /c" würde ich auf jeden Fall davorsetzen.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 09:36
von Scoty
An welcher stelle muss diese sein in der auto, dann teste ich das mal?
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 10:06
von Holgi
Code: Alles auswählen
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoLogonCount /t REG_DWORD /d 0 /f</CommandLine>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>cmd.exe /c "reg.exe import "C:\Windows\Setup\Scripts\unattend-01.reg" >>"C:\Windows\Setup\Scripts\unattend-01.log" 2>&1"</CommandLine>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Winget</Description>
<CommandLine>cmd.exe /c powershell -command "$ProgressPreference = 'SilentlyContinue' ; write-host "Downloade und installiere Abhängigkeiten" ; Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.8.6 -OutFile .\microsoft.ui.xaml.2.8.6.nupkg.zip ; Expand-Archive -Path .\microsoft.ui.xaml.2.8.6.nupkg.zip -Force ; Add-AppXPackage -Path .\microsoft.ui.xaml.2.8.6.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.8.appx; Add-AppXPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; write-host "Installiere Winget" ; Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.8.1911/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle ; Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle"</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
Das mit dem
cmd /c powershell iex ((New-Object System.Net.WebClient).DownloadString(' ....
vergiss mal schnell. Es läuft zwar, der Download dauert aber ewig! Liegt wohl an der Downloadmethode vom Script.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 10:15
von Scoty
Ok na macht nicht. Die auto welche ich jetzt habe von Schneegans ist eh schon sehr gut und die wenigen Apps sind schnell installiert. Habe da ein altes Script noch was das alles in einen rutsch macht. Und dann habe ich ja noch unsere alte Methode mit firstlogon die auch nutzen kann.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 10:26
von Holgi
nicht falsch verstehen:
das mit dem Winget sollte jetzt funktionieren mit der autounattend.
Nach dem
Code: Alles auswählen
<SynchronousCommand wcm:action="add">
<Order>3</Order>
<Description>Winget</Description>
<CommandLine>cmd.exe /c powershell -command "$ProgressPreference = 'SilentlyContinue' ; write-host "Downloade und installiere Abhängigkeiten" ; Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.8.6 -OutFile .\microsoft.ui.xaml.2.8.6.nupkg.zip ; Expand-Archive -Path .\microsoft.ui.xaml.2.8.6.nupkg.zip -Force ; Add-AppXPackage -Path .\microsoft.ui.xaml.2.8.6.nupkg\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.8.appx; Add-AppXPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx ; write-host "Installiere Winget" ; Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.8.1911/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle ; Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle"</CommandLine>
</SynchronousCommand>
geht es dann weiter mit dem Installieren der Apps über Winget. Z.B. so:
Code: Alles auswählen
<SynchronousCommand wcm:action="add">
<Order>4</Order>
<Description>chrome</Description>
<CommandLine>cmd /c winget install Google.Chrome --accept-package-agreements --accept-source-agreements</CommandLine>
</SynchronousCommand>
usw. Hier dann deine Apps einsetzen.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 12:14
von Holgi
wenn ich das jetzt richtig verstehe, dann benötigst du aber schon noch den $OEM$ Ordner; korrekt?
Weil ja der reg import über
Code: Alles auswählen
reg.exe import "C:\Windows\Setup\Scripts\unattend-01.reg
erfolgt.
Und die unattend-01.reg entspricht dann deiner Win11_Registry-Tricks.reg ?
Wenn dem so ist, dann kommt es ja nicht darauf an, ob noch eine firstlogon.cmd zusätzlich im $OEM$-Ordner liegt und über FirstLogonCommands in der autounattend mit eingebunden wird.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 12:20
von Scoty
Nein braucht keinen OEM mehr darum finde ich ds das ja gut. Macht alles die Schneegans Auto.
Re: Programme automatisch installieren nach Installation
Verfasst: 09.09.2024, 13:35
von Holgi
stimmt ja. Da war ich mal wieder neben der Spur. Ist ja der Teil am Ende der autounattend.xml.
Warum dann aber packst du den Teil der normalerweise in der firstlogon.cmd steht nicht auch in die autounattend.xml von Schneegans. Wird ja auf der Seite (wo du auch die REG integriert hast) angeboten > run > as a cmd file
Würde dann z.B. so aussehen (letzter Abschnitt der autounattend.xml):
Code: Alles auswählen
<File path="C:\Windows\Setup\Scripts\unattend-02.cmd">
powershell -noprofile "Start-BitsTransfer -DisplayName Microsoft.VCLibs.x64 "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx"
powershell -noprofile "Start-BitsTransfer -DisplayName Microsoft.DesktopAppInstaller "https://github.com/microsoft/winget-cli/releases/download/v1.8.1791/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
powershell -noprofile "Start-BitsTransfer -DisplayName Microsoft.UI.Xaml "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx"
ren Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle Microsoft.DesktopAppInstaller.msixbundle
ren Microsoft.UI.Xaml.2.8.x64.appx Microsoft.UI.Xaml.x64.appx
powershell -noprofile Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
powershell -noprofile Add-AppxPackage Microsoft.UI.Xaml.x64.appx
powershell -noprofile Add-AppxPackage Microsoft.DesktopAppInstaller.msixbundle
powershell Add-AppPackage -Register "'C:\Program Files\WindowsApps\*Microsoft.DesktopAppInstaller*neutral_split.language-de_8wekyb3d8bbwe\AppxManifest.xml'" -DisableDevelopmentMode
echo --- VC_redist.x64
winget install --id "Microsoft.VCRedist.2015+.x64" -h --accept-package-agreements --accept-source-agreements >nul
echo --- windowsdesktop-runtime
winget install --id "Microsoft.DotNet.DesktopRuntime.7" -h --accept-package-agreements --accept-source-agreements >nul
echo --- Firefox
winget install --id "Mozilla.Firefox" -h --override "INSTALL_MAINTENANCE_SERVICE=false /quiet" >nul
echo --- Thunderbird
winget install --id "Mozilla.Thunderbird" -e -h --override "INSTALL_MAINTENANCE_SERVICE=false /s" --accept-source-agreements >nul
echo --- Winrar
winget install --id "RARLab.WinRAR" -h --accept-package-agreements --accept-source-agreements >nul
exit
</File>
</Extensions>
</unattend>