Skip to content

opsi.orgheader image

opsi.org
Views
WinstScripts >>

xpconfig

Document Actions
last edited 11 months ago by sehlers
Qualified for opsi 3.3

---------------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.

[Initial]
; 20.06.06, uib 

Message=XP konfigurieren ......
LogLevel=2
ExitOnError=false
ScriptErrorMessages=on
TraceMode=off

[Aktionen]
DefVar $OS$
set $OS$ = GetOS
DefVar $MinorOS$
set $MinorOS$ = GetNTVersion
DefVar $INST_NTVersion$

DefVar $ConfigSection$
Set $ConfigSection$ = "xpconfig-install"

DefVar $ParmName$
DefVar $ParmValue$
DefVar $DefaultValue$

;*** Flag if patch shall be executed
;*** 0 = do not execute patch
;*** 1 = execute patch

DefVar $Flag_NoWindowsTour$
DefVar $Flag_NoErrorReport$
DefVar $Flag_NoAutorunCD$
DefVar $Flag_NoBalloons$
DefVar $Flag_NoStandardShares$
DefVar $Flag_ClassicStartMenu$
DefVar $Flag_ClassicControl$
DefVar $Flag_NumlockOn$
DefVar $Flag_Explorer$
DefVar $Flag_NetworkPostscriptPrinter$
DefVar $NetworkPostscriptPrinterName$
DefVar $NetworkPostscriptPrinterURL$
DefVar $Flag_WaitForNetwork$
DefVar $Flag_i386PathC$


;*** Values for Explorer Settings
;*** Achtung, Settings gelten nur für bereits vorhandene Benutzer!

DefVar $Val_Explorer_ClassicViewState$
DefVar $Val_Explorer_HideFileExt$
DefVar $Val_Explorer_SuperHidden$
DefVar $Val_Explorer_ShowSuperHidden$
DefVar $Val_Explorer_WebViewBarricade$
DefVar $Val_Explorer_Hidden$
DefVar $Val_Explorer_WebView$


;if (($OS$ = "Windows_NT") and (($MinorOS$ = "WinXP") or ($MinorOS$ = "Windows Vista")))
set $INST_NTVersion$ = GetMsVersionInfo

if ($INST_NTVersion$ >= "4")


	 ;** read Flags and Vals 

	 ;**********************************************************************
	 ;** ;** ab Winst V4.2 möglich:
	 ;** ;** $ParmValue$ = GetValueFromInifile ($ConfigINI$, $ConfigSection$, $ParmName$, $DefaultValue$)
	 ;** 
	 ;** ;**** Aufruf direkt:
	 ;** 
	 ;** Set $Flag_Example$ = IniVar("Flag_Example")
	 ;** if ($Flag_Example$ = "")
	 ;**    $Flag_Example$ = GetValueFromInifile ($ConfigINI$, $ConfigSection$, "Flag_Example", "1")
	 ;** endif
	 ;** 
	 ;** ;**** oder über SUB-Sektion:
	 ;** 
	 ;** Set $ParmName$     = "Flag_Example"
	 ;** Set $DefaultValue$ = "1"
	 ;** Sub_GetIniParm
	 ;** Set $Flag_Example$ = $ParmValue$
	 ;**
	 ;** ;**** oder direkt Registry-Aufruf (keine eigene Flag-Variable nötig):
	 ;**
	 ;** Set $ParmName$     = "Flag_Example"
	 ;** Set $DefaultValue$ = "1"
	 ;** Sub_GetIniParm
	 ;** if ($ParmValue$ = "1")
	 ;**    Registry_Example
	 ;**    Registry_HKCU_Example
	 ;** endif
	 ;** 
	 ;**********************************************************************
	 

	 Set $Flag_NoWindowsTour$ = IniVar("Flag_NoWindowsTour")
	 
	 Set $Flag_NoErrorReport$ = IniVar("Flag_NoErrorReport")
	 
	 Set $Flag_NoAutorunCD$ = IniVar("Flag_NoAutorunCD")
	 
	 Set $Flag_NoBalloons$ = IniVar("Flag_NoBalloons")
	 
	 Set $Flag_NoStandardShares$ = IniVar("Flag_NoStandardShares")
	 
	 Set $Flag_ClassicStartMenu$ = IniVar("Flag_ClassicStartMenu")
	 
	 Set $Flag_ClassicControl$ = IniVar("Flag_ClassicControl")
	 
	 Set $Flag_NumlockOn$ = IniVar("Flag_NumlockOn")
	 
	 Set $Flag_Explorer$ = IniVar("Flag_Explorer")
	 
	 Set $flag_waitfornetwork$ = IniVar("Flag_WaitForNetwork")

	 Set $flag_i386pathc$ = IniVar("Flag_i386PathC")


	 ;*** Read Explorer Settings from config
	 
	 if ($Flag_Explorer$ = "1")
			
			Set $Val_Explorer_ClassicViewState$ = IniVar("Val_Explorer_ClassicViewState")

			Set $Val_Explorer_HideFileExt$ = IniVar("Val_Explorer_HideFileExt")
			
			Set $Val_Explorer_SuperHidden$ = IniVar("Val_Explorer_SuperHidden")

			Set $Val_Explorer_ShowSuperHidden$ = IniVar("Val_Explorer_ShowSuperHidden")
			
			Set $Val_Explorer_WebViewBarricade$ = IniVar("Val_Explorer_WebViewBarricade")
			
			Set $Val_Explorer_Hidden$ = IniVar("Val_Explorer_Hidden")
			
			Set $Val_Explorer_WebView$ = IniVar("Val_Explorer_WebView")

	 endif

	 Set $Flag_NetworkPostscriptPrinter$ = IniVar("Flag_NetworkPostscriptPrinter")

	 Set $NetworkPostscriptPrinterName$ = IniVar("NetworkPostscriptPrinterName")
	 
	 Set $NetworkPostscriptPrinterUrl$ = IniVar("NetworkPostscriptPrinterUrl")
			
	 ;** do patches
	 
	 ;http://support.microsoft.com/?scid=kb%3Ben-us%3B947709&x=11&y=14
	 if IniVar ("Flag_xp_firewall") = "on"
		 if ($MinorOS$ = "WinXP")
				 DosInAnIcon_xp_firewall_on
				 else
				 DosInAnIcon_vista_firewall_on
		 endif
		 else
		 if ($MinorOS$ = "WinXP")
				 DosInAnIcon_xp_firewall_off
				 else
				 DosInAnIcon_vista_firewall_off
		 endif
		 
	 endif


	 ; http://support.microsoft.com/default.aspx?scid=kb;en-us;823732
	 if IniVar ("Flag_usb") = "on"
			Registry_usb_on
	 else
			Registry_usb_off
	 endif


	 if ($Flag_NoWindowsTour$ = "1")
			Registry_NoWindowsTour
			Registry_HKCU_NoWindowsTour /AllNtUserDats
	 endif
	 
	 if ($Flag_NoErrorReport$ = "1")
			Registry_NoErrorReport
	 endif
	 
	 if ($Flag_NoAutorunCD$ = "1")
			Registry_NoAutorunCD
	 endif
	 
	 if ($Flag_NoBalloons$ = "1")
			Registry_NoBalloons
			Registry_HKCU_NoBalloons /AllNtUserDats
	 endif
	 
	 if ($Flag_NoStandardShares$ = "1")
			Registry_NoStandardShares
	 else
			Registry_StandardShares
	 endif
	 
	 if ($Flag_ClassicStartMenu$ = "1")
			Registry_HKCU_ClassicStartMenu /AllNtUserDats
	 endif

	 if ($Flag_ClassicControl$ = "1")
			Registry_HKCU_Flag_ClassicControl  /AllNtUserDats
	 endif

	 if ($Flag_NumlockOn$ = "1")
			Registry_HKCU_NumlockOn /AllNtUserDats
	 endif

	 if ($Flag_Explorer$ = "1")
			Registry_HKCU_ExplorerConfig /AllNtUserDats
	 endif
	 
	 if ($Flag_NetworkPostscriptPrinter$ = "1")
			Dosinanicon_NetworkPostscriptPrinter
	 endif   
	 
	 if ($Flag_WaitForNetwork$ = "1")
		 Registry_WaitForNetwork
	 endif
	
	 if ($Flag_i386PathC$ = "1")
		 Registry_set_i386_source  
	 endif
	 
	 ExitWindows /RebootWanted
else
	logError "Installation aborted: wrong OS version: only win2k and above alowed"
	;pause    "Installation aborted: wrong OS version: only win2k and above alowed"
	isFatalError
endif

;***********************
;**    misc	   ***
;***********************

[DosInAnIcon_xp_firewall_on]
netsh firewall set opmode enable

[DosInAnIcon_xp_firewall_off]
netsh firewall set opmode disable

[DosInAnIcon_vista_firewall_on]
netsh advfirewall set currentprofile state on

[DosInAnIcon_vista_firewall_off]
netsh advfirewall set currentprofile state off

;***********************
;**    SUB-Sektion   ***
;***********************

;*** Aufruf Sub_GetIniParm ab Winst V4.2 möglich (neue Funktion GetValueFromInifile)

[Sub_GetIniParm]
Set $ParmValue$ = IniVar($ParmName$)
if ($ParmValue$ = "")
	 $ParmValue$ = GetValueFromInifile ($ConfigINI$, $ConfigSection$, $ParmName, $DefaultValue)
endif


;***********************
;**    HKLM-Einträge ***
;***********************

;** Windows-Tour abschalten
[Registry_NoWindowsTour]
openKey [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Applets\Tour]
set "RunCount" = REG_DWORD:00000000

;** keine Fehlerberichte an Microsoft
[Registry_NoErrorReport]
openKey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting]
set "DoReport" = REG_DWORD:00000000
set "ShowUI"   = REG_DWORD:00000001

;** Microsoft-Online-Überprüfung bei Neustart mit Internet verhindern
[Registry_RegDone]
openkey [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion]
set "RegDone" = "1"

;** CD Autorun abschalten
[Registry_NoAutorunCD]
openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CDRom]
set "AutoRun" = REG_DWORD:00000000

;** keine Tooltipp-Animation (Sprechblasen)
[Registry_NoBalloons]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation]
set "CheckedValue" = REG_DWORD:0000
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
set "EnableBalloonTips" = REG_DWORD:00000000

;** keine Standardfreigaben (C$-Share)
[Registry_NoStandardShares]
openkey [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters]
set "AutoShareWks" = REG_DWORD:00000000

;** keine Standardfreigaben (C$-Share)
[Registry_StandardShares]
openkey [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters]
set "AutoShareWks" = REG_DWORD:00000001

[Registry_set_i386_source]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
set "SourcePath" = "C:"
set "ServicePackSourcePath" = "C:"
set "CDInstall" = reg_dword:0

[Registry_WaitForNetwork]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsNT\CurrentVersion\Winlogon]
set "SyncForegroundPolicy" = reg_dword:1


;***********************
;**    HKCU-Einträge ***
;***********************

;** keine Windows Tour
[Registry_HKCU_NoWindowsTour]
openKey [Software\Microsoft\Windows\CurrentVersion\Applets\Tour]
set "RunCount"=REG_DWORD:00000000

;** Klassisches Startmenü
[Registry_HKCU_ClassicStartMenu]
openKey [Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
set "NoSimpleStartMenu" = REG_DWORD:00000001

;** Klassische Systemsteuerung
[Registry_HKCU_Flag_ClassicControl]
openKey [Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
set "ForceClassicControlPanel" = REG_DWORD:00000001

;** Numlock aktivieren
[Registry_HKCU_NumlockOn]
openKey [Control Panel\Keyboard]
set "InitialKeyboardIndicators"="2"

;** Explorer Konfiguration
[Registry_HKCU_ExplorerConfig]
openKey [Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
Set "ClassicViewState" = REG_DWORD:$Val_Explorer_ClassicViewState$
Set "HideFileExt"      = REG_DWORD:$Val_Explorer_HideFileExt$
Set "SuperHidden"      = REG_DWORD:$Val_Explorer_SuperHidden$
Set "ShowSuperHidden"  = REG_DWORD:$Val_Explorer_ShowSuperHidden$
Set "WebViewBarricade" = REG_DWORD:$Val_Explorer_WebViewBarricade$
Set "Hidden"           = REG_DWORD:$Val_Explorer_Hidden$
Set "WebView"          = REG_DWORD:$Val_Explorer_WebView$

;** No Balloons
[Registry_HKCU_NoBalloons]
openKey [Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
set "EnableBalloonTips"=REG_DWORD:00000000
set "FolderContentsInfoTip"=REG_DWORD:00000000
set "StartButtonBalloonTip"=REG_DWORD:00000000
set "ShowInfoTip"=REG_DWORD:00000000
openkey [Software\Microsoft\Windows\CurrentVersion\Explorer\tips]
set "Show"=REG_DWORD:00000000
openkey [Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
set "NoSMBalloonTip"=REG_DWORD:00000000

[Registry_usb_off]
openkey [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\usbstor]
set "start"= REG_DWORD:4

[Registry_usb_on]
openkey [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\usbstor]
set "start"= REG_DWORD:3

;**  Network Postscript Printer einrichten
[Dosinanicon_NetworkPostscriptPrinter]
rundll32 printui.dll,PrintUIEntry /b "$NetworkPostscriptPrinterName$" /if /f c:\windows\inf\ntprint.inf /r "$NetworkPostscriptPrinterUrl$" /m "Apple Color LW 12/660 PS"