Advertisement
Nologic

Update Installer

Jul 10th, 2015
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 57.62 KB | None | 0 0
  1. ; ***  WSUS Offline Update 9.7 - Installer  ***
  2. ; ***       Author: T. Wittrock, Kiel       ***
  3. ; ***   Dialog scaling added by Th. Baisch  ***
  4.  
  5. #include <GUIConstants.au3>
  6. #RequireAdmin
  7.  
  8. #pragma compile( CompanyName      , 'T. Wittrock' )
  9. #pragma compile( FileDescription  , 'WSUS Offline Update Installer' )
  10. #pragma compile( FileVersion      , 9.7.0.669   )
  11. #pragma compile( InternalName     , 'Installer' )
  12. #pragma compile( LegalCopyright   , 'GNU GPLv3' )
  13. #pragma compile( OriginalFilename , UpdateInstaller.exe   )
  14. #pragma compile( ProductName      , 'WSUS Offline Update' )
  15. #pragma compile( ProductVersion   , 9.7.0 )
  16.  
  17. AutoItSetOption( 'GUICloseOnESC'  , 0 )
  18. AutoItSetOption( 'TrayAutoPause'  , 0 )
  19. AutoItSetOption( 'TrayIconHide'   , 1 )
  20.  
  21. Dim Const $caption                    = 'WSUS Offline Update 9.7 - Installer'
  22. Dim Const $wou_hostname               = 'www.wsusoffline.net'
  23. Dim Const $donationURL                = 'http://www.wsusoffline.net/donate.html'
  24.  
  25. ; Registry constants
  26. Dim Const $reg_key_wsh_hklm           = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings'
  27. Dim Const $reg_key_wsh_hkcu           = 'HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings'
  28. Dim Const $reg_key_ie                 = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer'
  29. Dim Const $reg_key_mssl               = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Silverlight'
  30. Dim Const $reg_key_dotnet35           = 'HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.5'
  31. Dim Const $reg_key_dotnet4            = 'HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v4\Full'
  32. Dim Const $reg_key_psh                = 'HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\PowerShellEngine'
  33. Dim Const $reg_key_wmf                = 'HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\3\PowerShellEngine'
  34. Dim Const $reg_key_msse               = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Security Client'
  35. Dim Const $reg_key_hkcu_desktop       = 'HKEY_CURRENT_USER\Control Panel\Desktop'
  36. Dim Const $reg_key_hkcu_winmetrics    = 'HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics'
  37. Dim Const $reg_key_windowsupdate      = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate'
  38.  
  39. Dim Const $reg_val_default            = ''
  40. Dim Const $reg_val_enabled            = 'Enabled'
  41. Dim Const $reg_val_version            = 'Version'
  42. Dim Const $reg_val_pshversion         = 'PowerShellVersion'
  43. Dim Const $reg_val_logpixels          = 'LogPixels'
  44. Dim Const $reg_val_applieddpi         = 'AppliedDPI'
  45. Dim Const $reg_val_wustatusserver     = 'WUStatusServer'
  46.  
  47. ; Defaults
  48. Dim Const $wlemax                     = 7
  49. Dim Const $msimax                     = 22
  50. Dim Const $default_logpixels          = 96
  51. Dim Const $target_version_dotnet35    = '3.5.30729'
  52. Dim Const $target_version_dotnet40    = '4.0.30319'
  53. Dim Const $target_version_dotnet45    = '4.5.51209'
  54. Dim Const $target_version_dotnet45w63 = '4.5.51650'
  55. Dim Const $target_version_psh         = '2.0'
  56.  
  57. ; INI file constants
  58. Dim Const $ini_section_installation   = 'Installation'
  59. Dim Const $ini_value_backup           = 'backup'
  60. Dim Const $ini_value_rcerts           = 'updatercerts'
  61. Dim Const $ini_value_ie7              = 'instie7'
  62. Dim Const $ini_value_ie8              = 'instie8'
  63. Dim Const $ini_value_ie9              = 'instie9'
  64. Dim Const $ini_value_ie10             = 'instie10'
  65. Dim Const $ini_value_ie11             = 'instie11'
  66. Dim Const $ini_value_cpp              = 'updatecpp'
  67. Dim Const $ini_value_mssl             = 'instmssl'
  68. Dim Const $ini_value_dotnet35         = 'instdotnet35'
  69. Dim Const $ini_value_dotnet4          = 'instdotnet4'
  70. Dim Const $ini_value_psh              = 'instpsh'
  71. Dim Const $ini_value_wmf              = 'instwmf'
  72. Dim Const $ini_value_msse             = 'instmsse'
  73. Dim Const $ini_value_tsc              = 'updatetsc'
  74. Dim Const $ini_value_ofv              = 'instofv'
  75. Dim Const $ini_value_all              = 'all'
  76. Dim Const $ini_value_excludestatics   = 'excludestatics'
  77. Dim Const $ini_value_skipdynamic      = 'skipdynamic'
  78.  
  79. Dim Const $ini_section_control        = 'Control'
  80. Dim Const $ini_value_verify           = 'verify'
  81. Dim Const $ini_value_autoreboot       = 'autoreboot'
  82. Dim Const $ini_value_shutdown         = 'shutdown'
  83.  
  84. Dim Const $ini_section_messaging      = 'Messaging'
  85. Dim Const $ini_value_showlog          = 'showlog'
  86.  
  87. Dim Const $ini_section_wle            = 'Essentials'
  88. Dim Const $ini_section_msi            = 'MSI'
  89.  
  90. Dim Const $ini_section_misc           = 'Miscellaneous'
  91. Dim Const $ini_value_showdonate       = 'showdonate'
  92. Dim Const $ini_value_wustatusserver   = 'WUStatusServer'
  93.  
  94. Dim Const $enabled                    = 'Enabled'
  95. Dim Const $disabled                   = 'Disabled'
  96.  
  97. ; Paths
  98. Dim Const $path_max_length            = 192
  99. Dim Const $path_invalid_chars         = '!%&()^+,;='
  100. Dim Const $path_rel_builddate         = '\builddate.txt'
  101. Dim Const $path_rel_hashes            = '\md\'
  102. Dim Const $path_rel_autologon         = '\bin\Autologon.exe'
  103. Dim Const $path_rel_win_glb           = '\win\glb\'
  104. Dim Const $path_rel_cpp               = '\cpp\vcredist*.exe'
  105. Dim Const $path_rel_instdotnet40      = '\dotnet\dotNetFx40*.exe'
  106. Dim Const $path_rel_instdotnet45      = '\dotnet\NDP452-KB2901907-x86-x64-AllOS*.exe'
  107. Dim Const $path_rel_ofc_glb           = '\ofc\glb\'
  108. Dim Const $path_rel_msse_x86          = '\msse\x86-glb\MSEInstall-x86-*.exe'
  109. Dim Const $path_rel_msse_x64          = '\msse\x64-glb\MSEInstall-x64-*.exe'
  110. Dim Const $path_rel_wle               = '\wle\wlsetup-all-*.exe'
  111. Dim Const $path_rel_wle_cmd           = '\Temp\wouinstwle.cmd'
  112. Dim Const $path_rel_msi_all           = '\wouallmsi.txt'
  113. Dim Const $path_rel_msi_selected      = '\Temp\wouselmsi.txt'
  114.  
  115. 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
  116. Dim $dlgheight , $groupwidth , $txtwidth , $txtheight , $btnwidth , $btnheight , $txtxoffset , $txtyoffset , $txtxpos , $txtypos , $wleall , $wlepacks[$wlemax] , $wlecount , $wlecmdfile , $msiall , $msipacks[$msimax] , $msicount , $msilistfile , $line , $i
  117.  
  118. Func ShowGUIInGerman()
  119.     If $CmdLine[0] > 0 Then
  120.         If StringLower( $CmdLine[1] ) = 'deu' Then
  121.             Return True
  122.         Else
  123.             Return False
  124.         EndIf
  125.     EndIf
  126.  
  127.     Return StringInStr( '0007|0407|0807|0C07|1007|1407' , @OSLang ) > 0
  128. EndFunc
  129.  
  130. ; Returns script directory, also sets global variable $mapped
  131. Func AssignScriptDirectory()
  132.     Local $mapped , $result , $netdrives , $i
  133.  
  134.     ; Check if script directory is a network share, map if unmapped
  135.     $mapped = False
  136.     If DriveGetType(   @ScriptDir ) = 'Network' Then
  137.         If StringInStr( @ScriptDir , '\\' ) = 0  Then
  138.             $result =    @ScriptDir
  139.         Else
  140.             $netdrives = DriveGetDrive( 'NETWORK' )
  141.             If NOT @error Then
  142.                 For $i = 1 to $netdrives[0]
  143.                     If StringInStr( @ScriptDir , DriveMapGet( $netdrives[$i] )) > 0 Then
  144.                         $result = $netdrives[$i] & StringRight( @ScriptDir , StringLen( @ScriptDir ) - StringLen( DriveMapGet( $netdrives[$i] )))
  145.                         ExitLoop
  146.                     EndIf
  147.                 Next
  148.             EndIf
  149.             If $result = '' Then
  150.                 $result = DriveMapAdd( '*' , @ScriptDir )
  151.                 If @error Then
  152.                     $result = ''
  153.                 Else
  154.                     $mapped = True
  155.                 EndIf
  156.             EndIf
  157.         EndIf
  158.     Else
  159.         $result = @ScriptDir
  160.     EndIf
  161.  
  162.     Return $result
  163. EndFunc
  164.  
  165. Func IsCheckBoxChecked( $chkbox )
  166.     Return BitAND( GUICtrlRead( $chkbox ) , $GUI_CHECKED ) = $GUI_CHECKED
  167. EndFunc
  168.  
  169. Func CheckBoxStateToString( $chkbox )
  170.     If IsCheckBoxChecked( $chkbox ) Then
  171.         Return $enabled
  172.     Else
  173.         Return $disabled
  174.     EndIf
  175. EndFunc
  176.  
  177. Func MyIniRead( $section , $key , $default )
  178.     Local $inifilepath
  179.  
  180.     $inifilepath = @TempDir & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
  181.     If NOT FileExists( $inifilepath ) Then
  182.         $inifilepath = $scriptdir & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
  183.     EndIf
  184.     Return IniRead( $inifilepath , $section , $key , $default )
  185. EndFunc
  186.  
  187. Func IniCopy()
  188. Dim $ini_src , $ini_dest , $i
  189.  
  190.     $ini_src = $scriptdir & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
  191.     $ini_dest = @TempDir  & '\' & StringLeft( @ScriptName , StringInStr( @ScriptName , '.' , 0 , -1 )) & 'ini'
  192.     FileCopy( $ini_src       , $ini_dest , 1 )
  193.     FileSetAttrib( $ini_dest , '-R' )
  194.  
  195.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_backup   , CheckBoxStateToString( $backup ))
  196.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_rcerts   , CheckBoxStateToString( $rcerts ))
  197.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie7      , CheckBoxStateToString( $ie7  ))
  198.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie8      , CheckBoxStateToString( $ie8  ))
  199.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie9      , CheckBoxStateToString( $ie9  ))
  200.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie10     , CheckBoxStateToString( $ie10 ))
  201.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_ie11     , CheckBoxStateToString( $ie11 ))
  202.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_cpp      , CheckBoxStateToString( $cpp  ))
  203.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_mssl     , CheckBoxStateToString( $mssl ))
  204.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_dotnet35 , CheckBoxStateToString( $dotnet35 ))
  205.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_psh      , CheckBoxStateToString( $psh  ))
  206.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_dotnet4  , CheckBoxStateToString( $dotnet4 ))
  207.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_wmf      , CheckBoxStateToString( $wmf  ))
  208.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_msse     , CheckBoxStateToString( $msse ))
  209.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_tsc      , CheckBoxStateToString( $tsc  ))
  210.     IniWrite( $ini_dest , $ini_section_installation , $ini_value_ofv      , CheckBoxStateToString( $ofv  ))
  211.  
  212.     IniWrite( $ini_dest , $ini_section_control      , $ini_value_verify   , CheckBoxStateToString( $verify   ))
  213.     IniWrite( $ini_dest , $ini_section_control    , $ini_value_autoreboot , CheckBoxStateToString( $autoreboot ))
  214.     IniWrite( $ini_dest , $ini_section_control      , $ini_value_shutdown , CheckBoxStateToString( $shutdown ))
  215.     IniWrite( $ini_dest , $ini_section_messaging    , $ini_value_showlog  , CheckBoxStateToString( $showlog  ))
  216.  
  217.     For $i = 0 To $wlecount - 1
  218.         IniWrite( $ini_dest , $ini_section_wle , GUICtrlRead( $wlepacks[$i] , 1 ) , CheckBoxStateToString( $wlepacks[$i] ))
  219.     Next
  220.  
  221.     For $i = 0 To $msicount - 1
  222.         IniWrite( $ini_dest , $ini_section_msi , GUICtrlRead( $msipacks[$i] , 1 ) , CheckBoxStateToString( $msipacks[$i] ))
  223.     Next
  224.  
  225.     Return 0
  226. EndFunc
  227.  
  228. Func PathValid( $path )
  229.     Local $result , $arr_invalid , $i
  230.  
  231.     If StringLen( $path ) > $path_max_length Then
  232.         $result = False
  233.     Else
  234.         $result = True
  235.         $arr_invalid = StringSplit( $path_invalid_chars , '' )
  236.         For $i = 1 to $arr_invalid[0]
  237.             If StringInStr( $path , $arr_invalid[$i] ) > 0 Then
  238.                 $result = False
  239.                 ExitLoop
  240.             EndIf
  241.         Next
  242.     EndIf
  243.  
  244.     Return $result
  245. EndFunc
  246.  
  247. Func MediumBuildDate( $basepath )
  248.     Local $result = FileReadLine( $basepath & $path_rel_builddate )
  249.     If @error Then $result = ''
  250.  
  251.     Return $result
  252. EndFunc
  253.  
  254. Func WSHAvailable()
  255.     Local $reg_val
  256.  
  257.     $reg_val = RegRead( $reg_key_wsh_hklm , $reg_val_enabled )
  258.     If ( $reg_val = '0' ) Then Return 0
  259.  
  260.     $reg_val = RegRead( $reg_key_wsh_hkcu , $reg_val_enabled )
  261.     If ( $reg_val = '0' ) Then Return 0
  262.  
  263.     Return 1
  264. EndFunc
  265.  
  266. Func IEVersion()
  267.     Local $reg_val
  268.  
  269.     $reg_val = RegRead( $reg_key_ie , $reg_val_version )
  270.     If StringInStr( $reg_val , '9.10.' ) > 0 Then Return '10'
  271.  
  272.     If StringInStr( $reg_val , '9.11.' ) > 0 Then Return '11'
  273.  
  274.     Return StringLeft( $reg_val , StringInStr( $reg_val , '.' ) - 1 )
  275. EndFunc
  276.  
  277. Func DotNet35Version()
  278.     Local  $reg_val = RegRead( $reg_key_dotnet35 , $reg_val_version )
  279.     Return StringLeft( $reg_val , StringInStr( $reg_val , '.' , 0 , -1 ) - 1 )
  280. EndFunc
  281.  
  282. Func DotNet4Version()
  283.     Return RegRead( $reg_key_dotnet4 , $reg_val_version )
  284. EndFunc
  285.  
  286. Func DotNet4MainVersion()
  287.     Return StringLeft( DotNet4Version() , 3 )
  288. EndFunc
  289.  
  290. Func DotNet4TargetVersion()
  291.     If StringInStr( 'WIN_XP|WIN_2003' , @OSVersion ) > 0 Then
  292.         Return $target_version_dotnet40
  293.     Else
  294.         If StringInStr( 'WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
  295.             Return $target_version_dotnet45w63
  296.         Else
  297.             Return $target_version_dotnet45
  298.         EndIf
  299.     EndIf
  300. EndFunc
  301.  
  302. Func PowerShellVersion()
  303.     Return RegRead( $reg_key_psh , $reg_val_pshversion )
  304. EndFunc
  305.  
  306. Func ManagementFrameworkVersion()
  307.     Return RegRead( $reg_key_wmf , $reg_val_pshversion )
  308. EndFunc
  309.  
  310. Func WMFTargetVersion()
  311.     If StringInStr( 'WIN_7|WIN_2008R2|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
  312.         Return '4.0'
  313.     Else
  314.         Return '3.0'
  315.     EndIf
  316. EndFunc
  317.  
  318. Func MSSLInstalled()
  319.     Local $dummy = RegRead( $reg_key_mssl , $reg_val_default )
  320.     Return ( @error <= 0 )
  321. EndFunc
  322.  
  323. Func MSSEInstalled()
  324.     Local $dummy = RegRead( $reg_key_msse , $reg_val_default )
  325.     Return ( @error <= 0 )
  326. EndFunc
  327.  
  328. Func HashFilesPresent( $basepath )
  329.     Return FileExists(  $basepath & $path_rel_hashes )
  330. EndFunc
  331.  
  332. Func AutologonPresent( $basepath )
  333.     Return FileExists(  $basepath & $path_rel_autologon )
  334. EndFunc
  335.  
  336. Func WinGlbPresent( $basepath )
  337.     Return FileExists( $basepath & $path_rel_win_glb )
  338. EndFunc
  339.  
  340. Func CPPPresent( $basepath )
  341.     Return FileExists( $basepath & $path_rel_cpp )
  342. EndFunc
  343.  
  344. Func DotNet4InstPresent( $basepath )
  345.     Return FileExists( $basepath & $path_rel_instdotnet40 ) OR FileExists( $basepath & $path_rel_instdotnet45 )
  346. EndFunc
  347.  
  348. Func OfcGlbPresent( $basepath )
  349.     Return FileExists( $basepath & $path_rel_ofc_glb )
  350. EndFunc
  351.  
  352. Func MSSEPresent( $basepath )
  353.     Return FileExists( $basepath & $path_rel_msse_x86 ) OR FileExists( $basepath & $path_rel_msse_x64 )
  354. EndFunc
  355.  
  356. Func WLEPresent( $basepath )
  357.     Return FileExists( $basepath & $path_rel_wle )
  358. EndFunc
  359.  
  360. Func ListMSIPackages()
  361.     Local $result = RunWait( @ComSpec & ' /D /C TouchMSITree.cmd /listall' , $scriptdir & '\cmd' , @SW_HIDE )
  362.     If $result = 0 Then $result = @error
  363.  
  364.     Return $result
  365. EndFunc
  366.  
  367. Func CalcGUISize()
  368.     Local $reg_val
  369.  
  370.     If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) Then
  371.         DllCall( 'user32.dll' , 'int' , 'SetProcessDPIAware' )
  372.     EndIf
  373.     $reg_val = RegRead( $reg_key_hkcu_winmetrics , $reg_val_applieddpi )
  374.     If $reg_val  = '' Then $reg_val = RegRead( $reg_key_hkcu_desktop , $reg_val_logpixels )
  375.     If $reg_val  = '' Then $reg_val = $default_logpixels
  376.     $dlgheight   = 380 * $reg_val / $default_logpixels
  377.     If ShowGUIInGerman() Then
  378.         $txtwidth = 240 * $reg_val / $default_logpixels
  379.     Else
  380.         $txtwidth = 220 * $reg_val / $default_logpixels
  381.     EndIf
  382.     $txtheight   =  20 * $reg_val / $default_logpixels
  383.     $btnwidth    =  80 * $reg_val / $default_logpixels
  384.     $btnheight   =  25 * $reg_val / $default_logpixels
  385.     $txtxoffset  =  10 * $reg_val / $default_logpixels
  386.     $txtyoffset  =  10 * $reg_val / $default_logpixels
  387.  
  388.     Return 0
  389. EndFunc
  390.  
  391. ; Main Dialog
  392. CalcGUISize()
  393. $groupwidth = 2 * $txtwidth + 2 * $txtxoffset
  394. $maindlg = GUICreate( $caption , $groupwidth + 4 * $txtxoffset , $dlgheight )
  395. GUISetFont( 8.5 , 400 , 0 , 'Sans Serif' )
  396.  
  397. $scriptdir = AssignScriptDirectory()
  398.  
  399. ;  Label
  400. $txtxpos = $txtxoffset
  401. $txtypos = $txtyoffset
  402. If ShowGUIInGerman() Then
  403.     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 )
  404. Else
  405.     GUICtrlCreateLabel( 'Select desired options and click "Start"' & @LF & 'to install missing Microsoft updates on your computer.' , $txtxpos , $txtypos , 3 * $groupwidth / 4 , 1.5 * $txtheight )
  406. EndIf
  407.  
  408. ;  Medium info group
  409. $builddate = MediumBuildDate( $scriptdir )
  410. If $builddate <> '' Then
  411.     $txtxpos = 3 * $txtxoffset + 3 * $groupwidth / 4
  412.     $txtypos = 0
  413.     GUICtrlCreateGroup( ShowGUIInGerman() ? 'Medium-Info' : 'Medium info' , $txtxpos , $txtypos , $groupwidth / 4 , 2 * $txtheight )
  414.     $txtxpos = $txtxpos + $txtxoffset
  415.     $txtypos = $txtypos + 1.5 * $txtyoffset + 2
  416.     GUICtrlCreateLabel( 'Build: ' & $builddate , $txtxpos , $txtypos , $groupwidth / 4 - 2 * $txtxoffset , $txtheight )
  417. EndIf
  418.  
  419. ;  Tab control
  420. $txtxpos = $txtxoffset
  421. $txtypos = $txtyoffset + 1.5 * $txtheight
  422. GuiCtrlCreateTab( $txtxpos , $txtypos , $groupwidth + 2 * $txtxoffset , $dlgheight - $btnheight - 1.5 * $txtheight - 3 * $txtyoffset )
  423.  
  424. ;  Updating Tab
  425. $tabitemfocused = GuiCtrlCreateTabItem( ShowGUIInGerman() ? 'Aktualisierung' : 'Updating' )
  426.  
  427. ;  Installation group
  428. $txtxpos = 2 * $txtxoffset
  429. $txtypos = 3.5 * $txtyoffset + 1.5 * $txtheight
  430. GUICtrlCreateGroup( 'Installation' , $txtxpos , $txtypos , $groupwidth , 10 * $txtheight )
  431.  
  432. ; Backup
  433. $txtxpos = 3 * $txtxoffset
  434. $txtypos = $txtypos + 1.5 * $txtyoffset
  435. $backup = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Existierende Systemdateien sichern' : 'Back up existing system files' , _
  436.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  437. If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
  438.     GUICtrlSetState( -1 , $GUI_CHECKED + $GUI_DISABLE )
  439. Else
  440.     If MyIniRead( $ini_section_installation , $ini_value_backup , $disabled ) = $enabled Then
  441.         GUICtrlSetState( -1 , $GUI_CHECKED )
  442.     Else
  443.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  444.     EndIf
  445. EndIf
  446.  
  447. ; Update Root Certificates
  448. $txtxpos = $txtxpos + $txtwidth
  449. $rcerts = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Stammzertifikate aktualisieren' : 'Update Root Certificates' , _
  450.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  451. If WinGlbPresent( $scriptdir ) Then
  452.     If MyIniRead( $ini_section_installation , $ini_value_rcerts , $enabled ) = $enabled Then
  453.         GUICtrlSetState( -1 , $GUI_CHECKED )
  454.     Else
  455.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  456.     EndIf
  457. Else
  458.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  459. EndIf
  460.  
  461. ; Install IE7
  462. $txtxpos = 3 * $txtxoffset
  463. $txtypos = $txtypos + $txtheight
  464. $ie7 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 7 installieren' : 'Install Internet Explorer 7' , _
  465.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  466. If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  467.     StringInStr( '7|8|9|10|11' , IEVersion()) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
  468.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  469. Else
  470.     If MyIniRead( $ini_section_installation , $ini_value_ie7 , $disabled ) = $enabled Then
  471.         GUICtrlSetState( -1 , $GUI_CHECKED )
  472.     Else
  473.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  474.     EndIf
  475. EndIf
  476.  
  477. ; Install IE8
  478. $txtxpos = $txtxpos + $txtwidth
  479. $ie8 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 8 installieren' : 'Install Internet Explorer 8' , _
  480.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  481. If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  482.     StringInStr( '8|9|10|11' , IEVersion() ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
  483.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  484. Else
  485.     If MyIniRead( $ini_section_installation , $ini_value_ie8 , $enabled ) = $enabled Then
  486.         GUICtrlSetState( -1   , $GUI_CHECKED )
  487.         GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
  488.     Else
  489.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  490.         If IsCheckBoxChecked( $ie7 ) Then
  491.             GUICtrlSetState( -1 , $GUI_DISABLE )
  492.         EndIf
  493.     EndIf
  494. EndIf
  495.  
  496. ; Install IE9
  497. $txtxpos = 3 * $txtxoffset
  498. $txtypos = $txtypos + $txtheight
  499. $ie9 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 9 installieren' : 'Install Internet Explorer 9' , _
  500.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  501. If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  502.     StringInStr( '9|10|11' , IEVersion() ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
  503.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  504. Else
  505.     If MyIniRead( $ini_section_installation , $ini_value_ie9 , $disabled ) = $enabled Then
  506.         GUICtrlSetState( -1 , $GUI_CHECKED )
  507.         GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
  508.         GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
  509.     Else
  510.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  511.         If ( IsCheckBoxChecked( $ie7 ) OR IsCheckBoxChecked( $ie8 )) Then
  512.             GUICtrlSetState( -1 , $GUI_DISABLE )
  513.         EndIf
  514.     EndIf
  515. EndIf
  516.  
  517. ; Install IE10
  518. $txtxpos = $txtxpos + $txtwidth
  519. $ie10 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 10 installieren' : 'Install Internet Explorer 10' , _
  520.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  521. If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  522.     StringInStr( '10|11' , IEVersion() ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
  523.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  524. Else
  525.     If MyIniRead( $ini_section_installation , $ini_value_ie10 , $disabled ) = $enabled Then
  526.         GUICtrlSetState( -1 , $GUI_CHECKED )
  527.         GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
  528.         GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
  529.         GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
  530.     Else
  531.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  532.         If ( IsCheckBoxChecked( $ie7 ) OR IsCheckBoxChecked( $ie8 ) OR IsCheckBoxChecked( $ie9 )) Then
  533.             GUICtrlSetState( -1 , $GUI_DISABLE )
  534.         EndIf
  535.     EndIf
  536. EndIf
  537.  
  538. ; Install IE11
  539. $txtxpos = 3 * $txtxoffset
  540. $txtypos = $txtypos + $txtheight
  541. $ie11 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Internet Explorer 11 installieren' : 'Install Internet Explorer 11' , _
  542.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  543. If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  544.     IEVersion() = '11' OR NOT WinGlbPresent( $scriptdir ) Then
  545.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  546. Else
  547.     If MyIniRead( $ini_section_installation , $ini_value_ie11 , $disabled ) = $enabled Then
  548.         GUICtrlSetState(   -1  , $GUI_CHECKED )
  549.         GUICtrlSetState( $ie7  , $GUI_UNCHECKED + $GUI_DISABLE )
  550.         GUICtrlSetState( $ie8  , $GUI_UNCHECKED + $GUI_DISABLE )
  551.         GUICtrlSetState( $ie9  , $GUI_UNCHECKED + $GUI_DISABLE )
  552.         GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  553.     Else
  554.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  555.         If ( IsCheckBoxChecked( $ie7 ) OR IsCheckBoxChecked( $ie8 ) OR IsCheckBoxChecked( $ie9 ) OR IsCheckBoxChecked( $ie10 )) Then
  556.             GUICtrlSetState( -1 , $GUI_DISABLE )
  557.         EndIf
  558.     EndIf
  559. EndIf
  560.  
  561. ; Update C++ Runtime Libraries
  562. $txtxpos = 3 * $txtxoffset
  563. $txtypos = $txtypos + $txtheight
  564. $cpp = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'C++-Laufzeitbibliotheken aktualisieren' : 'Update C++ Runtime Libraries' , _
  565.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  566. If CPPPresent( $scriptdir ) Then
  567.     If MyIniRead( $ini_section_installation , $ini_value_cpp , $enabled ) = $enabled Then
  568.         GUICtrlSetState( -1 , $GUI_CHECKED )
  569.     Else
  570.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  571.     EndIf
  572. Else
  573.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  574. EndIf
  575.  
  576. ; Install Microsoft Silverlight
  577. $txtxpos = $txtxpos + $txtwidth
  578. If ShowGUIInGerman() Then
  579.     If MSSLInstalled() Then
  580.         $mssl = GUICtrlCreateCheckbox( 'Microsoft Silverlight aktualisieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  581.     Else
  582.         $mssl = GUICtrlCreateCheckbox( 'Microsoft Silverlight installieren'  , $txtxpos , $txtypos , $txtwidth , $txtheight )
  583.     EndIf
  584. Else
  585.     If MSSLInstalled() Then
  586.         $mssl = GUICtrlCreateCheckbox( 'Update Microsoft Silverlight'  , $txtxpos , $txtypos , $txtwidth , $txtheight )
  587.     Else
  588.         $mssl = GUICtrlCreateCheckbox( 'Install Microsoft Silverlight' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  589.     EndIf
  590. EndIf
  591. If (( NOT WinGlbPresent( $scriptdir ))) Then
  592.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  593. Else
  594.     If MyIniRead( $ini_section_installation , $ini_value_mssl , $disabled ) = $enabled Then
  595.         GUICtrlSetState( -1 , $GUI_CHECKED )
  596.     Else
  597.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  598.     EndIf
  599. EndIf
  600.  
  601. ; Install .NET Framework 3.5
  602. $txtxpos = 3 * $txtxoffset
  603. $txtypos = $txtypos + $txtheight
  604. $dotnet35 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? '.NET Framework 3.5 installieren' : 'Install .NET Framework 3.5' , _
  605.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  606. If StringInStr( 'WIN_7|WIN_2008R2' , @OSVersion ) > 0 OR DotNet35Version() = $target_version_dotnet35 Then
  607.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  608. Else
  609.     If MyIniRead( $ini_section_installation , $ini_value_dotnet35 , $disabled ) = $enabled Then
  610.         GUICtrlSetState( -1 , $GUI_CHECKED )
  611.     Else
  612.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  613.     EndIf
  614. EndIf
  615.  
  616. ; Install Windows PowerShell 2.0
  617. $txtxpos = $txtxpos + $txtwidth
  618. $psh = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'PowerShell 2.0 installieren' : 'Install PowerShell 2.0' , _
  619.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  620. If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0     OR _
  621.     ( DotNet35Version() <> $target_version_dotnet35 AND NOT IsCheckBoxChecked( $dotnet35 )) OR _
  622.     PowerShellVersion() = $target_version_psh Then
  623.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  624. Else
  625.     If MyIniRead( $ini_section_installation , $ini_value_psh , $disabled ) = $enabled Then
  626.         GUICtrlSetState( -1 , $GUI_CHECKED )
  627.     Else
  628.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  629.     EndIf
  630. EndIf
  631.  
  632. ; Install .NET Framework 4
  633. $txtxpos = 3 * $txtxoffset
  634. $txtypos = $txtypos + $txtheight
  635. $dotnet4 = GUICtrlCreateCheckbox( ShowGUIInGerman() ? '.NET Framework 4.x installieren' : 'Install .NET Framework 4.x' , _
  636.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  637. If DotNet4Version() = DotNet4TargetVersion() OR NOT DotNet4InstPresent( $scriptdir ) Then
  638.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  639. Else
  640.     If MyIniRead( $ini_section_installation , $ini_value_dotnet4 , $disabled ) = $enabled Then
  641.         GUICtrlSetState( -1 , $GUI_CHECKED )
  642.     Else
  643.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  644.     EndIf
  645. EndIf
  646.  
  647. ; Install Windows Management Framework
  648. $txtxpos = $txtxpos + $txtwidth
  649. If ShowGUIInGerman() Then
  650.     $wmf = GUICtrlCreateCheckbox( 'Management Framework ' & WMFTargetVersion() & ' installieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  651. Else
  652.     $wmf = GUICtrlCreateCheckbox( 'Install Management Framework ' & WMFTargetVersion() , $txtxpos , $txtypos , $txtwidth , $txtheight )
  653. EndIf
  654. If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_8|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  655.     ( DotNet4MainVersion() <> '4.5' AND NOT IsCheckBoxChecked( $dotnet4 )) OR ManagementFrameworkVersion() = WMFTargetVersion() Then
  656.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  657. Else
  658.     If MyIniRead( $ini_section_installation , $ini_value_wmf , $disabled ) = $enabled Then
  659.         GUICtrlSetState( -1 , $GUI_CHECKED )
  660.     Else
  661.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  662.     EndIf
  663. EndIf
  664.  
  665. ; Install Microsoft Security Essentials
  666. $txtxpos = 3 * $txtxoffset
  667. $txtypos = $txtypos + $txtheight
  668. If ShowGUIInGerman() Then
  669.     If MSSEInstalled() Then
  670.         $msse = GUICtrlCreateCheckbox( 'Microsoft Security Essentials aktualisieren' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  671.     Else
  672.         $msse = GUICtrlCreateCheckbox( 'Microsoft Security Essentials installieren'  , $txtxpos , $txtypos , $txtwidth , $txtheight )
  673.     EndIf
  674. Else
  675.     If MSSEInstalled() Then
  676.         $msse = GUICtrlCreateCheckbox( 'Update Microsoft Security Essentials'  , $txtxpos , $txtypos , $txtwidth , $txtheight )
  677.     Else
  678.         $msse = GUICtrlCreateCheckbox( 'Install Microsoft Security Essentials' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  679.     EndIf
  680. EndIf
  681. If StringInStr( 'WIN_2003|WIN_2008|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR NOT MSSEPresent( $scriptdir ) Then
  682.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  683. Else
  684.     If MyIniRead( $ini_section_installation , $ini_value_msse , $disabled ) = $enabled Then
  685.         GUICtrlSetState( -1 , $GUI_CHECKED )
  686.     Else
  687.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  688.     EndIf
  689. EndIf
  690.  
  691. ; Update Windows Remote Desktop Client
  692. $txtxpos = $txtxpos + $txtwidth
  693. $tsc = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Remote Desktop Client aktualisieren' : 'Update Remote Desktop Client' , _
  694.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  695. If StringInStr( 'WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR NOT WinGlbPresent( $scriptdir ) Then
  696.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  697. Else
  698.     If MyIniRead( $ini_section_installation , $ini_value_tsc , $enabled ) = $enabled Then
  699.         GUICtrlSetState( -1 , $GUI_CHECKED )
  700.     Else
  701.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  702.     EndIf
  703. EndIf
  704.  
  705. ; Install Office File Validation
  706. $txtxpos = 3 * $txtxoffset
  707. $txtypos = $txtypos + $txtheight
  708. $ofv = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Office-Dateiüberprüfung installieren' : 'Install Office File Validation' , _
  709.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  710. If OfcGlbPresent( $scriptdir ) Then
  711.     If MyIniRead( $ini_section_installation , $ini_value_ofv , $disabled ) = $enabled Then
  712.         GUICtrlSetState( -1 , $GUI_CHECKED )
  713.     Else
  714.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  715.     EndIf
  716. Else
  717.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  718. EndIf
  719.  
  720. ;  Control group
  721. $txtxpos = 2 * $txtxoffset
  722. $txtypos = $txtypos + 2.5 * $txtyoffset
  723. GUICtrlCreateGroup( ShowGUIInGerman() ? 'Steuerung' : 'Control' , $txtxpos , $txtypos , $groupwidth , 3 * $txtheight )
  724.  
  725. ; Verify
  726. $txtxpos = 3 * $txtxoffset
  727. $txtypos = $txtypos + 1.5 * $txtyoffset
  728. $verify = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Installationspakete verifizieren' : 'Verify installation packages' , _
  729.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  730. If HashFilesPresent( $scriptdir ) Then
  731.     If MyIniRead( $ini_section_control , $ini_value_verify , $enabled ) = $enabled Then
  732.         GUICtrlSetState( -1 , $GUI_CHECKED )
  733.     Else
  734.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  735.     EndIf
  736. Else
  737.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  738. EndIf
  739.  
  740. ;  Automatic reboot and recall
  741. $txtxpos = $txtxpos + $txtwidth
  742. $autoreboot = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Automatisch neu starten und fortsetzen' : 'Automatic reboot and recall' , _
  743.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  744. If AutologonPresent( $scriptdir ) Then
  745.     If MyIniRead( $ini_section_control , $ini_value_autoreboot , $disabled ) = $enabled Then
  746.         GUICtrlSetState( -1 , $GUI_CHECKED )
  747.     Else
  748.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  749.     EndIf
  750. Else
  751.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  752. EndIf
  753.  
  754. ;  Automatic shutdown
  755. $txtxpos = 3 * $txtxoffset
  756. $txtypos = $txtypos + $txtheight
  757. $shutdown = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Herunterfahren nach Abschluss' : 'Shut down on completion' , _
  758.                 $txtxpos , $txtypos , $txtwidth , $txtheight )
  759. If MyIniRead( $ini_section_control , $ini_value_shutdown , $disabled ) = $enabled Then
  760.     GUICtrlSetState( -1 , $GUI_CHECKED )
  761. Else
  762.     GUICtrlSetState( -1 , $GUI_UNCHECKED )
  763. EndIf
  764.  
  765. ; Show log file
  766. $txtxpos = $txtxpos + $txtwidth
  767. $showlog = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Protokolldatei anzeigen' : 'Show log file' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  768. If (( MyIniRead( $ini_section_messaging , $ini_value_showlog , $disabled ) = $enabled ) _
  769.     AND ( NOT IsCheckBoxChecked( $shutdown ))) Then
  770.     GUICtrlSetState( -1 , $GUI_CHECKED )
  771. Else
  772.     GUICtrlSetState( -1 , $GUI_UNCHECKED )
  773.     If IsCheckBoxChecked( $shutdown ) Then
  774.         GUICtrlSetState( -1 , $GUI_DISABLE )
  775.     EndIf
  776. EndIf
  777.  
  778. ;  Essentials Tab
  779. $wlecount = 1
  780. If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 AND WLEPresent( $scriptdir ) Then
  781.     GuiCtrlCreateTabItem( 'Essentials' )
  782.  
  783.     ; Select all
  784.     $txtxpos = 2 * $txtxoffset
  785.     $txtypos = 3.5 * $txtyoffset + 1.5 * $txtheight
  786.     If ShowGUIInGerman() Then
  787.         $wleall = GUICtrlCreateCheckbox( 'Alle auswählen' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  788.     Else
  789.         $wleall = GUICtrlCreateCheckbox( 'Select all' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  790.     EndIf
  791.     If ( DotNet35Version() <> $target_version_dotnet35 AND NOT IsCheckBoxChecked( $dotnet35 )) OR _
  792.         ( DotNet4MainVersion() <> '4.5' AND NOT IsCheckBoxChecked( $dotnet4 )) Then
  793.         GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  794.     EndIf
  795.     ;  WLE packages' group
  796.     $txtypos = $txtypos + $txtheight
  797.     If StringInStr( 'WIN_7|WIN_2008R2' , @OSVersion ) > 0 Then
  798.         $wlecount = $wlemax
  799.     Else
  800.         $wlecount = $wlemax - 1
  801.     EndIf
  802.     GUICtrlCreateGroup( 'Windows Essentials 2012' , $txtxpos , $txtypos , $groupwidth , ( BitShift( $wlecount + 1 , 1 ) + 1 ) * $txtheight )
  803.     $txtxpos = 3 * $txtxoffset
  804.     $txtypos = $txtypos + 1.5 * $txtyoffset
  805.     For $i = 0 To $wlecount - 1
  806.         Switch $i
  807.             Case 0
  808.                 $wlepacks[$i] = GUICtrlCreateCheckbox( 'OneDrive' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
  809.             Case 1
  810.                 $wlepacks[$i] = GUICtrlCreateCheckbox( 'Messenger' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
  811.             Case 2
  812.                 $wlepacks[$i] = GUICtrlCreateCheckbox( 'Mail' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
  813.             Case 3
  814.                 $wlepacks[$i] = GUICtrlCreateCheckbox( 'Outlook Connector Pack' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
  815.             Case 4
  816.                 $wlepacks[$i] = GUICtrlCreateCheckbox( 'Photo Gallery and Movie Maker' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
  817.             Case 5
  818.                 $wlepacks[$i] = GUICtrlCreateCheckbox( 'Writer' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
  819.             Case 6
  820.                 $wlepacks[$i] = GUICtrlCreateCheckbox( 'Family Safety' , $txtxpos + Mod( $i , 2 ) * $txtwidth , $txtypos + BitShift( $i , 1 ) * $txtheight , $txtwidth , $txtheight )
  821.         EndSwitch
  822.         If (( DotNet35Version() <> $target_version_dotnet35 ) AND ( NOT IsCheckBoxChecked( $dotnet35 ))) _
  823.         OR (( DotNet4MainVersion() <> '4.5' ) AND ( NOT IsCheckBoxChecked( $dotnet4 ))) Then
  824.             GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  825.         Else
  826.             If MyIniRead( $ini_section_wle , GUICtrlRead( -1 , 1 ) , $disabled ) = $enabled Then
  827.                 GUICtrlSetState( -1 , $GUI_CHECKED )
  828.             EndIf
  829.         EndIf
  830.     Next
  831.     $txtxpos = 2 * $txtxoffset
  832.     $txtypos = $txtypos + BitShift( $wlecount + 1 , 1 ) * $txtheight + 0.5 * $txtyoffset
  833.     If ShowGUIInGerman() Then
  834.         GUICtrlCreateGroup( 'Systemvoraussetzungen' , $txtxpos , $txtypos , $groupwidth , 4 * $txtheight )
  835.     Else
  836.         GUICtrlCreateGroup( 'Prerequisites' , $txtxpos , $txtypos , $groupwidth , 4 * $txtheight )
  837.     EndIf
  838.     $txtxpos = 3 * $txtxoffset
  839.     $txtypos = $txtypos + 1.5 * $txtyoffset
  840.     If ShowGUIInGerman() Then
  841.         GUICtrlCreateLabel( 'Windows Essentials 2012 erfordern sowohl .NET Framework 3.5 als auch 4.5.' _
  842.                             & @LF & 'Wenn die Optionen auf dieser Seite deaktiviert sind,' _
  843.                             & @LF & 'wählen Sie bitte die entsprechende(n) Installationsoption(en) unter "Aktualisierung".' _
  844.                             & @LF & 'Windows 8 / 8.1: Stellen Sie zusätzlich sicher, dass das Sxs-Verzeichnis integriert wurde.' , _
  845.                             $txtxpos , $txtypos , 3 * $groupwidth - 2 * $txtxoffset , 3 * $txtheight )
  846.     Else
  847.         GUICtrlCreateLabel( 'Windows Essentials 2012 require both .NET Frameworks 3.5 and 4.5.' _
  848.                             & @LF & 'If options are grayed out on this tab,' _
  849.                             & @LF & 'please select the corresponding installation option(s) on the "Updating" tab.' _
  850.                             & @LF & 'Windows 8 / 8.1: Additionally be sure to have the Sxs folder integrated.' , _
  851.                             $txtxpos , $txtypos , 3 * $groupwidth - 2 * $txtxoffset , 3 * $txtheight )
  852.     EndIf
  853. EndIf
  854.  
  855. ;  Software Tab
  856. $msicount = 1
  857. ListMSIPackages()
  858. If FileExists( @TempDir & $path_rel_msi_all ) Then
  859.     GuiCtrlCreateTabItem( 'Software' )
  860.  
  861.     ; Select all
  862.     $txtxpos = 2 * $txtxoffset
  863.     $txtypos = 3.5 * $txtyoffset + 1.5 * $txtheight
  864.     If ShowGUIInGerman() Then
  865.         $msiall = GUICtrlCreateCheckbox( 'Alle auswählen' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  866.     Else
  867.         $msiall = GUICtrlCreateCheckbox( 'Select all' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  868.     EndIf
  869.     ;  MSI packages' group
  870.     $txtypos = $txtypos + $txtheight
  871.     If ShowGUIInGerman() Then
  872.         GUICtrlCreateGroup( 'MSI-Pakete' , $txtxpos , $txtypos , $groupwidth , ( $msimax / 2 + 1 ) * $txtheight )
  873.     Else
  874.         GUICtrlCreateGroup( 'MSI packages' , $txtxpos , $txtypos , $groupwidth , ( $msimax / 2 + 1 ) * $txtheight )
  875.     EndIf
  876.     $txtxpos = 3 * $txtxoffset
  877.     $txtypos = $txtypos + 1.5 * $txtyoffset
  878.     For $msicount = 0 To $msimax - 1
  879.         $line = FileReadLine( @TempDir & $path_rel_msi_all , $msicount + 1 )
  880.         If @error <> 0 Then ExitLoop
  881.         $msipacks[$msicount] = GUICtrlCreateCheckbox( $line , $txtxpos + Mod( $msicount , 2 ) * $txtwidth , $txtypos + BitShift( $msicount , 1 ) * $txtheight , $txtwidth , $txtheight )
  882.         If MyIniRead( $ini_section_msi , GUICtrlRead( -1 , 1 ) , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_CHECKED )
  883.     Next
  884.     FileDelete( @TempDir & $path_rel_msi_all )
  885.     If $msicount = 0 Then $msicount = 1
  886. EndIf
  887.  
  888. ;  End Tab item definition
  889. GuiCtrlCreateTabItem( '' )
  890. GUICtrlSetState( $tabitemfocused , $GUI_SHOW )
  891.  
  892. ;  Start button
  893. $txtypos = $dlgheight - $btnheight - $txtyoffset
  894. $btn_start = GUICtrlCreateButton( 'Start' , $txtxoffset , $txtypos , $btnwidth , $btnheight )
  895. GUICtrlSetResizing ( -1 , $GUI_DOCKLEFT + $GUI_DOCKBOTTOM )
  896.  
  897. ;  Donate button
  898. If ShowGUIInGerman() Then
  899.     $btn_donate = GUICtrlCreateButton( 'Spenden...' , ( $groupwidth - $btnwidth ) / 2 + 2 * $txtxoffset , $txtypos , $btnwidth , $btnheight )
  900. Else
  901.     $btn_donate = GUICtrlCreateButton( 'Donate...' , ( $groupwidth - $btnwidth ) / 2 + 2 * $txtxoffset , $txtypos , $btnwidth , $btnheight )
  902. EndIf
  903. GUICtrlSetResizing( -1 , $GUI_DOCKBOTTOM )
  904. If ( MyIniRead( $ini_section_misc , $ini_value_showdonate , $enabled ) = $disabled ) OR ( Ping( $wou_hostname ) = 0 ) Then
  905.     GUICtrlSetState( -1 , $GUI_HIDE )
  906. EndIf
  907.  
  908. ;  Exit button
  909. $btn_exit = GUICtrlCreateButton( ShowGUIInGerman() ? 'Ende' : 'Exit' , $groupwidth - $btnwidth + 3 * $txtxoffset , $txtypos , $btnwidth , $btnheight )
  910. GUICtrlSetResizing ( -1 , $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM )
  911.  
  912. ; GUI message loop
  913. GUISetState()
  914. If NOT WSHAvailable() Then
  915.     If ShowGUIInGerman() Then
  916.         MsgBox( 0x2010 , 'Fehler' , 'Der Windows Script Host ist deaktiviert. Bitte prüfen Sie die Registrierungswerte' _
  917.                                         & @LF & 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings\Enabled und' _
  918.                                         & @LF & 'HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings\Enabled' )
  919.     Else
  920.         MsgBox( 0x2010 , 'Error' , 'Windows Script Host is disabled on this machine. Please check registry values' _
  921.                                         & @LF & 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings\Enabled and' _
  922.                                         & @LF & 'HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings\Enabled' )
  923.     EndIf
  924.     Exit(1)
  925. EndIf
  926. If $scriptdir = '' Then
  927.     If ShowGUIInGerman() Then
  928.         MsgBox( 0x2010 , 'Fehler' , 'Dem Skript-Pfad ' & @ScriptDir _
  929.                                         & @LF & 'konnte kein Laufwerksbuchstabe zugewiesen werden.' )
  930.     Else
  931.         MsgBox( 0x2010 , 'Error' , 'Unable to assign a drive letter' _
  932.                                         & @LF & 'to the script path ' & @ScriptDir )
  933.     EndIf
  934.     Exit(1)
  935. EndIf
  936. If NOT PathValid( $scriptdir ) Then
  937.     If ShowGUIInGerman() Then
  938.         MsgBox( 0x2010 , 'Fehler' , 'Der Skript-Pfad darf nicht mehr als ' & $path_max_length & ' Zeichen lang sein und' _
  939.                                         & @LF & 'darf keines der folgenden Zeichen enthalten: ' & $path_invalid_chars )
  940.     Else
  941.         MsgBox( 0x2010 , 'Error' , 'The script path must not be more than ' & $path_max_length & ' characters long and' _
  942.                                         & @LF & 'must not contain any of the following characters: ' & $path_invalid_chars )
  943.     EndIf
  944.     Exit(1)
  945. EndIf
  946. If NOT PathValid( @TempDir ) Then
  947.     If ShowGUIInGerman() Then
  948.         MsgBox( 0x2010 , 'Fehler' , 'Der %TEMP%-Pfad darf nicht mehr als ' & $path_max_length & ' Zeichen lang sein und' _
  949.                                         & @LF & 'darf keines der folgenden Zeichen enthalten: ' & $path_invalid_chars )
  950.     Else
  951.         MsgBox( 0x2010 , 'Error' , 'The %TEMP% path must not be more than ' & $path_max_length & ' characters long and' _
  952.                                         & @LF & 'must not contain any of the following characters: ' & $path_invalid_chars )
  953.     EndIf
  954.     Exit(1)
  955. EndIf
  956. If StringRight( EnvGet( 'TEMP' ) , 1 ) = '\' OR StringRight( EnvGet( 'TEMP' ) , 1 ) = ':' Then
  957.     If ShowGUIInGerman() Then
  958.         MsgBox( 0x2010 , 'Fehler' , 'Der %TEMP%-Pfad enthält einen abschließenden Backslash ("\")' _
  959.                                         & @LF & 'oder einen abschließenden Doppelpunkt (":").' )
  960.     Else
  961.         MsgBox( 0x2010 , 'Error' , 'The %TEMP% path contains a trailing backslash ("\")' _
  962.                                         & @LF & 'or a trailing colon (":").' )
  963.     EndIf
  964.     Exit(1)
  965. EndIf
  966. While 1
  967.     Switch GUIGetMsg()
  968.         ; Window closed
  969.         Case $GUI_EVENT_CLOSE
  970.             If $mapped Then DriveMapDel( $scriptdir )
  971.             ExitLoop
  972.  
  973.         ; Exit Button pressed
  974.         Case $btn_exit
  975.             If $mapped Then DriveMapDel( $scriptdir )
  976.             ExitLoop
  977.  
  978.         ; Donate button pressed
  979.         Case $btn_donate
  980.             ShellExecute( $donationURL )
  981.  
  982.         ; IE7 check box toggled
  983.         Case $ie7
  984.             If IsCheckBoxChecked( $ie7 ) Then
  985.                 GUICtrlSetState( $ie8  , $GUI_UNCHECKED + $GUI_DISABLE )
  986.                 GUICtrlSetState( $ie9  , $GUI_UNCHECKED + $GUI_DISABLE )
  987.                 GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  988.                 GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  989.             Else
  990.                 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
  991.                     GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
  992.                 Else
  993.                     GUICtrlSetState( $ie8 , $GUI_ENABLE )
  994.                 EndIf
  995.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '9|10|11' , IEVersion()) > 0 Then
  996.                     GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
  997.                 Else
  998.                     GUICtrlSetState( $ie9 , $GUI_ENABLE )
  999.                 EndIf
  1000.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR StringInStr( '10|11' , IEVersion()) > 0 Then
  1001.                     GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  1002.                 Else
  1003.                     GUICtrlSetState( $ie10 , $GUI_ENABLE )
  1004.                 EndIf
  1005.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
  1006.                     GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  1007.                 Else
  1008.                     GUICtrlSetState( $ie11 , $GUI_ENABLE )
  1009.                 EndIf
  1010.             EndIf
  1011.  
  1012.         ; IE8 check box toggled
  1013.         Case $ie8
  1014.             If IsCheckBoxChecked( $ie8 ) Then
  1015.                 GUICtrlSetState( $ie7  , $GUI_UNCHECKED + $GUI_DISABLE )
  1016.                 GUICtrlSetState( $ie9  , $GUI_UNCHECKED + $GUI_DISABLE )
  1017.                 GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  1018.                 GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  1019.             Else
  1020.                 If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  1021.                     StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
  1022.                     GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
  1023.                 Else
  1024.                     GUICtrlSetState( $ie7 , $GUI_ENABLE )
  1025.                 EndIf
  1026.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '9|10|11' , IEVersion()) > 0 Then
  1027.                     GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
  1028.                 Else
  1029.                     GUICtrlSetState( $ie9 , $GUI_ENABLE )
  1030.                 EndIf
  1031.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR StringInStr( '10|11' , IEVersion()) > 0 Then
  1032.                     GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  1033.                 Else
  1034.                     GUICtrlSetState( $ie10 , $GUI_ENABLE )
  1035.                 EndIf
  1036.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
  1037.                     GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  1038.                 Else
  1039.                     GUICtrlSetState( $ie11 , $GUI_ENABLE )
  1040.                 EndIf
  1041.             EndIf
  1042.  
  1043.         ; IE9 check box toggled
  1044.         Case $ie9
  1045.             If IsCheckBoxChecked( $ie9 ) Then
  1046.                 GUICtrlSetState( $ie7  , $GUI_UNCHECKED + $GUI_DISABLE )
  1047.                 GUICtrlSetState( $ie8  , $GUI_UNCHECKED + $GUI_DISABLE )
  1048.                 GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  1049.                 GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  1050.             Else
  1051.                 If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  1052.                     StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
  1053.                     GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
  1054.                 Else
  1055.                     GUICtrlSetState( $ie7 , $GUI_ENABLE )
  1056.                 EndIf
  1057.                 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
  1058.                     GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
  1059.                 Else
  1060.                     GUICtrlSetState( $ie8 , $GUI_ENABLE )
  1061.                 EndIf
  1062.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR StringInStr( '10|11' , IEVersion()) > 0 Then
  1063.                     GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  1064.                 Else
  1065.                     GUICtrlSetState( $ie10 , $GUI_ENABLE )
  1066.                 EndIf
  1067.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
  1068.                     GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  1069.                 Else
  1070.                     GUICtrlSetState( $ie11 , $GUI_ENABLE )
  1071.                 EndIf
  1072.             EndIf
  1073.  
  1074.         ; IE10 check box toggled
  1075.         Case $ie10
  1076.             If IsCheckBoxChecked( $ie10 ) Then
  1077.                 GUICtrlSetState( $ie7  , $GUI_UNCHECKED + $GUI_DISABLE )
  1078.                 GUICtrlSetState( $ie8  , $GUI_UNCHECKED + $GUI_DISABLE )
  1079.                 GUICtrlSetState( $ie9  , $GUI_UNCHECKED + $GUI_DISABLE )
  1080.                 GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  1081.             Else
  1082.                 If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  1083.                     StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
  1084.                     GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
  1085.                 Else
  1086.                     GUICtrlSetState( $ie7 , $GUI_ENABLE )
  1087.                 EndIf
  1088.                 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
  1089.                     GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
  1090.                 Else
  1091.                     GUICtrlSetState( $ie8 , $GUI_ENABLE )
  1092.                 EndIf
  1093.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR StringInStr( '9|10|11' , IEVersion()) > 0 Then
  1094.                     GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
  1095.                 Else
  1096.                     GUICtrlSetState( $ie9 , $GUI_ENABLE )
  1097.                 EndIf
  1098.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR IEVersion() = '11' Then
  1099.                     GUICtrlSetState( $ie11 , $GUI_UNCHECKED + $GUI_DISABLE )
  1100.                 Else
  1101.                     GUICtrlSetState( $ie11 , $GUI_ENABLE )
  1102.                 EndIf
  1103.             EndIf
  1104.  
  1105.         ; IE11 check box toggled
  1106.         Case $ie11
  1107.             If IsCheckBoxChecked( $ie11 ) Then
  1108.                 GUICtrlSetState( $ie7  , $GUI_UNCHECKED + $GUI_DISABLE )
  1109.                 GUICtrlSetState( $ie8  , $GUI_UNCHECKED + $GUI_DISABLE )
  1110.                 GUICtrlSetState( $ie9  , $GUI_UNCHECKED + $GUI_DISABLE )
  1111.                 GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  1112.             Else
  1113.                 If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  1114.                     StringInStr( '7|8|9|10|11' , IEVersion()) > 0 Then
  1115.                     GUICtrlSetState( $ie7 , $GUI_UNCHECKED + $GUI_DISABLE )
  1116.                 Else
  1117.                     GUICtrlSetState( $ie7 , $GUI_ENABLE )
  1118.                 EndIf
  1119.                 If StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  1120.                     StringInStr( '8|9|10|11' , IEVersion()) > 0 Then
  1121.                     GUICtrlSetState( $ie8 , $GUI_UNCHECKED + $GUI_DISABLE )
  1122.                 Else
  1123.                     GUICtrlSetState( $ie8 , $GUI_ENABLE )
  1124.                 EndIf
  1125.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 OR _
  1126.                     StringInStr( '9|10|11' , IEVersion()) > 0 Then
  1127.                     GUICtrlSetState( $ie9 , $GUI_UNCHECKED + $GUI_DISABLE )
  1128.                 Else
  1129.                     GUICtrlSetState( $ie9 , $GUI_ENABLE )
  1130.                 EndIf
  1131.                 If StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_2008' , @OSVersion ) > 0 OR _
  1132.                     StringInStr( '10|11' , IEVersion()) > 0 Then
  1133.                     GUICtrlSetState( $ie10 , $GUI_UNCHECKED + $GUI_DISABLE )
  1134.                 Else
  1135.                     GUICtrlSetState( $ie10 , $GUI_ENABLE )
  1136.                 EndIf
  1137.             EndIf
  1138.  
  1139.         ; .NET 3.5 check box toggled
  1140.         Case $dotnet35
  1141.             If IsCheckBoxChecked( $dotnet35 ) AND PowerShellVersion() <> $target_version_psh AND _
  1142.                 StringInStr( 'WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) = 0 Then
  1143.                 GUICtrlSetState( $psh , $GUI_ENABLE )
  1144.             Else
  1145.                 GUICtrlSetState( $psh , $GUI_UNCHECKED + $GUI_DISABLE )
  1146.             EndIf
  1147.  
  1148.         ; .NET 4 check box toggled
  1149.         Case $dotnet4
  1150.             If ( IsCheckBoxChecked( $dotnet4 ) OR DotNet4MainVersion() = '4.5' ) AND ManagementFrameworkVersion() <> WMFTargetVersion() AND _
  1151.                 StringInStr( 'WIN_XP|WIN_2003|WIN_VISTA|WIN_8|WIN_81|WIN_2012R2' , @OSVersion ) = 0 Then
  1152.                 GUICtrlSetState( $wmf , $GUI_ENABLE )
  1153.             Else
  1154.                 GUICtrlSetState( $wmf , $GUI_UNCHECKED + $GUI_DISABLE )
  1155.             EndIf
  1156.             If ( IsCheckBoxChecked( $dotnet4  ) OR DotNet4MainVersion() = '4.5' ) AND _
  1157.                 ( IsCheckBoxChecked( $dotnet35 ) OR DotNet35Version() = $target_version_dotnet35 ) Then
  1158.                 GUICtrlSetState( $wleall , $GUI_ENABLE )
  1159.                 For $i = 0 To $wlecount - 1
  1160.                     GUICtrlSetState( $wlepacks[$i] , $GUI_ENABLE )
  1161.                 Next
  1162.             Else
  1163.                 GUICtrlSetState( $wleall , $GUI_UNCHECKED + $GUI_DISABLE )
  1164.                 For $i = 0 To $wlecount - 1
  1165.                     GUICtrlSetState( $wlepacks[$i] , $GUI_UNCHECKED + $GUI_DISABLE )
  1166.                 Next
  1167.             EndIf
  1168.  
  1169.         ; Microsoft Security Essentials check box toggled
  1170.         Case $msse
  1171.             If IsCheckBoxChecked( $msse ) Then
  1172.                 If ShowGUIInGerman() Then
  1173.                     If MsgBox( 0x2134 , 'Warnung' , 'Bei der Installation der Microsoft Security Essentials wird eine' _
  1174.                                                             & @LF & 'obligate "Windows Genuine Advantage" (WGA)-Prüfung durchgeführt.' _
  1175.                                                             & @LF & 'Möchten Sie fortsetzen?' ) = 7 Then
  1176.                         GUICtrlSetState( $msse , $GUI_UNCHECKED )
  1177.                     EndIf
  1178.                 Else
  1179.                     If MsgBox( 0x2134 , 'Warning' , 'The installation of Microsoft Security Essentials performs' _
  1180.                                                             & @LF & 'a mandatory "Windows Genuine Advantage" (WGA) check.' _
  1181.                                                             & @LF & 'Do you wish to proceed?' ) = 7 Then
  1182.                         GUICtrlSetState( $msse , $GUI_UNCHECKED )
  1183.                     EndIf
  1184.                 EndIf
  1185.             EndIf
  1186.  
  1187.         ; Automatic reboot check box toggled
  1188.         Case $autoreboot
  1189.             If IsCheckBoxChecked( $autoreboot ) AND StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
  1190.                 If ShowGUIInGerman() Then
  1191.                     If MsgBox( 0x2134 , 'Warnung' , 'Die Option "Automatisch neu starten und fortsetzen" deaktiviert' _
  1192.                                                             & @LF & 'temporär die Benutzerkontensteuerung (UAC), falls erforderlich.' _
  1193.                                                             & @LF & 'Möchten Sie fortsetzen?' ) = 7 Then
  1194.                         GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
  1195.                     EndIf
  1196.                 Else
  1197.                     If MsgBox( 0x2134 , 'Warning' , 'The option "Automatic reboot and recall" temporarily' _
  1198.                                                             & @LF & 'disables the User Account Control (UAC), if required.' _
  1199.                                                             & @LF & 'Do you wish to proceed?' ) = 7 Then
  1200.                         GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
  1201.                     EndIf
  1202.                 EndIf
  1203.             EndIf
  1204.             If IsCheckBoxChecked( $autoreboot ) AND DriveGetType( $scriptdir ) = 'Network' Then
  1205.                 If ShowGUIInGerman() Then
  1206.                     If MsgBox( 0x2134 , 'Warnung' , @ScriptName & ' wurde von einer Netzwerkfreigabe gestartet.' _
  1207.                                                             & @LF & 'Die Option "Automatisch neu starten und fortsetzen"' _
  1208.                                                             & @LF & 'funktioniert nur dann ohne Benutzereingriff,' _
  1209.                                                             & @LF & 'wenn diese Freigabe anonymen Zugriff erlaubt.' _
  1210.                                                             & @LF & 'Möchten Sie fortsetzen?' ) = 7 Then
  1211.                         GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
  1212.                     EndIf
  1213.                 Else
  1214.                     If MsgBox( 0x2134 , 'Warning' , @ScriptName & ' was started from a network share.' _
  1215.                                                             & @LF & 'The option "Automatic reboot and recall"' _
  1216.                                                             & @LF & 'does only work without user interaction,' _
  1217.                                                             & @LF & 'if this share permits anonymous access.' _
  1218.                                                             & @LF & 'Do you wish to proceed?' ) = 7 Then
  1219.                         GUICtrlSetState( $autoreboot , $GUI_UNCHECKED )
  1220.                     EndIf
  1221.                 EndIf
  1222.             EndIf
  1223.  
  1224.         ; Automatic shutdown check box toggled
  1225.         Case $shutdown
  1226.             If IsCheckBoxChecked( $shutdown ) Then
  1227.                 GUICtrlSetState( $showlog , $GUI_UNCHECKED + $GUI_DISABLE )
  1228.             Else
  1229.                 GUICtrlSetState( $showlog , $GUI_ENABLE )
  1230.             EndIf
  1231.  
  1232.         ; Select all check box toggled
  1233.         Case $wleall
  1234.             If IsCheckBoxChecked( $wleall ) Then
  1235.                 For $i = 0 To $wlecount - 1
  1236.                     GUICtrlSetState( $wlepacks[$i] , $GUI_CHECKED )
  1237.                 Next
  1238.             Else
  1239.                 For $i = 0 To $wlecount - 1
  1240.                     GUICtrlSetState( $wlepacks[$i] , $GUI_UNCHECKED )
  1241.                 Next
  1242.             EndIf
  1243.  
  1244.         Case $wlepacks[0] To $wlepacks[$wlecount - 1]
  1245.             For $i = 0 To $wlecount - 1
  1246.                 If NOT IsCheckBoxChecked( $wlepacks[$i] ) Then
  1247.                     GUICtrlSetState( $wleall , $GUI_UNCHECKED )
  1248.                     ExitLoop
  1249.                 EndIf
  1250.             Next
  1251.  
  1252.         ; Select all check box toggled
  1253.         Case $msiall
  1254.             If IsCheckBoxChecked( $msiall ) Then
  1255.                 For $i = 0 To $msicount - 1
  1256.                     GUICtrlSetState( $msipacks[$i] , $GUI_CHECKED )
  1257.                 Next
  1258.             Else
  1259.                 For $i = 0 To $msicount - 1
  1260.                     GUICtrlSetState( $msipacks[$i] , $GUI_UNCHECKED )
  1261.                 Next
  1262.             EndIf
  1263.  
  1264.         Case $msipacks[0] To $msipacks[$msicount - 1]
  1265.             For $i = 0 To $msicount - 1
  1266.                 If NOT IsCheckBoxChecked( $msipacks[$i] ) Then
  1267.                     GUICtrlSetState( $msiall , $GUI_UNCHECKED )
  1268.                     ExitLoop
  1269.                 EndIf
  1270.             Next
  1271.  
  1272.         ; Start Button pressed
  1273.         Case $btn_start
  1274.             ; Dummy use of $options
  1275.             $options = MyIniRead( $ini_section_misc , $ini_value_wustatusserver , '' )
  1276.             If $options <> '' Then RegWrite( $reg_key_windowsupdate , $reg_val_wustatusserver , 'REG_SZ' , $options )
  1277.             $options = ''
  1278.             If NOT IsCheckBoxChecked( $backup ) Then $options &= ' /nobackup'
  1279.             If IsCheckBoxChecked( $rcerts )     Then $options &= ' /updatercerts'
  1280.             If IsCheckBoxChecked( $ie7  )       Then $options &= ' /instie7'
  1281.             If IsCheckBoxChecked( $ie8  )       Then $options &= ' /instie8'
  1282.             If IsCheckBoxChecked( $ie9  )       Then $options &= ' /instie9'
  1283.             If IsCheckBoxChecked( $ie10 )       Then $options &= ' /instie10'
  1284.             If IsCheckBoxChecked( $ie11 )       Then $options &= ' /instie11'
  1285.             If IsCheckBoxChecked( $cpp  )       Then $options &= ' /updatecpp'
  1286.             If IsCheckBoxChecked( $mssl )       Then $options &= ' /instmssl'
  1287.             If IsCheckBoxChecked( $dotnet35 )   Then $options &= ' /instdotnet35'
  1288.             If IsCheckBoxChecked( $psh )        Then $options &= ' /instpsh'
  1289.             If IsCheckBoxChecked( $dotnet4 )    Then $options &= ' /instdotnet4'
  1290.             If IsCheckBoxChecked( $wmf  )       Then $options &= ' /instwmf'
  1291.             If IsCheckBoxChecked( $msse )       Then $options &= ' /instmsse'
  1292.             If IsCheckBoxChecked( $tsc  )       Then $options &= ' /updatetsc'
  1293.             If IsCheckBoxChecked( $ofv  )       Then $options &= ' /instofv'
  1294.             If IsCheckBoxChecked( $verify )     Then $options &= ' /verify'
  1295.             If BitAND( GUICtrlRead( $autoreboot ) , $GUI_DISABLE ) <> $GUI_DISABLE AND IsCheckBoxChecked( $autoreboot ) Then
  1296.                 $options &= ' /autoreboot'
  1297.             Else
  1298.                 IniCopy()
  1299.             EndIf
  1300.             If IsCheckBoxChecked( $shutdown )   Then $options &= ' /shutdown'
  1301.             If IsCheckBoxChecked( $showlog )    Then $options &= ' /showlog'
  1302.             If MyIniRead( $ini_section_installation , $ini_value_all            , $disabled ) = $enabled Then $options &= ' /all'
  1303.             If MyIniRead( $ini_section_installation , $ini_value_excludestatics , $disabled ) = $enabled Then $options &= ' /excludestatics'
  1304.             If MyIniRead( $ini_section_installation , $ini_value_skipdynamic    , $disabled ) = $enabled Then $options &= ' /skipdynamic'
  1305.             If IsCheckBoxChecked( $wleall ) Then
  1306.                 $line = '%1 /AppSelect:All /noToolbarCEIP /noSearch /noHomepage /noMU /noLaunch /q'
  1307.                 $wlecmdfile = FileOpen( @WindowsDir & $path_rel_wle_cmd , 10 )
  1308.             Else
  1309.                 $wlecmdfile = -1
  1310.                 For $i = 0 To $wlecount - 1
  1311.                     If IsCheckBoxChecked( $wlepacks[$i] ) Then
  1312.                         $wlecmdfile = FileOpen( @WindowsDir & $path_rel_wle_cmd , 10 )
  1313.                         ExitLoop
  1314.                     EndIf
  1315.                 Next
  1316.                 If $wlecmdfile <> -1 Then
  1317.                     $line = '%1 /AppSelect:'
  1318.                     For $i = 0 To $wlecount - 1
  1319.                         If IsCheckBoxChecked( $wlepacks[$i] ) Then
  1320.                             Switch $i
  1321.                                 Case 0  ; OneDrive
  1322.                                     $line = $line & 'wlsync,'
  1323.                                 Case 1  ; Messenger
  1324.                                     $line = $line & 'messenger,'
  1325.                                 Case 2  ; Mail
  1326.                                     $line = $line & 'mail,'
  1327.                                 Case 3  ; Outlook Connector Pack
  1328.                                     $line = $line & 'olc,'
  1329.                                 Case 4  ; Photo Gallery and Movie Maker
  1330.                                     $line = $line & 'moviemaker,'
  1331.                                 Case 5  ; Writer
  1332.                                     $line = $line & 'writer,'
  1333.                                 Case 6  ; Family Safety
  1334.                                     $line = $line & 'familysafety,'
  1335.                             EndSwitch
  1336.                         EndIf
  1337.                     Next
  1338.                     $line = StringLeft( $line , StringLen( $line ) - 1 ) & ' /noToolbarCEIP /noSearch /noHomepage /noMU /noLaunch /q'
  1339.                 EndIf
  1340.             EndIf
  1341.             If $wlecmdfile <> -1 Then
  1342.                 FileWriteLine( $wlecmdfile , $line )
  1343.                 FileWriteLine( $wlecmdfile , 'echo %DATE% %TIME% - Info: Installed Windows Essentials 2012 (' & $line & ')>>%UPDATE_LOGFILE%' )
  1344.                 FileClose(     $wlecmdfile )
  1345.             EndIf
  1346.             $msilistfile = FileOpen( @WindowsDir & $path_rel_msi_selected , 10 )
  1347.             If $msilistfile <> -1 Then
  1348.                 For $i = 0 To $msicount - 1
  1349.                     If IsCheckBoxChecked( $msipacks[$i] ) Then FileWriteLine( $msilistfile , GUICtrlRead( $msipacks[$i] , 1 ))
  1350.                 Next
  1351.                 FileClose( $msilistfile )
  1352.             EndIf
  1353.             If FileGetSize( @WindowsDir & $path_rel_msi_selected ) = 0 Then
  1354.                 FileDelete(  @WindowsDir & $path_rel_msi_selected )
  1355.             EndIf
  1356.             If @OSArch <> 'X86' Then DllCall( 'kernel32.dll' , 'int' , 'Wow64DisableWow64FsRedirection' , 'int' , 1 )
  1357.             If Run( @ComSpec & ' /D /C Update.cmd' & $options , $scriptdir , @SW_HIDE ) = 0 Then
  1358.                 If ShowGUIInGerman() Then
  1359.                     MsgBox( 0x2010 , 'Fehler' , 'Fehler #' & @error & ' beim Aufruf von' _
  1360.                                                     & @LF & @ComSpec & ' /D /C Update.cmd' & $options & ' in' _
  1361.                                                     & @LF & $scriptdir & '.' )
  1362.                 Else
  1363.                     MsgBox( 0x2010 , 'Error' , 'Error #' & @error & ' when calling' _
  1364.                                                     & @LF & @ComSpec & ' /D /C Update.cmd' & $options & ' in' _
  1365.                                                     & @LF & $scriptdir & '.' )
  1366.                 EndIf
  1367.             Else
  1368.                 ExitLoop
  1369.             EndIf
  1370.     EndSwitch
  1371. WEnd
  1372. Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement