Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; *** WSUS Offline Update 9.7 - Installer ***
- ; *** Author: T. Wittrock, Kiel ***
- ; *** Dialog scaling added by Th. Baisch ***
- #include <GUIConstants.au3>
- #RequireAdmin
- #pragma compile( CompanyName , 'T. Wittrock' )
- #pragma compile( FileDescription , 'WSUS Offline Update Installer' )
- #pragma compile( FileVersion , 9.7.0.669 )
- #pragma compile( InternalName , 'Installer' )
- #pragma compile( LegalCopyright , 'GNU GPLv3' )
- #pragma compile( OriginalFilename , UpdateInstaller.exe )
- #pragma compile( ProductName , 'WSUS Offline Update' )
- #pragma compile( ProductVersion , 9.7.0 )
- AutoItSetOption( 'GUICloseOnESC' , 0 )
- AutoItSetOption( 'TrayAutoPause' , 0 )
- AutoItSetOption( 'TrayIconHide' , 1 )
- Dim Const $caption = 'WSUS Offline Update 9.7 - Installer'
- Dim Const $wou_hostname = 'www.wsusoffline.net'
- Dim Const $donationURL = 'http://www.wsusoffline.net/donate.html'
- ; Registry constants
- Dim Const $reg_key_wsh_hklm = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings'
- Dim Const $reg_key_wsh_hkcu = 'HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings'
- Dim Const $reg_key_ie = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer'
- Dim Const $reg_key_mssl = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight'
- Dim Const $reg_key_dotnet35 = 'HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.5'
- Dim Const $reg_key_dotnet4 = 'HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v4\Full'
- Dim Const $reg_key_psh = 'HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\PowerShellEngine'
- Dim Const $reg_key_wmf = 'HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\3\PowerShellEngine'
- Dim Const $reg_key_msse = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Security Client'
- Dim Const $reg_key_hkcu_desktop = 'HKEY_CURRENT_USER\Control Panel\Desktop'
- Dim Const $reg_key_hkcu_winmetrics = 'HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics'
- Dim Const $reg_key_windowsupdate = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate'
- Dim Const $reg_val_default = ''
- Dim Const $reg_val_enabled = 'Enabled'
- Dim Const $reg_val_version = 'Version'
- Dim Const $reg_val_pshversion = 'PowerShellVersion'
- Dim Const $reg_val_logpixels = 'LogPixels'
- Dim Const $reg_val_applieddpi = 'AppliedDPI'
- Dim Const $reg_val_wustatusserver = 'WUStatusServer'
- ; Defaults
- Dim Const $wlemax = 7
- Dim Const $msimax = 22
- Dim Const $default_logpixels = 96
- Dim Const $target_version_dotnet35 = '3.5.30729'
- Dim Const $target_version_dotnet40 = '4.0.30319'
- Dim Const $target_version_dotnet45 = '4.5.51209'
- Dim Const $target_version_dotnet45w63 = '4.5.51650'
- Dim Const $target_version_psh = '2.0'
- ; INI file constants
- Dim Const $ini_section_installation = 'Installation'
- Dim Const $ini_value_backup = 'backup'
- Dim Const $ini_value_rcerts = 'updatercerts'
- Dim Const $ini_value_ie7 = 'instie7'
- Dim Const $ini_value_ie8 = 'instie8'
- Dim Const $ini_value_ie9 = 'instie9'
- Dim Const $ini_value_ie10 = 'instie10'
- Dim Const $ini_value_ie11 = 'instie11'
- Dim Const $ini_value_cpp = 'updatecpp'
- Dim Const $ini_value_mssl = 'instmssl'
- Dim Const $ini_value_dotnet35 = 'instdotnet35'
- Dim Const $ini_value_dotnet4 = 'instdotnet4'
- Dim Const $ini_value_psh = 'instpsh'
- Dim Const $ini_value_wmf = 'instwmf'
- Dim Const $ini_value_msse = 'instmsse'
- Dim Const $ini_value_tsc = 'updatetsc'
- Dim Const $ini_value_ofv = 'instofv'
- Dim Const $ini_value_all = 'all'
- Dim Const $ini_value_excludestatics = 'excludestatics'
- Dim Const $ini_value_skipdynamic = 'skipdynamic'
- Dim Const $ini_section_control = 'Control'
- Dim Const $ini_value_verify = 'verify'
- Dim Const $ini_value_autoreboot = 'autoreboot'
- Dim Const $ini_value_shutdown = 'shutdown'
- Dim Const $ini_section_messaging = 'Messaging'
- Dim Const $ini_value_showlog = 'showlog'
- Dim Const $ini_section_wle = 'Essentials'
- Dim Const $ini_section_msi = 'MSI'
- Dim Const $ini_section_misc = 'Miscellaneous'
- Dim Const $ini_value_showdonate = 'showdonate'
- Dim Const $ini_value_wustatusserver = 'WUStatusServer'
- Dim Const $enabled = 'Enabled'
- Dim Const $disabled = 'Disabled'
- ; Paths
- Dim Const $path_max_length = 192
- Dim Const $path_invalid_chars = '!%&()^+,;='
- Dim Const $path_rel_builddate = '\builddate.txt'
- Dim Const $path_rel_hashes = '\md\'
- Dim Const $path_rel_autologon = '\bin\Autologon.exe'
- Dim Const $path_rel_win_glb = '\win\glb\'
- Dim Const $path_rel_cpp = '\cpp\vcredist*.exe'
- Dim Const $path_rel_instdotnet40 = '\dotnet\dotNetFx40*.exe'
- Dim Const $path_rel_instdotnet45 = '\dotnet\NDP452-KB2901907-x86-x64-AllOS*.exe'
- Dim Const $path_rel_ofc_glb = '\ofc\glb\'
- Dim Const $path_rel_msse_x86 = '\msse\x86-glb\MSEInstall-x86-*.exe'
- Dim Const $path_rel_msse_x64 = '\msse\x64-glb\MSEInstall-x64-*.exe'
- Dim Const $path_rel_wle = '\wle\wlsetup-all-*.exe'
- Dim Const $path_rel_wle_cmd = '\Temp\wouinstwle.cmd'
- Dim Const $path_rel_msi_all = '\wouallmsi.txt'
- Dim Const $path_rel_msi_selected = '\Temp\wouselmsi.txt'
- Dim $maindlg , $scriptdir , $mapped , $tabitemfocused , $backup , $rcerts , $ie7 , $ie8 , $ie9 , $ie10 , $ie11 , $cpp , $mssl , $dotnet35 , $dotnet4 , $psh , $wmf , $msse , $tsc , $ofv , $verify , $autoreboot , $shutdown , $showlog , $btn_start , $btn_donate , $btn_exit , $options , $builddate
- Dim $dlgheight , $groupwidth , $txtwidth , $txtheight , $btnwidth , $btnheight , $txtxoffset , $txtyoffset , $txtxpos , $txtypos , $wleall , $wlepacks[$wlemax] , $wlecount , $wlecmdfile , $msiall , $msipacks[$msimax] , $msicount , $msilistfile , $line , $i
- Func ShowGUIInGerman()
- If $CmdLine[0] > 0 Then
- If StringLower( $CmdLine[1] ) = 'deu' Then
- Return True
- Else
- Return False
- EndIf
- EndIf
- Return StringInStr( '0007|0407|0807|0C07|1007|1407' , @OSLang ) > 0
- EndFunc
- ; Returns script directory, also sets global variable $mapped
- Func AssignScriptDirectory()
- Local $mapped , $result , $netdrives , $i
- ; Check if script directory is a network share, map if unmapped
- $mapped = False
- If DriveGetType( @ScriptDir ) = 'Network' Then
- If StringInStr( @ScriptDir , '\\' ) = 0 Then
- $result = @ScriptDir
- Else
- $netdrives = DriveGetDrive( 'NETWORK' )
- If NOT @error Then
- For $i = 1 to $netdrives[0]
- If StringInStr( @ScriptDir , DriveMapGet( $netdrives[$i] )) > 0 Then
- $result = $netdrives[$i] & StringRight( @ScriptDir , StringLen( @ScriptDir ) - StringLen( DriveMapGet( $netdrives[$i] )))
- ExitLoop
- EndIf
- Next
- EndIf
- If $result = '' Then
- $result = DriveMapAdd( '*' , @ScriptDir )
- If @error Then
- $result = ''
- Else
- $mapped = True
- EndIf
- EndIf
- EndIf
- Else
- $result = @ScriptDir
- EndIf
- Return $result
- EndFunc
- Func IsCheckBoxChecked( $chkbox )
- Return BitAND( GUICtrlRead( $chkbox ) , $GUI_CHECKED ) = $GUI_CHECKED
- EndFunc
- Func CheckBoxStateToString( $chkbox )
- If IsCheckBoxChecked( $chkbox ) Then
- Return $enabled
- Else
- Return $disabled
- EndIf
- EndFunc
- Func MyIniRead( $section , $key , $default )
- Local $inifilepath
- $inifilepath = @TempDir & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
- If NOT FileExists( $inifilepath ) Then
- $inifilepath = $scriptdir & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
- EndIf
- Return IniRead( $inifilepath , $section , $key , $default )
- EndFunc
- Func IniCopy()
- Dim $ini_src , $ini_dest , $i
- $ini_src = $scriptdir & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
- $ini_dest = @TempDir & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
- FileCopy( $ini_src , $ini_dest , 1 )
- FileSetAttrib( $ini_dest , '-R' )
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_backup , CheckBoxStateToString( $backup ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_rcerts , CheckBoxStateToString( $rcerts ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie7 , CheckBoxStateToString( $ie7 ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie8 , CheckBoxStateToString( $ie8 ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie9 , CheckBoxStateToString( $ie9 ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie10 , CheckBoxStateToString( $ie10 ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie11 , CheckBoxStateToString( $ie11 ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_cpp , CheckBoxStateToString( $cpp ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_mssl , CheckBoxStateToString( $mssl ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_dotnet35 , CheckBoxStateToString( $dotnet35 ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_psh , CheckBoxStateToString( $psh ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_dotnet4 , CheckBoxStateToString( $dotnet4 ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_wmf , CheckBoxStateToString( $wmf ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_msse , CheckBoxStateToString( $msse ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_tsc , CheckBoxStateToString( $tsc ))
- IniWrite( $ini_dest , $ini_section_installation , $ini_value_ofv , CheckBoxStateToString( $ofv ))
- IniWrite( $ini_dest , $ini_section_control , $ini_value_verify , CheckBoxStateToString( $verify ))
- IniWrite( $ini_dest , $ini_section_control , $ini_value_autoreboot , CheckBoxStateToString( $autoreboot ))
- IniWrite( $ini_dest , $ini_section_control , $ini_value_shutdown , CheckBoxStateToString( $shutdown ))
- IniWrite( $ini_dest , $ini_section_messaging , $ini_value_showlog , CheckBoxStateToString( $showlog ))
- For $i = 0 To $wlecount - 1
- IniWrite( $ini_dest , $ini_section_wle , GUICtrlRead( $wlepacks[$i] , 1 ) , CheckBoxStateToString( $wlepacks[$i] ))
- Next
- For $i = 0 To $msicount - 1
- IniWrite( $ini_dest , $ini_section_msi , GUICtrlRead( $msipacks[$i] , 1 ) , CheckBoxStateToString( $msipacks[$i] ))
- Next
- Return 0
- EndFunc
- Func PathValid( $path )
- Local $result , $arr_invalid , $i
- If StringLen( $path ) > $path_max_length Then
- $result = False
- Else
- $result = True
- $arr_invalid = StringSplit( $path_invalid_chars , '' )
- For $i = 1 to $arr_invalid[0]
- If StringInStr( $path , $arr_invalid[$i] ) > 0 Then
- $result = False
- ExitLoop
- EndIf
- Next
- EndIf
- Return $result
- EndFunc
- Func MediumBuildDate( $basepath )
- Local $result = FileReadLine( $basepath & $path_rel_builddate )
- If @error Then $result = ''
- Return $result
- EndFunc
- Func WSHAvailable()
- Local $reg_val
- $reg_val = RegRead( $reg_key_wsh_hklm , $reg_val_enabled )
- If ( $reg_val = '0' ) Then Return 0
- $reg_val = RegRead( $reg_key_wsh_hkcu , $reg_val_enabled )
- If ( $reg_val = '0' ) Then Return 0
- Return 1
- EndFunc
- Func IEVersion()
- Local $reg_val
- $reg_val = RegRead( $reg_key_ie , $reg_val_version )
- If StringInStr( $reg_val , '9.10.' ) > 0 Then Return '10'
- If StringInStr( $reg_val , '9.11.' ) > 0 Then Return '11'
- Return StringLeft( $reg_val , StringInStr( $reg_val , '.' ) - 1 )
- EndFunc
- Func DotNet35Version()
- Local $reg_val = RegRead( $reg_key_dotnet35 , $reg_val_version )
- Return StringLeft( $reg_val , StringInStr( $reg_val , '.' , 0 , -1 ) - 1 )
- EndFunc
- Func DotNet4Version()
- Return RegRead( $reg_key_dotnet4 , $reg_val_version )
- EndFunc
- Func DotNet4MainVersion()
- Return StringLeft( DotNet4Version() , 3 )
- EndFunc
- Func DotNet4TargetVersion()
- If StringInStr( 'WIN_XP|WIN_2003' , @OSVersion ) > 0 Then
- Return $target_version_dotnet40
- Else
- If StringInStr( 'WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
- Return $target_version_dotnet45w63
- Else
- Return $target_version_dotnet45
- EndIf
- EndIf
- EndFunc
- Func PowerShellVersion()
- Return RegRead( $reg_key_psh , $reg_val_pshversion )
- EndFunc
- Func ManagementFrameworkVersion()
- Return RegRead( $reg_key_wmf , $reg_val_pshversion )
- EndFunc
- Func WMFTargetVersion()
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
- Return '4.0'
- Else
- Return '3.0'
- EndIf
- EndFunc
- Func MSSLInstalled()
- Local $dummy = RegRead( $reg_key_mssl , $reg_val_default )
- Return ( @error <= 0 )
- EndFunc
- Func MSSEInstalled()
- Local $dummy = RegRead( $reg_key_msse , $reg_val_default )
- Return ( @error <= 0 )
- EndFunc
- Func HashFilesPresent( $basepath )
- Return FileExists( $basepath & $path_rel_hashes )
- EndFunc
- Func AutologonPresent( $basepath )
- Return FileExists( $basepath & $path_rel_autologon )
- EndFunc
- Func WinGlbPresent( $basepath )
- Return FileExists( $basepath & $path_rel_win_glb )
- EndFunc
- Func CPPPresent( $basepath )
- Return FileExists( $basepath & $path_rel_cpp )
- EndFunc
- Func DotNet4InstPresent( $basepath )
- Return FileExists( $basepath & $path_rel_instdotnet40 ) OR FileExists( $basepath & $path_rel_instdotnet45 )
- EndFunc
- Func OfcGlbPresent( $basepath )
- Return FileExists( $basepath & $path_rel_ofc_glb )
- EndFunc
- Func MSSEPresent( $basepath )
- Return FileExists( $basepath & $path_rel_msse_x86 ) OR FileExists( $basepath & $path_rel_msse_x64 )
- EndFunc
- Func WLEPresent( $basepath )
- Return FileExists( $basepath & $path_rel_wle )
- EndFunc
- Func ListMSIPackages()
- Local $result = RunWait( @ComSpec & ' /D /C TouchMSITree.cmd /listall' , $scriptdir & '\cmd' , @SW_HIDE )
- If $result = 0 Then $result = @error
- Return $result
- EndFunc
- Func CalcGUISize()
- Local $reg_val
- If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) Then
- DllCall( 'user32.dll' , 'int' , 'SetProcessDPIAware' )
- EndIf
- $reg_val = RegRead( $reg_key_hkcu_winmetrics , $reg_val_applieddpi )
- If $reg_val = '' Then $reg_val = RegRead( $reg_key_hkcu_desktop , $reg_val_logpixels )
- If $reg_val = '' Then $reg_val = $default_logpixels
- $dlgheight = 380 * $reg_val / $default_logpixels
- If ShowGUIInGerman() Then
- $txtwidth = 240 * $reg_val / $default_logpixels
- Else
- $txtwidth = 220 * $reg_val / $default_logpixels
- EndIf
- $txtheight = 20 * $reg_val / $default_logpixels
- $btnwidth = 80 * $reg_val / $default_logpixels
- $btnheight = 25 * $reg_val / $default_logpixels
- $txtxoffset = 10 * $reg_val / $default_logpixels
- $txtyoffset = 10 * $reg_val / $default_logpixels
- Return 0
- EndFunc
- ; Main Dialog
- CalcGUISize()
- $groupwidth = 2 * $txtwidth + 2 * $txtxoffset
- $maindlg = GUICreate( $caption , $groupwidth + 4 * $txtxoffset , $dlgheight )
- GUISetFont( 8.5 , 400 , 0 , 'Sans Serif' )
- $scriptdir = AssignScriptDirectory()
- ; Label
- $txtxpos = $txtxoffset
- $txtypos = $txtyoffset
- If ShowGUIInGerman() Then
- GUICtrlCreateLabel( 'Wählen Sie die gewünschten Optionen und klicken Sie auf "Start",' & @LF & 'um die fehlenden Microsoft-Updates auf Ihrem System zu installieren.' , $txtxpos , $txtypos , 3 * $groupwidth / 4 , 1.5 * $txtheight )
- Else
- GUICtrlCreateLabel( 'Select desired options and click "Start"' & @LF & 'to install missing Microsoft updates on your computer.' , $txtxpos , $txtypos , 3 * $groupwidth / 4 , 1.5 * $txtheight )
- EndIf
- ; Medium info group
- $builddate = MediumBuildDate( $scriptdir )
- If $builddate <> '' Then
- $txtxpos = 3 * $txtxoffset + 3 * $groupwidth / 4
- $txtypos = 0
- GUICtrlCreateGroup( ShowGUIInGerman() ? 'Medium-Info' : 'Medium info' , $txtxpos , $txtypos , $groupwidth / 4 , 2 * $txtheight )
- $txtxpos = $txtxpos + $txtxoffset
- $txtypos = $txtypos + 1.5 * $txtyoffset + 2
- GUICtrlCreateLabel( 'Build: ' & $builddate , $txtxpos , $txtypos , $groupwidth / 4 - 2 * $txtxoffset , $txtheight )
- EndIf
- ; Tab control
- $txtxpos = $txtxoffset
- $txtypos = $txtyoffset + 1.5 * $txtheight
- GuiCtrlCreateTab( $txtxpos , $txtypos , $groupwidth + 2 * $txtxoffset , $dlgheight - $btnheight - 1.5 * $txtheight - 3 * $txtyoffset )
- ; Updating Tab
- $tabitemfocused = GuiCtrlCreateTabItem( ShowGUIInGerman() ? 'Aktualisierung' : 'Updating' )
- ; Installation group
- $txtxpos = 2 * $txtxoffset
- $txtypos = 3.5 * $txtyoffset + 1.5 * $txtheight
- GUICtrlCreateGroup( 'Installation' , $txtxpos , $txtypos , $groupwidth , 10 * $txtheight )
- ; Backup
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + 1.5 * $txtyoffset
- $backup = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Existierende Systemdateien sichern' : 'Back up existing system files' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
- GUICtrlSetState( -1 , $GUI_CHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_backup , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Update Root Certificates
- $txtxpos = $txtxpos + $txtwidth
- $rcerts = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Stammzertifikate aktualisieren' : 'Update Root Certificates' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If WinGlbPresent( $scriptdir ) Then
- If MyIniRead( $ini_section_installation , $ini_value_rcerts , $enabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- ; Install IE7
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $ie7 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 7 installieren' : 'Install Internet Explorer 7' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '7|8|9|10|11' , IEVersion()) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_ie7 , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Install IE8
- $txtxpos = $txtxpos + $txtwidth
- $ie8 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 8 installieren' : 'Install Internet Explorer 8' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '8|9|10|11' , IEVersion() ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_ie8 , $enabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- If IsCheckBoxChecked( $ie7 ) Then
- GUICtrlSetState( -1 , $GUI_DISABLE )
- EndIf
- EndIf
- EndIf
- ; Install IE9
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $ie9 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 9 installieren' : 'Install Internet Explorer 9' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '9|10|11' , IEVersion() ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_ie9 , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- If ( IsCheckBoxChecked( $ie7 ) OR IsCheckBoxChecked( $ie8 )) Then
- GUICtrlSetState( -1 , $GUI_DISABLE )
- EndIf
- EndIf
- EndIf
- ; Install IE10
- $txtxpos = $txtxpos + $txtwidth
- $ie10 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 10 installieren' : 'Install Internet Explorer 10' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '10|11' , IEVersion() ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_ie10 , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- If ( IsCheckBoxChecked( $ie7 ) OR IsCheckBoxChecked( $ie8 ) OR IsCheckBoxChecked( $ie9 )) Then
- GUICtrlSetState( -1 , $GUI_DISABLE )
- EndIf
- EndIf
- EndIf
- ; Install IE11
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $ie11 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 11 installieren' : 'Install Internet Explorer 11' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- IEVersion() = '11' OR NOT WinGlbPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_ie11 , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- If ( IsCheckBoxChecked( $ie7 ) OR IsCheckBoxChecked( $ie8 ) OR IsCheckBoxChecked( $ie9 ) OR IsCheckBoxChecked( $ie10 )) Then
- GUICtrlSetState( -1 , $GUI_DISABLE )
- EndIf
- EndIf
- EndIf
- ; Update C++ Runtime Libraries
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $cpp = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'C++-Laufzeitbibliotheken aktualisieren' : 'Update C++ Runtime Libraries' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If CPPPresent( $scriptdir ) Then
- If MyIniRead( $ini_section_installation , $ini_value_cpp , $enabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- ; Install Microsoft Silverlight
- $txtxpos = $txtxpos + $txtwidth
- If ShowGUIInGerman() Then
- If MSSLInstalled() Then
- $mssl = GUICtrlCreateCheckbox( 'Microsoft Silverlight aktualisieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- Else
- $mssl = GUICtrlCreateCheckbox( 'Microsoft Silverlight installieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- EndIf
- Else
- If MSSLInstalled() Then
- $mssl = GUICtrlCreateCheckbox( 'Update Microsoft Silverlight' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- Else
- $mssl = GUICtrlCreateCheckbox( 'Install Microsoft Silverlight' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- EndIf
- EndIf
- If (( NOT WinGlbPresent( $scriptdir ))) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_mssl , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Install .NET Framework 3.5
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $dotnet35 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? '.NET Framework 3.5 installieren' : 'Install .NET Framework 3.5' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_7|WIN_2008R2' , @OSVersion ) > 0 OR DotNet35Version() = $target_version_dotnet35 Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_dotnet35 , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Install Windows PowerShell 2.0
- $txtxpos = $txtxpos + $txtwidth
- $psh = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'PowerShell 2.0 installieren' : 'Install PowerShell 2.0' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- ( DotNet35Version() <> $target_version_dotnet35 AND NOT IsCheckBoxChecked( $dotnet35 )) OR _
- PowerShellVersion() = $target_version_psh Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_psh , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Install .NET Framework 4
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $dotnet4 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? '.NET Framework 4.x installieren' : 'Install .NET Framework 4.x' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If DotNet4Version() = DotNet4TargetVersion() OR NOT DotNet4InstPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_dotnet4 , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Install Windows Management Framework
- $txtxpos = $txtxpos + $txtwidth
- If ShowGUIInGerman() Then
- $wmf = GUICtrlCreateCheckbox( 'Management Framework ' & WMFTargetVersion() & ' installieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- Else
- $wmf = GUICtrlCreateCheckbox( 'Install Management Framework ' & WMFTargetVersion() , $txtxpos , $txtypos , $txtwidth , $txtheight )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_8|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- ( DotNet4MainVersion() <> '4.5' AND NOT IsCheckBoxChecked( $dotnet4 )) OR ManagementFrameworkVersion() = WMFTargetVersion() Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_wmf , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Install Microsoft Security Essentials
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- If ShowGUIInGerman() Then
- If MSSEInstalled() Then
- $msse = GUICtrlCreateCheckbox( 'Microsoft Security Essentials aktualisieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- Else
- $msse = GUICtrlCreateCheckbox( 'Microsoft Security Essentials installieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- EndIf
- Else
- If MSSEInstalled() Then
- $msse = GUICtrlCreateCheckbox( 'Update Microsoft Security Essentials' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- Else
- $msse = GUICtrlCreateCheckbox( 'Install Microsoft Security Essentials' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- EndIf
- EndIf
- If StringInStr( 'WIN_2003|WIN_2008|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR NOT MSSEPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_msse , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Update Windows Remote Desktop Client
- $txtxpos = $txtxpos + $txtwidth
- $tsc = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Remote Desktop Client aktualisieren' : 'Update Remote Desktop Client' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If StringInStr( 'WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_installation , $ini_value_tsc , $enabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- EndIf
- ; Install Office File Validation
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $ofv = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Office-Dateiüberprüfung installieren' : 'Install Office File Validation' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If OfcGlbPresent( $scriptdir ) Then
- If MyIniRead( $ini_section_installation , $ini_value_ofv , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- ; Control group
- $txtxpos = 2 * $txtxoffset
- $txtypos = $txtypos + 2.5 * $txtyoffset
- GUICtrlCreateGroup( ShowGUIInGerman() ? 'Steuerung' : 'Control' , $txtxpos , $txtypos , $groupwidth , 3 * $txtheight )
- ; Verify
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + 1.5 * $txtyoffset
- $verify = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Installationspakete verifizieren' : 'Verify installation packages' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If HashFilesPresent( $scriptdir ) Then
- If MyIniRead( $ini_section_control , $ini_value_verify , $enabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- ; Automatic reboot and recall
- $txtxpos = $txtxpos + $txtwidth
- $autoreboot = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Automatisch neu starten und fortsetzen' : 'Automatic reboot and recall' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If AutologonPresent( $scriptdir ) Then
- If MyIniRead( $ini_section_control , $ini_value_autoreboot , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- ; Automatic shutdown
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + $txtheight
- $shutdown = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Herunterfahren nach Abschluss' : 'Shut down on completion' , _
- $txtxpos , $txtypos , $txtwidth , $txtheight )
- If MyIniRead( $ini_section_control , $ini_value_shutdown , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- EndIf
- ; Show log file
- $txtxpos = $txtxpos + $txtwidth
- $showlog = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Protokolldatei anzeigen' : 'Show log file' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- If (( MyIniRead( $ini_section_messaging , $ini_value_showlog , $disabled ) = $enabled ) _
- AND ( NOT IsCheckBoxChecked( $shutdown ))) Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- Else
- GUICtrlSetState( -1 , $GUI_UNCHECKED )
- If IsCheckBoxChecked( $shutdown ) Then
- GUICtrlSetState( -1 , $GUI_DISABLE )
- EndIf
- EndIf
- ; Essentials Tab
- $wlecount = 1
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 AND WLEPresent( $scriptdir ) Then
- GuiCtrlCreateTabItem( 'Essentials' )
- ; Select all
- $txtxpos = 2 * $txtxoffset
- $txtypos = 3.5 * $txtyoffset + 1.5 * $txtheight
- If ShowGUIInGerman() Then
- $wleall = GUICtrlCreateCheckbox( 'Alle auswählen' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- Else
- $wleall = GUICtrlCreateCheckbox( 'Select all' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- EndIf
- If ( DotNet35Version() <> $target_version_dotnet35 AND NOT IsCheckBoxChecked( $dotnet35 )) OR _
- ( DotNet4MainVersion() <> '4.5' AND NOT IsCheckBoxChecked( $dotnet4 )) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- ; WLE packages' group
- $txtypos = $txtypos + $txtheight
- If StringInStr( 'WIN_7|WIN_2008R2' , @OSVersion ) > 0 Then
- $wlecount = $wlemax
- Else
- $wlecount = $wlemax - 1
- EndIf
- GUICtrlCreateGroup( 'Windows Essentials 2012' , $txtxpos , $txtypos , $groupwidth , ( BitShift( $wlecount + 1 , 1 ) + 1 ) * $txtheight )
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + 1.5 * $txtyoffset
- For $i = 0 To $wlecount - 1
- Switch $i
- Case 0
- $wlepacks[$i] = GUICtrlCreateCheckbox( 'OneDrive' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
- Case 1
- $wlepacks[$i] = GUICtrlCreateCheckbox( 'Messenger' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
- Case 2
- $wlepacks[$i] = GUICtrlCreateCheckbox( 'Mail' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
- Case 3
- $wlepacks[$i] = GUICtrlCreateCheckbox( 'Outlook Connector Pack' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
- Case 4
- $wlepacks[$i] = GUICtrlCreateCheckbox( 'Photo Gallery and Movie Maker' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
- Case 5
- $wlepacks[$i] = GUICtrlCreateCheckbox( 'Writer' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
- Case 6
- $wlepacks[$i] = GUICtrlCreateCheckbox( 'Family Safety' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
- EndSwitch
- If (( DotNet35Version() <> $target_version_dotnet35 ) AND ( NOT IsCheckBoxChecked( $dotnet35 ))) _
- OR (( DotNet4MainVersion() <> '4.5' ) AND ( NOT IsCheckBoxChecked( $dotnet4 ))) Then
- GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If MyIniRead( $ini_section_wle , GUICtrlRead( -1 , 1 ) , $disabled ) = $enabled Then
- GUICtrlSetState( -1 , $GUI_CHECKED )
- EndIf
- EndIf
- Next
- $txtxpos = 2 * $txtxoffset
- $txtypos = $txtypos + BitShift( $wlecount + 1 , 1 ) * $txtheight + 0.5 * $txtyoffset
- If ShowGUIInGerman() Then
- GUICtrlCreateGroup( 'Systemvoraussetzungen' , $txtxpos , $txtypos , $groupwidth , 4 * $txtheight )
- Else
- GUICtrlCreateGroup( 'Prerequisites' , $txtxpos , $txtypos , $groupwidth , 4 * $txtheight )
- EndIf
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + 1.5 * $txtyoffset
- If ShowGUIInGerman() Then
- GUICtrlCreateLabel( 'Windows Essentials 2012 erfordern sowohl .NET Framework 3.5 als auch 4.5.' _
- & @LF & 'Wenn die Optionen auf dieser Seite deaktiviert sind,' _
- & @LF & 'wählen Sie bitte die entsprechende(n) Installationsoption(en) unter "Aktualisierung".' _
- & @LF & 'Windows 8 / 8.1: Stellen Sie zusätzlich sicher, dass das Sxs-Verzeichnis integriert wurde.' , _
- $txtxpos , $txtypos , 3 * $groupwidth - 2 * $txtxoffset , 3 * $txtheight )
- Else
- GUICtrlCreateLabel( 'Windows Essentials 2012 require both .NET Frameworks 3.5 and 4.5.' _
- & @LF & 'If options are grayed out on this tab,' _
- & @LF & 'please select the corresponding installation option(s) on the "Updating" tab.' _
- & @LF & 'Windows 8 / 8.1: Additionally be sure to have the Sxs folder integrated.' , _
- $txtxpos , $txtypos , 3 * $groupwidth - 2 * $txtxoffset , 3 * $txtheight )
- EndIf
- EndIf
- ; Software Tab
- $msicount = 1
- ListMSIPackages()
- If FileExists( @TempDir & $path_rel_msi_all ) Then
- GuiCtrlCreateTabItem( 'Software' )
- ; Select all
- $txtxpos = 2 * $txtxoffset
- $txtypos = 3.5 * $txtyoffset + 1.5 * $txtheight
- If ShowGUIInGerman() Then
- $msiall = GUICtrlCreateCheckbox( 'Alle auswählen' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- Else
- $msiall = GUICtrlCreateCheckbox( 'Select all' , $txtxpos , $txtypos , $txtwidth , $txtheight )
- EndIf
- ; MSI packages' group
- $txtypos = $txtypos + $txtheight
- If ShowGUIInGerman() Then
- GUICtrlCreateGroup( 'MSI-Pakete' , $txtxpos , $txtypos , $groupwidth , ( $msimax / 2 + 1 ) * $txtheight )
- Else
- GUICtrlCreateGroup( 'MSI packages' , $txtxpos , $txtypos , $groupwidth , ( $msimax / 2 + 1 ) * $txtheight )
- EndIf
- $txtxpos = 3 * $txtxoffset
- $txtypos = $txtypos + 1.5 * $txtyoffset
- For $msicount = 0 To $msimax - 1
- $line = FileReadLine( @TempDir & $path_rel_msi_all , $msicount + 1 )
- If @error <> 0 Then ExitLoop
- $msipacks[$msicount] = GUICtrlCreateCheckbox( $line , $txtxpos + Mod( $msicount , 2 ) * $txtwidth , $txtypos + BitShift( $msicount , 1 ) * $txtheight , $txtwidth , $txtheight )
- If MyIniRead( $ini_section_msi , GUICtrlRead( -1 , 1 ) , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_CHECKED )
- Next
- FileDelete( @TempDir & $path_rel_msi_all )
- If $msicount = 0 Then $msicount = 1
- EndIf
- ; End Tab item definition
- GuiCtrlCreateTabItem( '' )
- GUICtrlSetState( $tabitemfocused , $GUI_SHOW )
- ; Start button
- $txtypos = $dlgheight - $btnheight - $txtyoffset
- $btn_start = GUICtrlCreateButton( 'Start' , $txtxoffset , $txtypos , $btnwidth , $btnheight )
- GUICtrlSetResizing ( -1 , $GUI_DOCKLEFT + $GUI_DOCKBOTTOM )
- ; Donate button
- If ShowGUIInGerman() Then
- $btn_donate = GUICtrlCreateButton( 'Spenden...' , ( $groupwidth - $btnwidth ) / 2 + 2 * $txtxoffset , $txtypos , $btnwidth , $btnheight )
- Else
- $btn_donate = GUICtrlCreateButton( 'Donate...' , ( $groupwidth - $btnwidth ) / 2 + 2 * $txtxoffset , $txtypos , $btnwidth , $btnheight )
- EndIf
- GUICtrlSetResizing( -1 , $GUI_DOCKBOTTOM )
- If ( MyIniRead( $ini_section_misc , $ini_value_showdonate , $enabled ) = $disabled ) OR ( Ping( $wou_hostname ) = 0 ) Then
- GUICtrlSetState( -1 , $GUI_HIDE )
- EndIf
- ; Exit button
- $btn_exit = GUICtrlCreateButton( ShowGUIInGerman() ? 'Ende' : 'Exit' , $groupwidth - $btnwidth + 3 * $txtxoffset , $txtypos , $btnwidth , $btnheight )
- GUICtrlSetResizing ( -1 , $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM )
- ; GUI message loop
- GUISetState()
- If NOT WSHAvailable() Then
- If ShowGUIInGerman() Then
- MsgBox( 0x2010 , 'Fehler' , 'Der Windows Script Host ist deaktiviert. Bitte prüfen Sie die Registrierungswerte' _
- & @LF & 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings\Enabled und' _
- & @LF & 'HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings\Enabled' )
- Else
- MsgBox( 0x2010 , 'Error' , 'Windows Script Host is disabled on this machine. Please check registry values' _
- & @LF & 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings\Enabled and' _
- & @LF & 'HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings\Enabled' )
- EndIf
- Exit(1)
- EndIf
- If $scriptdir = '' Then
- If ShowGUIInGerman() Then
- MsgBox( 0x2010 , 'Fehler' , 'Dem Skript-Pfad ' & @ScriptDir _
- & @LF & 'konnte kein Laufwerksbuchstabe zugewiesen werden.' )
- Else
- MsgBox( 0x2010 , 'Error' , 'Unable to assign a drive letter' _
- & @LF & 'to the script path ' & @ScriptDir )
- EndIf
- Exit(1)
- EndIf
- If NOT PathValid( $scriptdir ) Then
- If ShowGUIInGerman() Then
- MsgBox( 0x2010 , 'Fehler' , 'Der Skript-Pfad darf nicht mehr als ' & $path_max_length & ' Zeichen lang sein und' _
- & @LF & 'darf keines der folgenden Zeichen enthalten: ' & $path_invalid_chars )
- Else
- MsgBox( 0x2010 , 'Error' , 'The script path must not be more than ' & $path_max_length & ' characters long and' _
- & @LF & 'must not contain any of the following characters: ' & $path_invalid_chars )
- EndIf
- Exit(1)
- EndIf
- If NOT PathValid( @TempDir ) Then
- If ShowGUIInGerman() Then
- MsgBox( 0x2010 , 'Fehler' , 'Der %TEMP%-Pfad darf nicht mehr als ' & $path_max_length & ' Zeichen lang sein und' _
- & @LF & 'darf keines der folgenden Zeichen enthalten: ' & $path_invalid_chars )
- Else
- MsgBox( 0x2010 , 'Error' , 'The %TEMP% path must not be more than ' & $path_max_length & ' characters long and' _
- & @LF & 'must not contain any of the following characters: ' & $path_invalid_chars )
- EndIf
- Exit(1)
- EndIf
- If StringRight( EnvGet( 'TEMP' ) , 1 ) = '\' OR StringRight( EnvGet( 'TEMP' ) , 1 ) = ':' Then
- If ShowGUIInGerman() Then
- MsgBox( 0x2010 , 'Fehler' , 'Der %TEMP%-Pfad enthält einen abschließenden Backslash ("\")' _
- & @LF & 'oder einen abschließenden Doppelpunkt (":").' )
- Else
- MsgBox( 0x2010 , 'Error' , 'The %TEMP% path contains a trailing backslash ("\")' _
- & @LF & 'or a trailing colon (":").' )
- EndIf
- Exit(1)
- EndIf
- While 1
- Switch GUIGetMsg()
- ; Window closed
- Case $GUI_EVENT_CLOSE
- If $mapped Then DriveMapDel( $scriptdir )
- ExitLoop
- ; Exit Button pressed
- Case $btn_exit
- If $mapped Then DriveMapDel( $scriptdir )
- ExitLoop
- ; Donate button pressed
- Case $btn_donate
- ShellExecute( $donationURL )
- ; IE7 check box toggled
- Case $ie7
- If IsCheckBoxChecked( $ie7 ) Then
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie8 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie9 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR StringInStr( '10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie10 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie11 , $GUI_ENABLE )
- EndIf
- EndIf
- ; IE8 check box toggled
- Case $ie8
- If IsCheckBoxChecked( $ie8 ) Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie7 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie9 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR StringInStr( '10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie10 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie11 , $GUI_ENABLE )
- EndIf
- EndIf
- ; IE9 check box toggled
- Case $ie9
- If IsCheckBoxChecked( $ie9 ) Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie7 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie8 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR StringInStr( '10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie10 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie11 , $GUI_ENABLE )
- EndIf
- EndIf
- ; IE10 check box toggled
- Case $ie10
- If IsCheckBoxChecked( $ie10 ) Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie7 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie8 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie9 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
- GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie11 , $GUI_ENABLE )
- EndIf
- EndIf
- ; IE11 check box toggled
- Case $ie11
- If IsCheckBoxChecked( $ie11 ) Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie7 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '8|9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie8 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
- StringInStr( '9|10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie9 , $GUI_ENABLE )
- EndIf
- If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR _
- StringInStr( '10|11' , IEVersion()) > 0 Then
- GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $ie10 , $GUI_ENABLE )
- EndIf
- EndIf
- ; .NET 3.5 check box toggled
- Case $dotnet35
- If IsCheckBoxChecked( $dotnet35 ) AND PowerShellVersion() <> $target_version_psh AND _
- StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) = 0 Then
- GUICtrlSetState( $psh , $GUI_ENABLE )
- Else
- GUICtrlSetState( $psh , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- ; .NET 4 check box toggled
- Case $dotnet4
- If ( IsCheckBoxChecked( $dotnet4 ) OR DotNet4MainVersion() = '4.5' ) AND ManagementFrameworkVersion() <> WMFTargetVersion() AND _
- StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_8|WIN_81|WIN_2012R2' , @OSVersion ) = 0 Then
- GUICtrlSetState( $wmf , $GUI_ENABLE )
- Else
- GUICtrlSetState( $wmf , $GUI_UNCHECKED + $GUI_DISABLE )
- EndIf
- If ( IsCheckBoxChecked( $dotnet4 ) OR DotNet4MainVersion() = '4.5' ) AND _
- ( IsCheckBoxChecked( $dotnet35 ) OR DotNet35Version() = $target_version_dotnet35 ) Then
- GUICtrlSetState( $wleall , $GUI_ENABLE )
- For $i = 0 To $wlecount - 1
- GUICtrlSetState( $wlepacks[$i] , $GUI_ENABLE )
- Next
- Else
- GUICtrlSetState( $wleall , $GUI_UNCHECKED + $GUI_DISABLE )
- For $i = 0 To $wlecount - 1
- GUICtrlSetState( $wlepacks[$i] , $GUI_UNCHECKED + $GUI_DISABLE )
- Next
- EndIf
- ; Microsoft Security Essentials check box toggled
- Case $msse
- If IsCheckBoxChecked( $msse ) Then
- If ShowGUIInGerman() Then
- If MsgBox( 0x2134 , 'Warnung' , 'Bei der Installation der Microsoft Security Essentials wird eine' _
- & @LF & 'obligate "Windows Genuine Advantage" (WGA)-Prüfung durchgeführt.' _
- & @LF & 'Möchten Sie fortsetzen?' ) = 7 Then
- GUICtrlSetState( $msse , $GUI_UNCHECKED )
- EndIf
- Else
- If MsgBox( 0x2134 , 'Warning' , 'The installation of Microsoft Security Essentials performs' _
- & @LF & 'a mandatory "Windows Genuine Advantage" (WGA) check.' _
- & @LF & 'Do you wish to proceed?' ) = 7 Then
- GUICtrlSetState( $msse , $GUI_UNCHECKED )
- EndIf
- EndIf
- EndIf
- ; Automatic reboot check box toggled
- Case $autoreboot
- If IsCheckBoxChecked( $autoreboot ) AND StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
- If ShowGUIInGerman() Then
- If MsgBox( 0x2134 , 'Warnung' , 'Die Option "Automatisch neu starten und fortsetzen" deaktiviert' _
- & @LF & 'temporär die Benutzerkontensteuerung (UAC), falls erforderlich.' _
- & @LF & 'Möchten Sie fortsetzen?' ) = 7 Then
- GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
- EndIf
- Else
- If MsgBox( 0x2134 , 'Warning' , 'The option "Automatic reboot and recall" temporarily' _
- & @LF & 'disables the User Account Control (UAC), if required.' _
- & @LF & 'Do you wish to proceed?' ) = 7 Then
- GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
- EndIf
- EndIf
- EndIf
- If IsCheckBoxChecked( $autoreboot ) AND DriveGetType( $scriptdir ) = 'Network' Then
- If ShowGUIInGerman() Then
- If MsgBox( 0x2134 , 'Warnung' , @ScriptName & ' wurde von einer Netzwerkfreigabe gestartet.' _
- & @LF & 'Die Option "Automatisch neu starten und fortsetzen"' _
- & @LF & 'funktioniert nur dann ohne Benutzereingriff,' _
- & @LF & 'wenn diese Freigabe anonymen Zugriff erlaubt.' _
- & @LF & 'Möchten Sie fortsetzen?' ) = 7 Then
- GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
- EndIf
- Else
- If MsgBox( 0x2134 , 'Warning' , @ScriptName & ' was started from a network share.' _
- & @LF & 'The option "Automatic reboot and recall"' _
- & @LF & 'does only work without user interaction,' _
- & @LF & 'if this share permits anonymous access.' _
- & @LF & 'Do you wish to proceed?' ) = 7 Then
- GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
- EndIf
- EndIf
- EndIf
- ; Automatic shutdown check box toggled
- Case $shutdown
- If IsCheckBoxChecked( $shutdown ) Then
- GUICtrlSetState( $showlog , $GUI_UNCHECKED + $GUI_DISABLE )
- Else
- GUICtrlSetState( $showlog , $GUI_ENABLE )
- EndIf
- ; Select all check box toggled
- Case $wleall
- If IsCheckBoxChecked( $wleall ) Then
- For $i = 0 To $wlecount - 1
- GUICtrlSetState( $wlepacks[$i] , $GUI_CHECKED )
- Next
- Else
- For $i = 0 To $wlecount - 1
- GUICtrlSetState( $wlepacks[$i] , $GUI_UNCHECKED )
- Next
- EndIf
- Case $wlepacks[0] To $wlepacks[$wlecount - 1]
- For $i = 0 To $wlecount - 1
- If NOT IsCheckBoxChecked( $wlepacks[$i] ) Then
- GUICtrlSetState( $wleall , $GUI_UNCHECKED )
- ExitLoop
- EndIf
- Next
- ; Select all check box toggled
- Case $msiall
- If IsCheckBoxChecked( $msiall ) Then
- For $i = 0 To $msicount - 1
- GUICtrlSetState( $msipacks[$i] , $GUI_CHECKED )
- Next
- Else
- For $i = 0 To $msicount - 1
- GUICtrlSetState( $msipacks[$i] , $GUI_UNCHECKED )
- Next
- EndIf
- Case $msipacks[0] To $msipacks[$msicount - 1]
- For $i = 0 To $msicount - 1
- If NOT IsCheckBoxChecked( $msipacks[$i] ) Then
- GUICtrlSetState( $msiall , $GUI_UNCHECKED )
- ExitLoop
- EndIf
- Next
- ; Start Button pressed
- Case $btn_start
- ; Dummy use of $options
- $options = MyIniRead( $ini_section_misc , $ini_value_wustatusserver , '' )
- If $options <> '' Then RegWrite( $reg_key_windowsupdate , $reg_val_wustatusserver , 'REG_SZ' , $options )
- $options = ''
- If NOT IsCheckBoxChecked( $backup ) Then $options &= ' /nobackup'
- If IsCheckBoxChecked( $rcerts ) Then $options &= ' /updatercerts'
- If IsCheckBoxChecked( $ie7 ) Then $options &= ' /instie7'
- If IsCheckBoxChecked( $ie8 ) Then $options &= ' /instie8'
- If IsCheckBoxChecked( $ie9 ) Then $options &= ' /instie9'
- If IsCheckBoxChecked( $ie10 ) Then $options &= ' /instie10'
- If IsCheckBoxChecked( $ie11 ) Then $options &= ' /instie11'
- If IsCheckBoxChecked( $cpp ) Then $options &= ' /updatecpp'
- If IsCheckBoxChecked( $mssl ) Then $options &= ' /instmssl'
- If IsCheckBoxChecked( $dotnet35 ) Then $options &= ' /instdotnet35'
- If IsCheckBoxChecked( $psh ) Then $options &= ' /instpsh'
- If IsCheckBoxChecked( $dotnet4 ) Then $options &= ' /instdotnet4'
- If IsCheckBoxChecked( $wmf ) Then $options &= ' /instwmf'
- If IsCheckBoxChecked( $msse ) Then $options &= ' /instmsse'
- If IsCheckBoxChecked( $tsc ) Then $options &= ' /updatetsc'
- If IsCheckBoxChecked( $ofv ) Then $options &= ' /instofv'
- If IsCheckBoxChecked( $verify ) Then $options &= ' /verify'
- If BitAND( GUICtrlRead( $autoreboot ) , $GUI_DISABLE ) <> $GUI_DISABLE AND IsCheckBoxChecked( $autoreboot ) Then
- $options &= ' /autoreboot'
- Else
- IniCopy()
- EndIf
- If IsCheckBoxChecked( $shutdown ) Then $options &= ' /shutdown'
- If IsCheckBoxChecked( $showlog ) Then $options &= ' /showlog'
- If MyIniRead( $ini_section_installation , $ini_value_all , $disabled ) = $enabled Then $options &= ' /all'
- If MyIniRead( $ini_section_installation , $ini_value_excludestatics , $disabled ) = $enabled Then $options &= ' /excludestatics'
- If MyIniRead( $ini_section_installation , $ini_value_skipdynamic , $disabled ) = $enabled Then $options &= ' /skipdynamic'
- If IsCheckBoxChecked( $wleall ) Then
- $line = '%1 /AppSelect:All /noToolbarCEIP /noSearch /noHomepage /noMU /noLaunch /q'
- $wlecmdfile = FileOpen( @WindowsDir & $path_rel_wle_cmd , 10 )
- Else
- $wlecmdfile = -1
- For $i = 0 To $wlecount - 1
- If IsCheckBoxChecked( $wlepacks[$i] ) Then
- $wlecmdfile = FileOpen( @WindowsDir & $path_rel_wle_cmd , 10 )
- ExitLoop
- EndIf
- Next
- If $wlecmdfile <> -1 Then
- $line = '%1 /AppSelect:'
- For $i = 0 To $wlecount - 1
- If IsCheckBoxChecked( $wlepacks[$i] ) Then
- Switch $i
- Case 0 ; OneDrive
- $line = $line & 'wlsync,'
- Case 1 ; Messenger
- $line = $line & 'messenger,'
- Case 2 ; Mail
- $line = $line & 'mail,'
- Case 3 ; Outlook Connector Pack
- $line = $line & 'olc,'
- Case 4 ; Photo Gallery and Movie Maker
- $line = $line & 'moviemaker,'
- Case 5 ; Writer
- $line = $line & 'writer,'
- Case 6 ; Family Safety
- $line = $line & 'familysafety,'
- EndSwitch
- EndIf
- Next
- $line = StringLeft( $line , StringLen( $line ) - 1 ) & ' /noToolbarCEIP /noSearch /noHomepage /noMU /noLaunch /q'
- EndIf
- EndIf
- If $wlecmdfile <> -1 Then
- FileWriteLine( $wlecmdfile , $line )
- FileWriteLine( $wlecmdfile , 'echo %DATE% %TIME% - Info: Installed Windows Essentials 2012 (' & $line & ')>>%UPDATE_LOGFILE%' )
- FileClose( $wlecmdfile )
- EndIf
- $msilistfile = FileOpen( @WindowsDir & $path_rel_msi_selected , 10 )
- If $msilistfile <> -1 Then
- For $i = 0 To $msicount - 1
- If IsCheckBoxChecked( $msipacks[$i] ) Then FileWriteLine( $msilistfile , GUICtrlRead( $msipacks[$i] , 1 ))
- Next
- FileClose( $msilistfile )
- EndIf
- If FileGetSize( @WindowsDir & $path_rel_msi_selected ) = 0 Then
- FileDelete( @WindowsDir & $path_rel_msi_selected )
- EndIf
- If @OSArch <> 'X86' Then DllCall( 'kernel32.dll' , 'int' , 'Wow64DisableWow64FsRedirection' , 'int' , 1 )
- If Run( @ComSpec & ' /D /C Update.cmd' & $options , $scriptdir , @SW_HIDE ) = 0 Then
- If ShowGUIInGerman() Then
- MsgBox( 0x2010 , 'Fehler' , 'Fehler #' & @error & ' beim Aufruf von' _
- & @LF & @ComSpec & ' /D /C Update.cmd' & $options & ' in' _
- & @LF & $scriptdir & '.' )
- Else
- MsgBox( 0x2010 , 'Error' , 'Error #' & @error & ' when calling' _
- & @LF & @ComSpec & ' /D /C Update.cmd' & $options & ' in' _
- & @LF & $scriptdir & '.' )
- EndIf
- Else
- ExitLoop
- EndIf
- EndSwitch
- WEnd
- Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement