Table of Contents

Anmelde und Desktophintergrund verteilen

.zip - Package with all needed Files

[Link zur Zip-Datei entfernt, da er ungültig war. /th]

├ wallpaper
│ └ <width>x<height>.bmp
├ logon
│ └ background<width>x<height>.jpg
├ setup.ins ← Made by bbz_edv
├ getmaxresolution.exe ← Made by bbz_edv (Written in C++)
└ ResSwitch.exe ← Made by Naughter Software [[http://www.naughter.com/]]

Informations

  1. The backgroundfiles are stored in folder “wallpaper” and they have to be a .bmp-file, otherwise it will cause problems with Windows XP.
  2. Windows XP: Logonscreen- and desktopbackground are the same and stored in folder “wallpaper”
  3. Windows7: Logonscreenbackgroundfile is stored in folder “logon” and has the following restrictions:
    1. backgroundDefault.jpg ← would be used by Windows in case no other backgroundfile is available.
    2. background1024x768.jpg
  4. Windows 7: desktopbackgroundfiles are stored (like in Windows XP) in folder “wallpaper” and have to be a “.bmp”-file, too.

Informationen

  1. Die Hintergrunddateien müssen im Ordner “wallpaper” abgelegt werden und müssen eine .bmp - Datei sein, weil es sonst Probleme mit Windows XP gibt
  2. Windows XP: Anmelde und Desktophintergrund-Dateien sind ein und dieselben und liegen im Ordner “wallpaper”
  3. Windows 7: Anmeldehintergrund-Dateien liegen im Ordner “logon” und unterliegen folgender Namenskonvention.
    1. backgroundDefault.jpg ← Wird von Windows nur genommen falls keine passende Dateie vorhanden ist
    2. background1024x768.jpg
  4. Windows 7: Desktophintergrund-Dateien liegen wie bei Windows XP im Ordner “wallpaper” und müssen ebenfalls eine .bmp - Datei sein

setup.ins

[Initial]
SetLogLevel=7
;  Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
 
[Actions]
;;Trigger WMI-Query
DosInAnIcon_Get_Horizontal
DosInAnIcon_Get_Vertical
;;
;;Process WMI-Query
DefStringList $dos_horizontal_list$
DefStringList $dos_vertical_list$
DefVar $resolution$
;
Set $resolution$ = Trim (takeString(2,getOutStreamFromSection ('DosInAnIcon_Get_Horizontal'))) + "x" + Trim (takeString(2,getOutStreamFromSection ('DosInAnIcon_Get_Vertical')))
;;
 
;;Windows 7 Theme
DefVar $Theme_Win7_Name$
DefVar $Theme_Win7_WindowColor$
;
Set $Theme_Win7_Name$ = "BBZ"
Set $Theme_Win7_WindowColor$ = "FROST"
;;
 
;;Wallpaper & Logon Source
DefVar $Wallpaper_Src_Dir$
DefVar $Wallpaper_Src$
DefVar $Logon_Src_Dir$
;
Set $Wallpaper_Src_Dir$ = "%ScriptPath%\wallpaper\"
Set $Wallpaper_Src$ = $Wallpaper_Src_Dir$+$resolution$+".bmp"
Set $Logon_Src_Dir$ = "%ScriptPath%\logon\"
;;
;;Wallpaper & Logon Destination
DefVar $Wallpaper_WinXP_Dst$
DefVar $Wallpaper_Win7_Dst$
DefVar $Wallpaper_WinXP_Dst_Dir$
DefVar $Wallpaper_Win7_Dst_Dir$
DefVar $Logon_Win7_Dst_Dir$
;
Set $Wallpaper_WinXP_Dst_Dir$ = "C:\WINDOWS\Web\Wallpaper\"
Set $Wallpaper_Win7_Dst_Dir$ = "C:\WINDOWS\Web\Wallpaper\"+$Theme_Win7_Name$+"\"
Set $Wallpaper_WinXP_Dst$ = $Wallpaper_WinXP_Dst_Dir$+$resolution$+".bmp"
Set $Wallpaper_Win7_Dst$ = $Wallpaper_Win7_Dst_Dir$+$resolution$+".bmp"
Set $Logon_Win7_Dst_Dir$ = "C:\Windows\System32\oobe\info\backgrounds\"
;;
;;Check OS and ExitCode
DefVar $ExitCode$
DefVar $MSVersion$
;
Set $MSVersion$ = GetMsVersionInfo
;;
;;Check maximum Screen Resolution
DefVar $max_screen_resolution$
DefVar $max_screen_horizontal$
DefVar $max_screen_vertical$
;
DosInAnIcon_Get_Max_Resolution
Set $max_screen_resolution$ = Trim (takeString(0,getOutStreamFromSection ('DosInAnIcon_Get_Max_Resolution')))
Set $max_screen_horizontal$ = takeString(0, splitString($max_screen_resolution$, "x"))
Set $max_screen_vertical$ = takeString(1, splitString($max_screen_resolution$, "x"))
 
If ( $resolution$ = $max_screen_resolution$)
	If ( $MSVersion$ >= "6" )
		If FileExists($Wallpaper_Src$)
			comment "Ihr Standard-Wallpaper wird nun aktualisiert"
			Files_Wallpaper_Win7 /SysNative
			Registry_Wallpaper_Win7 /SysNative
			set $ExitCode$ = "0"
		Else
			comment "Ihr Betriebssystem oder ihre Auflösung wird nicht unterstützt"
			set $ExitCode$ = "1"
		EndIf
	Else
		If ( $MSVersion$ = "5.1" )
			If FileExists($Wallpaper_Src$)
				comment "Ihr Standard-Wallpaper wird nun aktualisiert"
				Files_Wallpaper_WinXP /SysNative
				Registry_Wallpaper_WinXP /SysNative /AllNTUserDats
				set $ExitCode$ = "0"
			Else
				comment "Ihr Betriebssystem oder ihre Auflösung wird nicht unterstützt"
				set $ExitCode$ = "1"
			EndIf
		Else
			comment "Ihr Betriebssystem oder ihre Auflösung wird nicht unterstützt"
			set $ExitCode$ = "1"	
		EndIf
	EndIf
Else
	DosInAnIcon_Set_Max_Resolution
	DosInAnIcon_Get_Horizontal
	DosInAnIcon_Get_Vertical
	Set $resolution$ = Trim (takeString(2,getOutStreamFromSection ('DosInAnIcon_Get_Horizontal'))) + "x" + Trim (takeString(2,getOutStreamFromSection ('DosInAnIcon_Get_Vertical')))
	Set $Wallpaper_Src$ = $Wallpaper_Src_Dir$+$resolution$+".bmp"
	Set $Wallpaper_WinXP_Dst$ = $Wallpaper_WinXP_Dst_Dir$+$resolution$+".bmp"
	Set $Wallpaper_Win7_Dst$ = $Wallpaper_Win7_Dst_Dir$+$resolution$+".bmp"
 
	If ( $MSVersion$ >= "6" )
		If FileExists($Wallpaper_Src$)
			comment "Ihr Standard-Wallpaper wird nun aktualisiert"
			Files_Wallpaper_Win7 /SysNative
			Registry_Wallpaper_Win7 /SysNative
			set $ExitCode$ = "0"
		Else
			comment "Ihr Betriebssystem oder ihre Auflösung wird nicht unterstützt"
			set $ExitCode$ = "1"
		EndIf
	Else
		If ( $MSVersion$ = "5.1" )
			If FileExists($Wallpaper_Src$)
				comment "Ihr Standard-Wallpaper wird nun aktualisiert"
				Files_Wallpaper_WinXP /SysNative
				Registry_Wallpaper_WinXP /SysNative /AllNTUserDats
				set $ExitCode$ = "0"
			Else
				comment "Ihr Betriebssystem oder ihre Auflösung wird nicht unterstützt"
				set $ExitCode$ = "1"
			EndIf
		Else
			comment "Ihr Betriebssystem oder ihre Auflösung wird nicht unterstützt"
			set $ExitCode$ = "1"	
		EndIf
	EndIf
EndIf
[DosInAnIcon_Get_Horizontal]
@echo off
wmic path win32_videocontroller get currentHorizontalResolution
[DosInAnIcon_Get_Vertical]
@echo off
wmic path win32_videocontroller get currentVerticalResolution
[DosInAnIcon_Get_Max_Resolution]
@echo off
"%scriptpath%\getmaxresolution.exe"
[DosInAnIcon_Set_Max_Resolution]
@echo off
"%scriptpath%\ResSwitch.exe" /WIDTH:$max_screen_horizontal$ /HEIGHT:$max_screen_vertical$ /updateregistry
[Files_Wallpaper_Win7]
delete -s -f "$Wallpaper_Win7_Dst_Dir$"
copy -s "$Wallpaper_Src_Dir$" "$Wallpaper_Win7_Dst_Dir$"
[Registry_Wallpaper_Win7]
OpenKey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes]
Add "DesktopBackground" = "$Wallpaper_Win7_Dst$"
Set "DesktopBackground" = "$Wallpaper_Win7_Dst$"
Add "NoThemeInstall" = reg_dword:0x00000000
Set "NoThemeInstall" = reg_dword:0x00000000
Add "ThemeName" = "$Theme_Win7_Name$"
Set "ThemeName" = "$Theme_Win7_Name$"
Add "WindowColor" = "$Theme_Win7_WindowColor$"
Set "WindowColor" = "$Theme_Win7_WindowColor$"
[Files_Wallpaper_WinXP]
copy -s "$Wallpaper_Src_Dir$" "$Wallpaper_WinXP_Dst_Dir$"
[Registry_Wallpaper_WinXP]
OpenKey [Control Panel\Desktop]
Add "Wallpaper" = "$Wallpaper_WinXP_Dst$"
Set "Wallpaper" = "$Wallpaper_WinXP_Dst$"
[Files_Logon_Win7]
copy -s "$Logon_Src_Dir$" "$Logon_Win7_Dst_Dir$"
[Registry_Logon_Win7]
OpenKey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication]
Add "OEMBackground" = reg_dword:0x00000001
Set "OEMBackground" = reg_dword:0x00000001
OpenKey [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System]
Add "UseOEMBackground" = reg_dword:0x00000001
Set "UseOEMBackground" = reg_dword:0x00000001