Programme automatisch installieren nach Installation

Antwort erstellen


Diese Frage dient dazu, das automatisierte Versenden von Formularen durch Spam-Bots zu verhindern.
Smileys
:) ;) :smile: :lol: :hihi: :D :rofl: :muahah: :( :pff: :kopfstreichel: :ohno: :betruebt: :heulen: :kopfkratz: :duckundweg: :o :? :oops: :psst: :sauer: :-P :daumenrunter: :daumen: :dankeschoen: :thx: :dafür: :gähn:
Mehr Smileys anzeigen

BBCode ist eingeschaltet
[img] ist eingeschaltet
[flash] ist ausgeschaltet
[url] ist eingeschaltet
Smileys sind eingeschaltet

Die letzten Beiträge des Themas

Ich habe die Datenschutzerklärung gelesen und bin damit einverstanden.

   

Ansicht erweitern Die letzten Beiträge des Themas: Programme automatisch installieren nach Installation

Re: Programme automatisch installieren nach Installation

von Holgi » 18.01.2025, 17:35

ich hatte hier:
viewtopic.php?t=30594&start=465#p435127
schon mal geschrieben, wie man einen Desktop Arrow Shortcut (Verknüpfungspfeil) los wird.
Das geht zwar grds. sehr gut mit dem Tool von WINAERO:
https://winaero.com/how-to-remove-short ... indows-11/
aber da ist man auf ein externes Icon-Symbol (blank.ico) angewiesen und Windows-eigene-Lösungen (Boardmittel) sind mir da immer lieber.
Jetzt ist mir ein dem blank.ico ebenbürtiger durchsichtiger Verknüpfungspfeil unter Windows aufgefallen. Der steckt hier:
"C:\Program Files\WindowsApps\MicrosoftWindows.Client.WebExperience_524.34401.20.0_x64__cw5n1h2txyewy\Dashboard\WebContent\wwwroot\favicon.ico"
Dumm nur, das die Versionsnummer (524.34401.20.0) sich irgendwann mal ändern wird. Also flugs ein Script geschrieben, welches die aktuelle Versionsnummer ausliest und dann den Registry-Eintrag entsprechend anpasst.
So kann man dieses Script gut mit in die autounattend.xml stecken.

arrow_remover (neu).cmd

Code: Alles auswählen

@Echo off
:: BatchGotAdmin
:-------------------------------------
REM  --> Check for permissions
    IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params= %*
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs" 1>nul 2>nul

    exit /B

:gotAdmin
    pushd "%CD%"
    CD /D "%~dp0"
@echo off
setlocal enabledelayedexpansion

REM Pfad zur WindowsApps mit MicrosoftWindows.Client.WebExperience
set "basePath=C:\Program Files\WindowsApps"
set "searchFolder=MicrosoftWindows.Client.WebExperience_*"
set "targetPath=C:\Windows\System32"
set "iconFileName=favicon.ico"

REM Suche nach dem neuesten Ordner
for /d %%D in ("%basePath%\%searchFolder%") do (
    set "currentFolder=%%D"
)

REM Überprüfen, ob ein Ordner gefunden wurde
if not defined currentFolder (
    echo Kein passender Ordner gefunden. Abbruch.
    exit /b 1
)

REM Vollständigen Pfad zur Favicon-Datei
set "sourceIconPath=%currentFolder%\Dashboard\WebContent\wwwroot\%iconFileName%"

REM Überprüfen, ob die Datei existiert
if not exist "%sourceIconPath%" (
    echo Favicon.ico nicht gefunden unter "%sourceIconPath%". Abbruch.
    exit /b 1
)

REM Kopiere Favicon.ico nach C:\Windows\System32
copy /Y "%sourceIconPath%" "%targetPath%\%iconFileName%"
if %errorlevel% neq 0 (
    echo Fehler beim Kopieren der Datei nach "%targetPath%".
    exit /b 1
)

REM Registry-Schlüssel aktualisieren
set "finalIconPath=%targetPath%\%iconFileName%"
set "escapedPath=%finalIconPath:\=\\%"

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v "29" /t REG_SZ /d "\"%escapedPath%\"" /f

REM Erfolgsmeldung
if %errorlevel% equ 0 (
    echo Registry erfolgreich aktualisiert mit "%escapedPath%".
    echo Bitte starten Sie den Explorer neu oder melden Sie sich ab/an, um die Änderungen zu übernehmen.
) else (
    echo Fehler beim Aktualisieren der Registry.
)

endlocal

taskkill /IM explorer.exe /F > NUL 2>&1 && start explorer > NUL 2>&1
Anmerkung:
der Teil von

Code: Alles auswählen

 :: BatchGotAdmin bis :gotAdmin
kann ggf. weggelassen werden. Da geht es nur um Administratorrechte.
Viel Spaß!

Re: Programme automatisch installieren nach Installation

von Holgi » 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:

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>
Die configuration.xml muss schon vorhanden sein, wenn winget das Office mit dieser installieren soll. Also wird sie unter "settings pass="specialize" erstellt:

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>			
			
in Verbindung mit:

Code: Alles auswählen

	
		<File path="C:\Windows\Setup\Scripts\unattend-01.cmd" transformation="Text">
@Echo off
(
ECHO ^&lt;Configuration^&gt;
ECHO ^&lt;Add OfficeClientEdition="64" Channel="PerpetualVL2024" AllowCdnFallback="TRUE"^&gt;
ECHO     ^&lt;Product ID="ProPlus2024Volume" PIDKEY="XJ2XN-FW8RK-P4HMP-DKDBV-GCVGB"^&gt;
ECHO       ^&lt;Language ID="de-de" /^&gt;
ECHO       ^&lt;ExcludeApp ID="Access" /^&gt;
ECHO       ^&lt;ExcludeApp ID="Lync" /^&gt;
ECHO       ^&lt;ExcludeApp ID="OneDrive" /^&gt;
ECHO       ^&lt;ExcludeApp ID="OneNote" /^&gt;
ECHO       ^&lt;ExcludeApp ID="Outlook" /^&gt;
ECHO       ^&lt;ExcludeApp ID="SHARED" /^&gt;
ECHO       ^&lt;ExcludeApp ID="Publisher" /^&gt;
ECHO     ^&lt;/Product^&gt;
ECHO   ^&lt;/Add^&gt;
ECHO   ^&lt;Property Name="SharedComputerLicensing" Value="0" /^&gt;
ECHO   ^&lt;Property Name="FORCEAPPSHUTDOWN" Value="FALSE" /^&gt;
ECHO   ^&lt;Property Name="DeviceBasedLicensing" Value="0" /^&gt;
ECHO   ^&lt;Property Name="SCLCacheOverride" Value="0" /^&gt;
ECHO   ^&lt;Property Name="AUTOACTIVATE" Value="1" /^&gt;
ECHO   ^&lt;Updates Enabled="TRUE" /^&gt;
ECHO   ^&lt;RemoveMSI /^&gt;
ECHO   ^&lt;Display Level="None" AcceptEULA="TRUE" /^&gt;
ECHO ^&lt;/Configuration^&gt;
) &gt; "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;
	};
);

&amp; {
	[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;
		&amp; $script;
		$complete += $increment;
	}
} *&gt;&amp;1 &gt;&gt; "C:\Windows\Setup\Scripts\Specialize.log";
		</File>
der Rest kann so bleiben.

Re: Programme automatisch installieren nach Installation

von Holgi » 04.12.2024, 13:32

mein Office 2024 LTSC lasse ich vollautomatisch über die autounattend.xml installieren, aktivieren (.cmd) und auf meine Bedürfnisse anpassen (per Registry-Einträge).
Installation:
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).

Code: Alles auswählen

				<SynchronousCommand wcm:action="add">
                    			<Order>12</Order>
                    			<Description>Office</Description>
                    			<CommandLine>cmd /c winget install --id "Microsoft.Office" --override "/configure https://www.XXXXXXXX.de\ftp\ProPlus2024Volume.xml"</CommandLine>
                		</SynchronousCommand>
Auf dem Desktop möchte ich einen Shortcut haben für eine Verknüpfung zum Office Update:

Code: Alles auswählen

	<File path="C:\Windows\Setup\Scripts\unattend-03.ps1">
$strTargetPath = "$env:CommonProgramFiles\microsoft shared\ClickToRun\OfficeC2RClient.exe"
$strLinkFile = "$env:USERPROFILE\Desktop\Office.lnk"
$shell = New-Object -ComObject WScript.Shell
$Shortcut = $shell.CreateShortcut($strLinkFile)
$Shortcut.TargetPath = $strTargetPath
$Shortcut.HotKey = "Ctrl+Shift+C"
$Shortcut.Arguments = "/update user"
# $lnk.Arguments = 
# Set the window style (3=Maximized 7=Minimized 4=Normal)
$shortcut.WindowStyle = 3
$Shortcut.IconLocation = "$env:CommonProgramFiles\microsoft shared\ClickToRun\OfficeC2RClient.exe"
$Shortcut.Save()
		</File>
für die Office Einstellungen werden diese Registry-Einträge vorgenommen. Es kommen keinerlei PopUps mehr, um z.B. die Privatsphäreneinstellungen zu akzeptieren. Theme entweder System oder Colored. Zum Speichern sind die alten Office-Formate voreingestellt (.xls, .ppt, .doc):

Code: Alles auswählen

		<File path="C:\Windows\Setup\Scripts\unattend-01.reg">
Windows Registry Editor Version 5.00
;Office User Settings
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\word\options]
"defaultformat"="Doc"
"LastUILang"=dword:00000407
"EnableAccChecker"=dword:00000001
"FirstRun"=dword:00000000

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\word\options]
"defaultformat"="Doc"
"LastUILang"=dword:00000407
"EnableAccChecker"=dword:00000001
"FirstRun"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\options]
"defaultformat"=dword:00000038
"LastUILang"=dword:00000407
"EnableAccChecker"=dword:00000001
"FirstRun"=dword:00000000

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Excel\options]
"defaultformat"=dword:00000038
"LastUILang"=dword:00000407
"EnableAccChecker"=dword:00000001
"FirstRun"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\powerpoint\options]
"defaultformat"=dword:00000000
"LastUILang"=dword:00000407
"EnableAccChecker"=dword:00000001
"FirstRun"=dword:00000000
"ShowSuggestionDialog"=dword:00000002


[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\powerpoint\options]
"defaultformat"=dword:00000000
"LastUILang"=dword:00000407
"EnableAccChecker"=dword:00000001
"FirstRun"=dword:00000000
"ShowSuggestionDialog"=dword:00000002

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common]
"PointerModeInitVersion"=dword:00000001
"OverridePointerMode"=dword:00000001
"SplashScreenLicense"=dword:00000006
"PrivacyDialogsDisabled"=dword:00000001
; System
"UI Theme"=dword:00000007
; Colored
;"UI Theme"=dword:00000006

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Common]
"PointerModeInitVersion"=dword:00000001
"OverridePointerMode"=dword:00000001
"SplashScreenLicense"=dword:00000006
"PrivacyDialogsDisabled"=dword:00000001
; System
"UI Theme"=dword:00000007
; Colored
;"UI Theme"=dword:00000006

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Privacy\SettingsStore\Anonymous]
"OptionalConnectedExperiencesNoticeVersion"=dword:00000002

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\ExperimentConfigs\Ecs]
"CountryCode"="std::wstring|DE"
"PerpetualLicenseInfo"="std::wstring|2024"

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\General]
"Xlstart"="XLSTART"
"Themes"="Themes"
"Templates"="Templates"
"Stationery"="Stationery"
"Startup"="STARTUP"
"Signatures"="Signatures"
"RecentFiles"="Recent"
"Queries"="Queries"
"Proof"="Proof"
"MyPictures"="My Pictures"
"MyDocuments"="My Documents"
"Favorites"="Favorites"
"Desktop"="Desktop"
"ApplicationData"="Application Data"
"AddIns"="AddIns"
"Actors"="Actors"
"NoTrack"=dword:00000001
"FirstRun"=dword:00000000
"FileFormatBallotBoxAppIDBootedOnce"=dword:00000001
"FileFormatBallotBoxTelemetryEventSent"=dword:00000001
"FileFormatBallotBoxTelemetryConfirmationEventSent"=dword:00000001
"FileFormatBallotBoxTelemetrySent"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity]
"TrustedSiteUrlForUserAgentVersionInfo"=""
"Version"=dword:00000001
"SignedOutOneAuthMigrationComplete"=dword:00000001
"Canary"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\LanguageResources]
"UIFallbackLanguages"="x-none;de-de"
"HelpLanguageTag"="de-de"
"PreferredEditingLanguage"="de-DE"
"PreviousPreferredEditingLanguage"="de-DE"
"WordChangeInstallLanguage"="No"
"WordMailChangeInstallLanguage"="No"
"XLChangeInstallLanguage"="No"
"PPTChangeInstallLanguage"="No"
"AccessChangeInstallLanguage"="No"
"OutlookChangeInstallLanguage"="No"
"PublisherChangeInstallLanguage"="No"
"ProjectChangeInstallLanguage"="No"
"OneNoteChangeInstallLanguage"="No"
"LangTuneUp"="OfficeCompleted"
"UISnapshotLanguages"=""
"HelpFallbackLanguages"="x-none;de-de"
"UILanguageTag"="de-de"
"ShowDates"="ON"

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\LanguageResources\EnabledEditingLanguages]
"de-DE"=dword:00000001
"en-US"=dword:00000002

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\LanguageResources\LocalCache]
"RegionalAndLanguageSettingsAccount"=""


[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Licensing]
"RetailDemo"=dword:00000000
"DeviceEntitlementsExist"=dword:00000000
"NextUserLicensingLicenseIds"=""
"NextUserLicensingLicensedUserIds"=""
"EligibleForExtendedGrace"=dword:00000001
"FirstCleanValidation"=dword:00000001
"RemoveOOBE"=dword:00000001
"1"=dword:00000015


[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Licensing\CurrentSkuIdAggregationForApp]
"Access"="{8D368FC1-9470-4BE2-8D66-90E836CBB051},"
"Excel"="{8D368FC1-9470-4BE2-8D66-90E836CBB051},"
"OneNote"="{8D368FC1-9470-4BE2-8D66-90E836CBB051},"
"Outlook"="{8D368FC1-9470-4BE2-8D66-90E836CBB051},"
"PowerPoint"="{8D368FC1-9470-4BE2-8D66-90E836CBB051},"
"Word"="{8D368FC1-9470-4BE2-8D66-90E836CBB051},"
"Lync"="{8D368FC1-9470-4BE2-8D66-90E836CBB051},"

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\osm]
"enablelogging"=dword:00000000
"EnableFileObfuscation"=dword:00000001
"EnableUpload"=dword:00000000

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\osm]
"EnableFileObfuscation"=dword:00000001
"Enablelogging"=dword:00000000
"EnableUpload"=dword:00000000

[HKEY_CURRENT_USER\Software\Policies\microsoft\office\16.0\osm\preventedapplications]
"accesssolution"=dword:00000001
"olksolution"=dword:00000001
"onenotesolution"=dword:00000001
"pptsolution"=dword:00000001
"projectsolution"=dword:00000001
"publishersolution"=dword:00000001
"visiosolution"=dword:00000001
"wdsolution"=dword:00000001
"xlsolution"=dword:00000001

[HKEY_CURRENT_USER\Software\Policies\microsoft\office\16.0\osm\preventedsolutiontypes]
"agave"=dword:00000001
"appaddins"=dword:00000001
"comaddins"=dword:00000001
"documentfiles"=dword:00000001
"templatefiles"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook]

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options]

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\General]
"HideNewOutlookToggle"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Registration]
"AcceptAllEulas"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo]
"Company"="DESKMODDER"
"UserName"="Darth Vader"
"UserInitials"="DV"

		</File>
Die Aktivierung erfolgt per KMS auf einem vorhanden Firmen KMS-Server und die Office Tools werden aus dem Startmenü entfernt:

Code: Alles auswählen

		<File path="C:\Windows\Setup\Scripts\unattend-02.cmd">
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:KHGM9
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:VMFTK
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:XQBR2
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:PG343
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:WFG99
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:DRTFM
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:BTDRB
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:6F7TH
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:GCVGB
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:H6HGR
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:TX3T2
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:VXRPM
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:R9GQV
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /unpkey:XQBR2

cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /inslic:"%programfiles%\Microsoft Office\root\Licenses16\ProPlus2024VL_KMS_Client_AE-ppd.xrm-ms"
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /inslic:"%programfiles%\Microsoft Office\root\Licenses16\ProPlus2024VL_KMS_Client_AE-ul.xrm-ms"
cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /inslic:"%programfiles%\Microsoft Office\root\Licenses16\ProPlus2024VL_KMS_Client_AE-ul-oob.xrm-ms"

cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

cscript C:\Windows\System32\slmgr.vbs /ckms

cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /sethst:kms.XXXXXXXXX.com

cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /setprt:1688
TIMEOUT /T 10 /NOBREAK &gt;nul

cscript "%programfiles%\Microsoft Office\Office16\ospp.vbs" /act

rmdir "%ProgramData%\Microsoft\Windows\Start Menu\Programs\Microsoft Office Tools" /s /q
		</File>

Re: Programme automatisch installieren nach Installation

von Holgi » 04.12.2024, 13:05

oh. tut mir leid. Gute Besserung!!

Re: Programme automatisch installieren nach Installation

von Scoty » 04.12.2024, 12:44

Nein war wieder im Spital und gesundheitlich geht es mir nicht gut daher komm ich nicht zum testen bzw fehlt auch die Motivation dafür aktuell.

Re: Programme automatisch installieren nach Installation

von Holgi » 04.12.2024, 12:42

hi Scoty,
wie ist dein Test ausgefallen? Hast du es hinbekommen?

Re: Programme automatisch installieren nach Installation

von Scoty » 22.11.2024, 12:27

Wie gesagt Übernahmen ist so nicht möglich da das Script anders aufgerufen wird. Habe jetzt mal alles so weit ergänzt und doppeltes gelöscht da teilweise alter und neuer Code da waren. Habe ja die alte über Import auf der Seite hinzugefügt und dann 2 neue Sachen hinzugefügt und neue auto erstellt. Werde es dann nächste Woche testen.

Re: Programme automatisch installieren nach Installation

von Holgi » 22.11.2024, 11:58

Scoty hat geschrieben: 22.11.2024, 10:17 Warum nicht so lassen wie es war.
Weil: Das Bessere ist des Guten Feind! :smile:

Es ist schon der Wahnsinn, was man da alles mit der autounattend.xml machen kann.
Zu deinem Problem:
Es ist nicht einfach (jedenfalls für mich) da den Überblick zu bewahren. Sind ja auch viele Zeilen Code (bei dir rd. 1000 bei mir schon 2000).
Ich sehe da 2 verschiedene Herangehensweisen:
1. die alte .xml aufbohren, also mit der alten weiterarbeiten und nur neue Teile einfügen (so mache ich es zur Zeit)
oder
2. ganz neu anfangen und die alten Sachen in die neue .xml überführen. Das wird ein zukünftiges Projekt von mir.

Die eigenen Sachen stehen ja im Großen und Ganzen in zwei Abschnitten:
a) > Registry-Einträge

Code: Alles auswählen

		<File path="C:\Windows\Setup\Scripts\unattend-01.reg">
Windows Registry Editor Version 5.00

und
b) > Kommandozeilen-Einträge

Code: Alles auswählen

	<File path="C:\Windows\Setup\Scripts\unattend-02.cmd">
hier: https://github.com/cschneegans/unattend ... or/issues/ kannst du übrigens Vorschläge und Fragen loswerden.

Re: Programme automatisch installieren nach Installation

von Scoty » 22.11.2024, 10:17

Also meine alte und neue Auto sehen schon komplett anders aus. Alleiner der Teil mit den Scripten zum löäschen von OneDrive usw ist jetzt ganz anders aufgeteilt.

Es gab vorher keine Specialize.ps1 wo jetzt zum teil die Scripte sind welche vorher unter <settings pass="specialize"> waren weklchen es aber auch nochmal zusaätzlich gibt. Nur den Teil von der alten <settings pass="specialize"> kann ich nicht mehr 1:1 zu übernehmen welcher von 1 bis 56 gin weil manches woanders ist oder auch kein DefaultUser.ps1. Bin total verwirrt was er da gemacht hat. Warum nicht so lassen wie es war.

Auto gelöscht weil private daten wie Seriennummer usw drin waren. Ich poste ab jetzt keine Auto mehr weil ich ständig vergesse das vorher raus zu machen.

Re: Programme automatisch installieren nach Installation

von Holgi » 22.11.2024, 09:45

eine Kombination aus beiden Teilen setzt mir einen Shortcut für den Office Update Trigger:

Code: Alles auswählen

	<settings pass="oobeSystem">
		<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

			<FirstLogonCommands>
				<SynchronousCommand wcm:action="add">
					<Order>17</Order>
					<CommandLine>cmd.exe /c "powershell.exe -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\unattend-03.ps1' -Raw | Invoke-Expression;" &gt;&gt;"C:\Windows\Setup\Scripts\unattend-03.log" 2&gt;&amp;1"</CommandLine>
				</SynchronousCommand>

::
		</ExtractScript>

	<File path="C:\Windows\Setup\Scripts\unattend-03.ps1">
$strTargetPath = "$env:CommonProgramFiles\microsoft shared\ClickToRun\OfficeC2RClient.exe"
$strLinkFile = "$env:USERPROFILE\Desktop\Office.lnk"
$shell = New-Object -ComObject WScript.Shell
$Shortcut = $shell.CreateShortcut($strLinkFile)
$Shortcut.TargetPath = $strTargetPath
$Shortcut.HotKey = "Ctrl+Shift+C"
$Shortcut.Arguments = "/update user"
# $lnk.Arguments = 
# Set the window style (3=Maximized 7=Minimized 4=Normal)
$shortcut.WindowStyle = 3
$Shortcut.IconLocation = "$env:CommonProgramFiles\microsoft shared\ClickToRun\OfficeC2RClient.exe"
$Shortcut.Save()
		</File>

Re: Programme automatisch installieren nach Installation

von Scoty » 22.11.2024, 09:23

Ja winget habe ich gefunden nur an anderer Stelle. Aber alles andere sieht anders aus zumindest bei mir. Shortcuts setzten? Spannend. Kannst mal ein Beispiel posten wie das aussieht?

Re: Programme automatisch installieren nach Installation

von Holgi » 22.11.2024, 08:57

finde nicht, dass sich diesbezüglich etwas geändert hat. Winget und Programme werden immer noch über Firstlogon Kommandos eingerichtet.

Code: Alles auswählen

	<settings pass="oobeSystem">
		<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">

			<FirstLogonCommands>
				<SynchronousCommand wcm:action="add">
					<Order>5</Order>
                    			<Description>Winget</Description>
					<CommandLine>cmd.exe /c powershell -command "$ProgressPreference = 'SilentlyContinue' ; write-host "Downloade und installiere Dependencies" ; Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.9.25200/DesktopAppInstaller_Dependencies.zip -OutFile .\DesktopAppInstaller_Dependencies.zip ; Expand-Archive -Path .\DesktopAppInstaller_Dependencies.zip -Force ; Add-AppXPackage -Path .\DesktopAppInstaller_Dependencies\x64\Microsoft.UI.Xaml.2.8_8.2310.30001.0_x64.appx ; Add-AppXPackage -Path .\DesktopAppInstaller_Dependencies\x64\Microsoft.VCLibs.140.00.UWPDesktop_14.0.33728.0_x64.appx ; write-host "Installiere Winget" ;  Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.9.25200/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -OutFile .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle ; Add-AppXPackage -Path .\MicrosoftDesktopAppInstaller_8wekyb3d8bbwe.msixbundle"</CommandLine>
				</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>6</Order>
                    			<Description>Scanner</Description>
                    			<CommandLine>cmd /c winget install --id "9WZDNCRFJ3PV" -h --accept-package-agreements --accept-source-agreements</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>7</Order>
                    			<Description>Apple</Description>
                    			<CommandLine>cmd /c winget install --id "9NP83LWLPZ9K" -h --accept-package-agreements --accept-source-agreements</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>8</Order>
                    			<Description>AV1</Description>
                    			<CommandLine>cmd /c winget install --id "9MVZQVXJBQ9V" -h --accept-package-agreements --accept-source-agreements</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>9</Order>
                    			<Description>Everything</Description>
                    			<CommandLine>cmd /c winget install --id "voidtools.Everything.Lite" -h --accept-package-agreements --accept-source-agreements</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>10</Order>
                    			<Description>Firefox</Description>
                    			<CommandLine>cmd /c winget install --id "Mozilla.Firefox" -h --override "/PrivateBrowsingShortcut=false" --accept-source-agreements</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>11</Order>
                    			<Description>Winrar</Description>
                    			<CommandLine>cmd /c winget install --id "RARLab.WinRAR" -h --accept-package-agreements --accept-source-agreements</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>12</Order>
                    			<Description>Office</Description>
                    			<CommandLine>cmd /c winget install --id "Microsoft.Office" --override "/configure https://www.XXXXXXXXXXXXX.de\ftp\ProPlus2024Volume.xml"</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>13</Order>
                    			<Description>VCRedist</Description>
                    			<CommandLine>cmd /c winget install --id "Microsoft.VCRedist.2015+.x64" -h --accept-package-agreements --accept-source-agreements</CommandLine>
                		</SynchronousCommand>
				<SynchronousCommand wcm:action="add">
                    			<Order>14</Order>
                    			<Description>DesktopRuntime</Description>
                    			<CommandLine>cmd /c winget install --id "Microsoft.DotNet.DesktopRuntime.8" -h --accept-package-agreements --accept-source-agreements</CommandLine>
                		</SynchronousCommand>



			</FirstLogonCommands>
Meine autounattend.xml hat mittlerweile 2184 Zeilen.
Neueste Idee: Desktop-Shortcuts setzen mit der autounattend.xml. Alles möglich!

Re: Programme automatisch installieren nach Installation

von Scoty » 22.11.2024, 07:37

Habe heute eine neue ISO erstellt und dabei auch mal wieder geschaut bei dem Auto Ersteller und das sieht ja nun komplett anders aus was da erstellt wurde. Muss man wieder umdenken wo was ist. Noch schlimmer aber die ganzen Winget sachen zum installieren der Programme sind alle nicht mehr enthalten in der neuen Auto. Und da die neue Auto komplett anders aufgebaut ist ka wo ich den Winget Teil nun hinzufügen soll. Warum hat er das Auto Script so radikal geändert?

Re: Programme automatisch installieren nach Installation

von Scoty » 18.10.2024, 08:55

Die reg von oben hat es endlich gelöst. Damit bleiben die Icons nun normal ohne kleinen kasterl. Bei der vorigen Reg war nach jedem reboot das Problem wieder da. Habe denn eintrag in meine ALL Reg hinzugefügt und die alte gelöscht.

Re: Programme automatisch installieren nach Installation

von Holgi » 15.10.2024, 10:28

vlt. magst du das noch mal testen:?

Code: Alles auswählen

    	<SynchronousCommand wcm:action="add">
		<Order>50</Order>
		<Description>Arrow_Remover</Description>
		<CommandLine>REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /V "29" /D "%windir%\System32\imageres.dll,-17" /F</CommandLine>
	</SynchronousCommand>
     	<SynchronousCommand wcm:action="add">
		<Order>51</Order>
		<Description>Arrow_Remover1</Description>
		<CommandLine>REG ADD "HKCR\IE.AssocFile.URL" /V "IsShortcut" /D "" /F</CommandLine>
	</SynchronousCommand>
     	<SynchronousCommand wcm:action="add">
		<Order>52</Order>
		<Description>Arrow_Remover2</Description>
		<CommandLine>REG ADD "HKCR\InternetShortcut" /V "IsShortcut" /D "" /F</CommandLine>
	</SynchronousCommand>
     	<SynchronousCommand wcm:action="add">
		<Order>53</Order>
		<Description>Arrow_Remover3</Description>
		<CommandLine>REG ADD "HKCR\lnkfile" /V "IsShortcut" /D "" /F</CommandLine>
	</SynchronousCommand>

Order Nummer ggf. ampassen.
oder als .reg:

Code: Alles auswählen

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\IE.AssocFile.URL]
"IsShortcut"=""
[HKEY_CLASSES_ROOT\InternetShortcut]
"IsShortcut"=""
[HKEY_CLASSES_ROOT\lnkfile]
"IsShortcut"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons]
"29"="%windir%\\System32\\imageres.dll,-17"

Nach oben