Advertisement
Nologic

WSUS Offline Update Rev 6

Jul 7th, 2015
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 84.17 KB | None | 0 0
  1. ; ***  WSUS Offline Update 9.7 - Generator  ***
  2. ; ***       Author: T. Wittrock, Kiel       ***
  3. ; ***     USB-Option added by Ch. Riedel    ***
  4. ; ***   Dialog scaling added by Th. Baisch  ***
  5.  
  6. #include <GUIConstants.au3>
  7. #include <Array.au3>
  8.  
  9. #pragma compile( CompanyName      , 'T. Wittrock' )
  10. #pragma compile( FileDescription  , 'WSUS Offline Update Generator' )
  11. #pragma compile( FileVersion      , 9.7.0.669 )
  12. #pragma compile( InternalName     , 'Generator' )
  13. #pragma compile( LegalCopyright   , 'GNU GPLv3' )
  14. #pragma compile( OriginalFilename , UpdateGenerator.exe )
  15. #pragma compile( ProductName      , 'WSUS Offline Update' )
  16. #pragma compile( ProductVersion   , 9.7.0 )
  17.  
  18. AutoItSetOption( 'GUICloseOnESC' , 0 )
  19. AutoItSetOption( 'TrayAutoPause' , 0 )
  20. AutoItSetOption( 'TrayIconHide'  , 1 )
  21.  
  22. Const $caption                  = 'WSUS Offline Update 9.7'
  23. Const $title                    = $caption & ' - Generator'
  24. Const $donationURL              = 'http://www.wsusoffline.net/donate.html'
  25. Const $downloadLogFile          = 'download.log'
  26. Const $runAllFile               = 'RunAll.cmd'
  27.  
  28. ; Registry Constants
  29. Const $reg_key_hkcu_desktop     = 'HKEY_CURRENT_USER\Control Panel\Desktop'
  30. Const $reg_key_hkcu_winmetrics  = 'HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics'
  31. Const $reg_val_logpixels        = 'LogPixels'
  32. Const $reg_val_applieddpi       = 'AppliedDPI'
  33.  
  34. ; Message Box Return Codes
  35. Const $msgbox_btn_ok            = 1
  36. Const $msgbox_btn_cancel        = 2
  37. Const $msgbox_btn_abort         = 3
  38. Const $msgbox_btn_retry         = 4
  39. Const $msgbox_btn_ignore        = 5
  40. Const $msgbox_btn_yes           = 6
  41. Const $msgbox_btn_no            = 7
  42. Const $msgbox_btn_tryagain      = 10
  43. Const $msgbox_btn_continue      = 11
  44.  
  45. ; Defaults
  46. Const $default_logpixels        = 96
  47.  
  48. ; INI file Constants
  49. Const $ini_section_w2k3         = "Windows Server 2003"
  50. Const $ini_section_w2k3_x64     = "Windows Server 2003 x64"
  51. Const $ini_section_w60          = "Windows Vista"
  52. Const $ini_section_w60_x64      = "Windows Vista x64"
  53. Const $ini_section_w61          = "Windows 7"
  54. Const $ini_section_w61_x64      = "Windows Server 2008 R2"
  55. Const $ini_section_w62          = "Windows 8"
  56. Const $ini_section_w62_x64      = "Windows Server 2012"
  57. Const $ini_section_w63          = "Windows 8.1"
  58. Const $ini_section_w63_x64      = "Windows Server 2012 R2"
  59. Const $ini_section_o2k7         = "Office 2007"
  60. Const $ini_section_o2k10        = "Office 2010"
  61. Const $ini_section_o2k13        = "Office 2013"
  62. Const $ini_section_iso          = "ISO Images"
  63. Const $ini_section_usb          = "USB Images"
  64. Const $ini_section_opts         = "Options"
  65. Const $ini_section_misc         = "Miscellaneous"
  66. Const $enabled                  = "Enabled"
  67. Const $disabled                 = "Disabled"
  68. Const $iso_token_cd             = "single"
  69. Const $iso_token_dvd            = "cross-platform"
  70. Const $iso_token_skiphashes     = "skiphashes"
  71. Const $usb_token_copy           = "copy"
  72. Const $usb_token_path           = "path"
  73. Const $usb_token_cleanup        = "cleanup"
  74. Const $opts_token_includesp     = "includesp"
  75. Const $opts_token_allowsp       = "allowsp"
  76. Const $opts_token_includedotnet = "includedotnet"
  77. Const $opts_token_allowdotnet   = "allowdotnet"
  78. Const $opts_token_wle           = "includewle"
  79. Const $opts_token_msse          = "includemsse"
  80. Const $opts_token_wddefs        = "includewddefs"
  81. Const $opts_token_cleanup       = "cleanupdownloads"
  82. Const $opts_token_verify        = "verifydownloads"
  83. Const $misc_token_proxy         = "proxy"
  84. Const $misc_token_wsus          = "wsus"
  85. Const $misc_token_wsus_only     = "wsusonly"
  86. Const $misc_token_wsus_proxy    = "wsusbyproxy"
  87. Const $misc_token_wsus_trans    = "transferwsus"
  88. Const $misc_token_skipsdd       = "skipsdd"
  89. Const $misc_token_skiptz        = "skiptz"
  90. Const $misc_token_skipdownload  = "skipdownload"
  91. Const $misc_token_skipdynamic   = "skipdynamic"
  92. Const $misc_token_chkver        = "checkouversion"
  93. Const $misc_token_minimize      = "minimizeondownload"
  94. Const $misc_token_showshutdown  = "showshutdown"
  95. Const $misc_token_showdonate    = "showdonate"
  96. Const $misc_token_clt_wustat    = "WUStatusServer"
  97.  
  98. ; Paths
  99. Const $path_max_length          = 192
  100. Const $path_invalid_chars       = '!%&()^+,;='
  101. Const $paths_rel_structure      = '\bin\,\client\bin\,\client\cmd\,\client\exclude\,\client\opt\,\client\static\,\cmd\,\exclude\,\iso\,\log\,\static\,\xslt\'
  102. Const $path_rel_builddate       = '\client\builddate.txt'
  103. Const $path_rel_clientini       = '\client\UpdateInstaller.ini'
  104. Const $path_rel_win_glb         = '\client\win\glb'
  105.  
  106. Dim $maindlg , $inifilename , $tabitemfocused , $includesp , $dotnet , $wle , $msse , $wddefs , $verifydownloads , $cdiso , $dvdiso , $buildlbl
  107. Dim $usbcopy , $usbpath , $usbfsf , $usbclean , $imageonly , $scripting , $shutdown , $btn_start , $btn_proxy , $btn_wsus , $btn_donate , $btn_exit , $proxy , $proxypwd , $wsus , $dummy
  108. Dim $dlgheight , $groupwidth , $groupheight_lng , $groupheight_glb , $txtwidth , $txtheight , $slimheight , $btnwidth , $btnheight , $txtxoffset , $txtyoffset , $txtxpos , $txtypos , $runany
  109.  
  110. Global Const $aMainArray[26][5] = [ [ 25   , 'Windows'      , 'Office'           , 'Deutsch'        , 'English'      ] , _
  111.                                                 ['glb' , 'w60|w60 x64|w61|w61 x64|w62|w62 x64|w63|w63 x64'                       ] , _
  112.                                                 ['enu' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Englisch'       , 'English'      ] , _
  113.                                                 ['fra' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Französisch'    , 'French'       ] , _
  114.                                                 ['esn' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Spanisch'       , 'Spanish'      ] , _
  115.                                                 ['jpn' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Japanisch'      , 'Japanese'     ] , _
  116.                                                 ['kor' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Koreanisch'     , 'Korean'       ] , _
  117.                                                 ['rus' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Russisch'       , 'Russian'      ] , _
  118.                                                 ['ptg' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Portugiesisch'  , 'Portuguese'   ] , _
  119.                                                 ['ptb' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Brasilianisch'  , 'Brazilian'    ] , _
  120.                                                 ['deu' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Deutsch'        , 'German'       ] , _
  121.                                                 ['nld' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Niederländisch' , 'Dutch'        ] , _
  122.                                                 ['ita' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Italienisch'    , 'Italian'      ] , _
  123.                                                 ['chs' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Chin. (simpl.)' , 'Chinese (s.)' ] , _
  124.                                                 ['cht' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Chin. (trad.)'  , 'Chinese (tr.)'] , _
  125.                                                 ['plk' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Polnisch'       , 'Polish'       ] , _
  126.                                                 ['hun' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Ungarisch'      , 'Hungarian'    ] , _
  127.                                                 ['csy' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Tschechisch'    , 'Czech'        ] , _
  128.                                                 ['sve' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Schwedisch'     , 'Swedish'      ] , _
  129.                                                 ['trk' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Türkisch'       , 'Turkish'      ] , _
  130.                                                 ['ell' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Griechisch'     , 'Greek'        ] , _
  131.                                                 ['ara' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Arabisch'       , 'Arabic'       ] , _
  132.                                                 ['heb' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Hebräisch'      , 'Hebrew'       ] , _
  133.                                                 ['dan' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Dänisch'        , 'Danish'       ] , _
  134.                                                 ['nor' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Norwegisch'     , 'Norwegian'    ] , _
  135.                                                 ['fin' , 'w2k3'         , 'o2k7|o2k10|o2k13' , 'Finnisch'       , 'Finnish'      ] ]
  136.  
  137. ; Create Language Tokens ex. $lang_token_glb
  138. For $ii = 1 To $aMainArray[0][0]
  139.     If $aMainArray[$ii][0] <> '' Then
  140.         Assign( 'lang_token_' & $aMainArray[$ii][0] , $aMainArray[$ii][0] , 2 )
  141.     EndIf
  142. Next
  143.  
  144. Func ShowGUIInGerman()
  145.     If $CmdLine[0] > 0 Then
  146.         If StringLower( $CmdLine[1] ) = 'deu' Then
  147.             Return True
  148.         Else
  149.             Return False
  150.         EndIf
  151.     EndIf
  152.  
  153.     Return StringInStr( '0007|0407|0807|0C07|1007|1407' , @OSLang ) > 0
  154. EndFunc
  155.  
  156. Func IsUNCPath( $path )
  157.     Return StringInStr( $path , '\\' ) > 0
  158. EndFunc
  159.  
  160. Func PathValid( $path )
  161.     Local $result , $arr_invalid , $ii
  162.  
  163.     If StringLen( $path ) > $path_max_length Then
  164.         $result = False
  165.     Else
  166.         $result = True
  167.         $arr_invalid = StringSplit( $path_invalid_chars , '' )
  168.         For $ii = 1 to $arr_invalid[0]
  169.             If StringInStr( $path , $arr_invalid[$ii] ) > 0 Then
  170.                 $result = False
  171.                 ExitLoop
  172.             EndIf
  173.         Next
  174.     EndIf
  175.  
  176.     Return $result
  177. EndFunc
  178.  
  179. Func DirectoryStructureExists()
  180.     Local $result = True , $arr_dirs , $ii
  181.  
  182.     $arr_dirs = StringSplit( $paths_rel_structure , ',' )
  183.     For $ii = 1 to $arr_dirs[0]
  184.         $result = $result AND FileExists( @ScriptDir & $arr_dirs[$ii] )
  185.     Next
  186.  
  187.     Return $result
  188. EndFunc
  189.  
  190. Func LastDownloadRun()
  191.     Local $result = FileReadLine( @ScriptDir & $path_rel_builddate )
  192.     If @error Then $result = ShowGUIInGerman() ? '[Kein]' : '[None]'
  193.  
  194.     Return $result
  195. EndFunc
  196.  
  197. Func ClientIniFileName()
  198.     Return @ScriptDir & $path_rel_clientini
  199. EndFunc
  200.  
  201. Func LanguageCaption( $token , $german )
  202.     Local $iFind = _ArraySearch( $aMainArray , $token , 1 , 0 , 0 , 0 , 1 , 0 )
  203.     If $iFind = -1 Then
  204.         Return ''
  205.     Else
  206.         If $german Then
  207.             Return $aMainArray[$iFind][3]
  208.         Else
  209.             Return $aMainArray[$iFind][4]
  210.         EndIf
  211.     EndIf
  212. EndFunc
  213.  
  214. Func IsCheckBoxChecked( $chkbox )
  215.     Return BitAND( GUICtrlRead( $chkbox ) , $GUI_CHECKED ) = $GUI_CHECKED
  216. EndFunc
  217.  
  218. Func CheckBoxStateToString( $chkbox )
  219.     If IsCheckBoxChecked( $chkbox ) Then
  220.         Return $enabled
  221.     Else
  222.         Return $disabled
  223.     EndIf
  224. EndFunc
  225.  
  226. Func IsLangOfficeChecked()
  227.     Local $aOffChkSplit , $ii , $jj
  228.  
  229.     For $ii = 1 To $aMainArray[0][0]
  230.         If $aMainArray[$ii][2] <> '' Then
  231.             $aOffChkSplit = StringSplit( $aMainArray[$ii][2] , '|' )
  232.             For $jj = 1 To $aOffChkSplit[0]
  233.                 $sCurrentVar = StringReplace( $aOffChkSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  234.                 If IsCheckBoxChecked( Eval( $sCurrentVar )) Then
  235.                     Return True
  236.                 EndIf
  237.             Next
  238.         EndIf
  239.     Next
  240. EndFunc
  241.  
  242. Func SwitchDownloadTargets( $state )
  243.     Local $aWinDwnSplit , $aOffDwnSplit
  244.     Local $sCurrentVar  , $ii , $jj
  245.  
  246.     ; Windows
  247.     For $ii = 1 To $aMainArray[0][0]
  248.         If StringInStr( 'ell|ara|heb|dan|nor|fin' , $aMainArray[$ii][0] ) > 0 Then ContinueLoop
  249.         If $aMainArray[$ii][1] <> '' Then
  250.             $aWinDwnSplit = StringSplit( $aMainArray[$ii][1] , '|' )
  251.             For $jj = 1 To $aWinDwnSplit[0]
  252.                 $sCurrentVar = StringReplace( $aWinDwnSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  253.                 GUICtrlSetState( Eval( $sCurrentVar ) , $state )
  254.             Next
  255.         EndIf
  256.     Next
  257.  
  258.     ; Office
  259.     For $ii = 1 To $aMainArray[0][0]
  260.         If $aMainArray[$ii][2] <> '' Then
  261.             $aOffDwnSplit = StringSplit( $aMainArray[$ii][2] , '|' )
  262.             For $jj = 1 To $aOffDwnSplit[0]
  263.                 $sCurrentVar = StringReplace( $aOffDwnSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  264.                 GUICtrlSetState( Eval( $sCurrentVar ) , $state )
  265.             Next
  266.         EndIf
  267.     Next
  268.  
  269.     Return 0
  270. EndFunc
  271.  
  272. Func DisableGUI()
  273.     SwitchDownloadTargets( $GUI_DISABLE )
  274.  
  275.     GUICtrlSetState( $verifydownloads , $GUI_DISABLE )
  276.     GUICtrlSetState( $includesp       , $GUI_DISABLE )
  277.     GUICtrlSetState( $dotnet          , $GUI_DISABLE )
  278.     GUICtrlSetState( $wle             , $GUI_DISABLE )
  279.     GUICtrlSetState( $msse            , $GUI_DISABLE )
  280.     GUICtrlSetState( $wddefs          , $GUI_DISABLE )
  281.  
  282.     GUICtrlSetState( $cdiso           , $GUI_DISABLE )
  283.     GUICtrlSetState( $dvdiso          , $GUI_DISABLE )
  284.     GUICtrlSetState( $usbcopy         , $GUI_DISABLE )
  285.     GUICtrlSetState( $usbpath         , $GUI_DISABLE )
  286.     GUICtrlSetState( $usbfsf          , $GUI_DISABLE )
  287.     GUICtrlSetState( $usbclean        , $GUI_DISABLE )
  288.  
  289.     GUICtrlSetState( $btn_start       , $GUI_DISABLE )
  290.     GUICtrlSetState( $imageonly       , $GUI_DISABLE )
  291.     GUICtrlSetState( $scripting       , $GUI_DISABLE )
  292.     GUICtrlSetState( $shutdown        , $GUI_DISABLE )
  293.     GUICtrlSetState( $btn_proxy       , $GUI_DISABLE )
  294.     GUICtrlSetState( $btn_wsus        , $GUI_DISABLE )
  295.     GUICtrlSetState( $btn_donate      , $GUI_DISABLE )
  296.     GUICtrlSetState( $btn_exit        , $GUI_DISABLE )
  297.  
  298.     Return 0
  299. EndFunc
  300.  
  301. Func EnableGUI()
  302.     SwitchDownloadTargets( $GUI_ENABLE )
  303.     If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled AND NOT IsCheckBoxChecked( $imageonly ) Then
  304.         GUICtrlSetState( $verifydownloads , $GUI_ENABLE )
  305.     EndIf
  306.     GUICtrlSetState( $dotnet , $GUI_ENABLE )
  307.     If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled Then
  308.         GUICtrlSetState( $includesp , $GUI_ENABLE )
  309.         GUICtrlSetState( $wle       , $GUI_ENABLE )
  310.         GUICtrlSetState( $msse      , $GUI_ENABLE )
  311.         GUICtrlSetState( $wddefs    , $GUI_ENABLE )
  312.         GUICtrlSetState( $cdiso     , $GUI_ENABLE )
  313.         GUICtrlSetState( $dvdiso    , $GUI_ENABLE )
  314.         GUICtrlSetState( $usbcopy   , $GUI_ENABLE )
  315.         If IsCheckBoxChecked( $usbcopy ) Then
  316.             GUICtrlSetState( $usbpath  , $GUI_ENABLE )
  317.             GUICtrlSetState( $usbfsf   , $GUI_ENABLE )
  318.             GUICtrlSetState( $usbclean , $GUI_ENABLE )
  319.         EndIf
  320.     EndIf
  321.     GUICtrlSetState( $btn_start , $GUI_ENABLE )
  322.     GUICtrlSetState( $scripting , $GUI_ENABLE )
  323.     If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled Then
  324.         GUICtrlSetState( $imageonly , $GUI_ENABLE )
  325.         If NOT IsCheckBoxChecked( $imageonly ) Then GUICtrlSetState( $shutdown , $GUI_ENABLE )
  326.     EndIf
  327.     GUICtrlSetState( $btn_proxy , $GUI_ENABLE )
  328.     If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled AND _
  329.         IniRead( $inifilename , $ini_section_misc , $misc_token_skipdynamic  , $disabled ) = $disabled Then
  330.         GUICtrlSetState( $btn_wsus , $GUI_ENABLE )
  331.     EndIf
  332.     GUICtrlSetState( $btn_donate , $GUI_ENABLE )
  333.     GUICtrlSetState( $btn_exit   , $GUI_ENABLE )
  334.  
  335.     Return 0
  336. EndFunc
  337.  
  338. Func RFC1738EncodedString( $str )
  339.     Local $result , $ii
  340.  
  341.     For $ii = 1 to StringLen( $str )
  342.         If StringIsAlNum( StringMid( $str , $ii , 1 )) Then
  343.             $result &= StringMid( $str , $ii , 1 )
  344.         Else
  345.             $result &= '%' & Hex( Asc( StringMid( $str , $ii , 1 )) , 2 )
  346.         EndIf
  347.     Next
  348.  
  349.     Return $result
  350. EndFunc
  351.  
  352. Func AuthProxy( $strproxy , $strproxypwd )
  353.     Local $result = $strproxy
  354.     Local $pos    = StringInStr( $strproxy , ':@' )
  355.     If $pos > 0 AND $strproxypwd <> '' Then
  356.         $result = StringLeft( $strproxy , $pos ) & $strproxypwd & StringRight( $strproxy , StringLen( $strproxy ) - $pos )
  357.     EndIf
  358.  
  359.     Return $result
  360. EndFunc
  361.  
  362. Func DetermineDownloadSwitches( $chkbox_includesp , $chkbox_dotnet , $chkbox_wle , $chkbox_msse , $chkbox_wddefs , $chkbox_verifydownloads , $strproxy , $strwsus )
  363.     Local $result
  364.  
  365.     If NOT IsCheckBoxChecked( $chkbox_includesp )   Then $result &= ' /excludesp'
  366.     If IsCheckBoxChecked( $chkbox_dotnet )          Then $result &= ' /includedotnet'
  367.     If IsCheckBoxChecked( $chkbox_wle    )          Then $result &= ' /includewle'
  368.     If IsCheckBoxChecked( $chkbox_msse   )          Then $result &= ' /includemsse'
  369.     If IsCheckBoxChecked( $chkbox_wddefs )          Then $result &= ' /includewddefs'
  370.     If IsCheckBoxChecked( $chkbox_verifydownloads ) Then $result &= ' /verify'
  371.     If NOT IsCheckBoxChecked( $scripting )          Then $result &= ' /exitonerror'
  372.     If IniRead( $inifilename , $ini_section_opts , $opts_token_cleanup , $enabled  ) = $disabled Then $result &= ' /nocleanup'
  373.     If IniRead( $inifilename , $ini_section_misc , $misc_token_skipsdd , $disabled ) = $enabled  Then $result &= ' /skipsdd'
  374.     If IniRead( $inifilename , $ini_section_misc , $misc_token_skiptz  , $disabled ) = $enabled  Then $result &= ' /skiptz'
  375.     If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then
  376.         $result &= ' /skipdownload'
  377.     Else
  378.         If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdynamic , $disabled ) = $enabled Then $result &= ' /skipdynamic'
  379.     EndIf
  380.     If $strproxy <> '' Then $result &= ' /proxy ' & $strproxy
  381.     If $strwsus  <> '' Then $result &= ' /wsus '  & $strwsus
  382.     If IniRead( $inifilename , $ini_section_misc , $misc_token_wsus_only  , $disabled ) = $enabled Then $result &= ' /wsusonly'
  383.     If IniRead( $inifilename , $ini_section_misc , $misc_token_wsus_proxy , $disabled ) = $enabled Then $result &= ' /wsusbyproxy'
  384.  
  385.     Return $result
  386. EndFunc
  387.  
  388. Func DetermineISOSwitches( $chkbox_includesp , $chkbox_dotnet , $chkbox_wle , $chkbox_msse , $chkbox_wddefs , $chkbox_usbclean )
  389.     Local $result
  390.  
  391.     If NOT IsCheckBoxChecked( $chkbox_includesp ) Then $result &= ' /excludesp'
  392.     If IsCheckBoxChecked( $chkbox_dotnet   ) Then $result &= ' /includedotnet'
  393.     If IsCheckBoxChecked( $chkbox_wle      ) Then $result &= ' /includewle'
  394.     If IsCheckBoxChecked( $chkbox_msse     ) Then $result &= ' /includemsse'
  395.     If IsCheckBoxChecked( $chkbox_wddefs   ) Then $result &= ' /includewddefs'
  396.     If IsCheckBoxChecked( $chkbox_usbclean ) Then $result &= ' /cleanup'
  397.     If NOT IsCheckBoxChecked( $scripting   ) Then $result &= ' /exitonerror'
  398.     If IniRead( $inifilename , $ini_section_iso , $iso_token_skiphashes , $disabled ) = $enabled Then $result &= ' /skiphashes'
  399.  
  400.     Return $result
  401. EndFunc
  402.  
  403. Func ShowLogFile()
  404.     Run( 'notepad.exe "' & @ScriptDir & '\log\' & $downloadLogFile & '"' )
  405. EndFunc
  406.  
  407. Func ShowRunAll()
  408.     Run( 'notepad.exe "' & @ScriptDir & '\cmd\custom\' & $runAllFile & '"' )
  409. EndFunc
  410.  
  411. Func RunVersionCheck( $strproxy )
  412.     Local $result
  413.  
  414.     DisableGUI()
  415.     If $strproxy = '' Then
  416.         $result = RunWait( @ComSpec & ' /D /C CheckOUVersion.cmd /exitonerror' , @ScriptDir & '\cmd\' , @SW_SHOWMINNOACTIVE )
  417.     Else
  418.         $result = RunWait( @ComSpec & ' /D /C CheckOUVersion.cmd /exitonerror /proxy ' & $strproxy , @ScriptDir & '\cmd\' , @SW_SHOWMINNOACTIVE )
  419.     EndIf
  420.     If $result = 0 Then $result = @error
  421.     If $result <> 0 Then
  422.         If ShowGUIInGerman() Then
  423.             $sMsgBoxTitle = 'Versionsprüfung'
  424.             $sMsgBoxText  = 'Sie setzen ' & $caption & ' ein. Eine neuere Version ist verfügbar.' & @LF & _
  425.                                  'Möchten Sie WSUS Offline Update nun aktualisieren?'
  426.         Else
  427.             $sMsgBoxTitle = 'Version check'
  428.             $sMsgBoxText  = 'You are using ' & $caption & '. A newer version is available.' & @LF & _
  429.                                  'Would you like to update WSUS Offline Update now?'
  430.         EndIf
  431.         $result = MsgBox( 0x2023 , $sMsgBoxTitle , $sMsgBoxText )
  432.         Switch $result
  433.             Case $msgbox_btn_yes
  434.                 $result = -1
  435.             Case $msgbox_btn_no
  436.                 $result = 0
  437.             Case Else
  438.                 $result = 1
  439.         EndSwitch
  440.     EndIf
  441.     EnableGUI()
  442.  
  443.     Return $result
  444. EndFunc
  445.  
  446. Func RunSelfUpdate( $strproxy )
  447.     If $strproxy = '' Then
  448.         Run( @ComSpec & ' /D /C UpdateOU.cmd /restartgenerator' , @ScriptDir & '\cmd\' , @SW_SHOW )
  449.     Else
  450.         Run( @ComSpec & ' /D /C UpdateOU.cmd /restartgenerator /proxy ' & $strproxy , @ScriptDir & '\cmd\' , @SW_SHOW )
  451.     EndIf
  452.  
  453.     Return 0
  454. EndFunc
  455.  
  456. Func RunDownloadScript( $stroptions , $strswitches )
  457.     Local $result
  458.  
  459.     If IsCheckBoxChecked( $scripting ) Then
  460.         If $runany Then
  461.             $result = FileOpen( @ScriptDir & '\cmd\custom\' & $runAllFile , 1 )
  462.         Else
  463.             $result = FileOpen( @ScriptDir & '\cmd\custom\' & $runAllFile , 2 )
  464.         EndIf
  465.         If $result = -1 Then
  466.             If ShowGUIInGerman() Then
  467.                 $sMsgBoxTitle = 'Fehler'
  468.                 $sMsgBoxText  = 'Fehler beim Öffnen der Datei "'
  469.             Else
  470.                 $sMsgBoxTitle = 'Error'
  471.                 $sMsgBoxText  = 'Error opening file "'
  472.             EndIf
  473.             MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText & @ScriptDir & '\cmd\custom\' & $runAllFile & '".' )
  474.             Return $result
  475.         EndIf
  476.         FileWrite( $result , '@pushd ..' & @CRLF & 'call .\DownloadUpdates.cmd ' & $stroptions & $strswitches & @CRLF & '@popd' )
  477.         FileClose( $result )
  478.         $runany = True
  479.  
  480.         Return 0
  481.     EndIf
  482.  
  483.     WinSetTitle( $maindlg , $maindlg , $caption & ( ShowGUIInGerman() ? ' - Lade Updates für ' : ' - Downloading updates for ' ) & $stroptions & '...' )
  484.     DisableGUI()
  485.     If IniRead( $inifilename , $ini_section_misc , $misc_token_minimize , $disabled ) = $enabled Then
  486.       $result = RunWait( @ComSpec & ' /D /C DownloadUpdates.cmd ' & $stroptions & $strswitches , @ScriptDir & '\cmd\' , @SW_SHOWMINNOACTIVE )
  487.     Else
  488.       $result = RunWait( @ComSpec & ' /D /C DownloadUpdates.cmd ' & $stroptions & $strswitches , @ScriptDir & '\cmd\' , @SW_SHOW )
  489.     EndIf
  490.     If $result = 0 Then $result = @error
  491.     If $result = 0 Then
  492.         $runany = True
  493.         GUICtrlSetData( $buildlbl , ( ShowGUIInGerman() ? 'Letzter Download: ' : 'Last download: ' ) & LastDownloadRun())
  494.     Else
  495.         WinSetState( $maindlg , $maindlg , @SW_RESTORE )
  496.         If ShowGUIInGerman() Then
  497.             $sMsgBoxTitle = 'Fehler'
  498.             $sMsgBoxText  = 'Fehler beim Herunterladen / Verifizieren der Updates für ' & $stroptions & '.' & @LF & _
  499.                                  'Möchten Sie nun die Protokolldatei ansehen?'
  500.         Else
  501.             $sMsgBoxTitle = 'Error'
  502.             $sMsgBoxText  = 'Error downloading / verifying updates for ' & $stroptions & '.' & @LF & _
  503.                                  'Would you like to view the log file now?'
  504.         EndIf
  505.         If MsgBox( 0x2014 , $sMsgBoxTitle , $sMsgBoxText ) = $msgbox_btn_yes Then ShowLogFile()
  506.     EndIf
  507.     WinSetTitle( $maindlg , $maindlg , $title )
  508.     EnableGUI()
  509.  
  510.     Return $result
  511. EndFunc
  512.  
  513. Func RunISOCreationScript( $stroptions , $strswitches )
  514.     Local $result
  515.  
  516.     If IsCheckBoxChecked( $scripting ) Then
  517.         If $runany Then
  518.             $result = FileOpen( @ScriptDir & '\cmd\custom\' & $runAllFile , 1 )
  519.         Else
  520.             $result = FileOpen( @ScriptDir & '\cmd\custom\' & $runAllFile , 2 )
  521.         EndIf
  522.         If $result = -1 Then
  523.             If ShowGUIInGerman() Then
  524.                 $sMsgBoxTitle = 'Fehler'
  525.                 $sMsgBoxText  = 'Fehler beim Öffnen der Datei "'
  526.             Else
  527.                 $sMsgBoxTitle = 'Error'
  528.                 $sMsgBoxText  = 'Error opening file "'
  529.             EndIf
  530.             MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText & @ScriptDir & '\cmd\custom\' & $runAllFile & '".' )
  531.             Return $result
  532.         EndIf
  533.         FileWrite( $result , '@pushd ..' & @CRLF & 'call .\CreateISOImage.cmd ' & $stroptions & $strswitches & @CRLF & '@popd' )
  534.         FileClose( $result )
  535.         $runany = True
  536.  
  537.         Return 0
  538.     EndIf
  539.  
  540.     WinSetTitle( $maindlg , $maindlg , $caption & ( ShowGUIInGerman() ? ' - Erstelle ISO-Image für ' : ' - Creating ISO image for ' ) & $stroptions & '...' )
  541.     DisableGUI()
  542.     If IniRead( $inifilename , $ini_section_misc , $misc_token_minimize , $disabled ) = $enabled Then
  543.         $result = RunWait( @ComSpec & ' /D /C CreateISOImage.cmd ' & $stroptions & $strswitches , @ScriptDir & '\cmd\' , @SW_SHOWMINNOACTIVE )
  544.     Else
  545.         $result = RunWait( @ComSpec & ' /D /C CreateISOImage.cmd ' & $stroptions & $strswitches , @ScriptDir & '\cmd\' , @SW_SHOW )
  546.     EndIf
  547.     If $result = 0 Then $result = @error
  548.     If $result = 0 Then
  549.         $runany = True
  550.     Else
  551.         WinSetState( $maindlg , $maindlg , @SW_RESTORE )
  552.         If ShowGUIInGerman() Then
  553.             $sMsgBoxTitle = 'Fehler'
  554.             $sMsgBoxText  = 'Fehler beim Erstellen des ISO-Images für ' & $stroptions & '.'
  555.         Else
  556.             $sMsgBoxTitle = 'Error'
  557.             $sMsgBoxText  = 'Error creating ISO image for ' & $stroptions & '.'
  558.         EndIf
  559.         MsgBox( 0x2014 , $sMsgBoxTitle , $sMsgBoxText )
  560.     EndIf
  561.     WinSetTitle( $maindlg , $maindlg , $title )
  562.     EnableGUI()
  563.  
  564.     Return $result
  565. EndFunc
  566.  
  567. Func RunUSBCreationScript( $stroptions , $strswitches , $strpath )
  568.     Local $result , $sMsgBoxTitle , $sMsgBoxText
  569.  
  570.     If IsCheckBoxChecked( $scripting ) Then
  571.         If $runany Then
  572.             $result = FileOpen( @ScriptDir & '\cmd\custom\' & $runAllFile , 1 )
  573.         Else
  574.             $result = FileOpen( @ScriptDir & '\cmd\custom\' & $runAllFile , 2 )
  575.         EndIf
  576.         If $result = -1 Then
  577.             If ShowGUIInGerman() Then
  578.                 $sMsgBoxTitle = 'Fehler'
  579.                 $sMsgBoxText  = 'Fehler beim Öffnen der Datei "'
  580.             Else
  581.                 $sMsgBoxTitle = 'Error'
  582.                 $sMsgBoxText  = 'Error opening file "'
  583.             EndIf
  584.             MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText & @ScriptDir & '\cmd\custom\' & $runAllFile & '".' )
  585.             Return $result
  586.         EndIf
  587.         FileWrite( $result , '@pushd ..' & @CRLF & 'call .\CopyToTarget.cmd ' & $stroptions & ' "' & $strpath & '"' & $strswitches & @CRLF & '@popd' )
  588.         FileClose( $result )
  589.         $runany = True
  590.  
  591.         Return 0
  592.     EndIf
  593.  
  594.     $result = 0
  595.     If NOT FileExists( $strpath ) Then
  596.         If ShowGUIInGerman() Then
  597.             $sMsgBoxTitle = 'Warnung'
  598.             $sMsgBoxText  = 'Das Zielverzeichnis "' & $strpath & '" existiert nicht.'
  599.         Else
  600.             $sMsgBoxTitle = 'Warning'
  601.             $sMsgBoxText  = 'The target directory "' & $strpath & '" does not exist.'
  602.         EndIf
  603.         MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText )
  604.         Return $result
  605.     EndIf
  606.     WinSetTitle( $maindlg , $maindlg , $caption & ( ShowGUIInGerman() ? ' - Kopiere Dateien für ' : ' - Copying files for ' ) & $stroptions & '...' )
  607.     DisableGUI()
  608.     If IniRead( $inifilename , $ini_section_misc , $misc_token_minimize , $disabled ) = $enabled Then
  609.         $result = RunWait( @ComSpec & ' /D /C CopyToTarget.cmd ' & $stroptions & ' "' & $strpath & '"' & $strswitches , @ScriptDir & '\cmd\' , @SW_SHOWMINNOACTIVE )
  610.     Else
  611.         $result = RunWait( @ComSpec & ' /D /C CopyToTarget.cmd ' & $stroptions & ' "' & $strpath & '"' & $strswitches , @ScriptDir & '\cmd\' , @SW_SHOW )
  612.     EndIf
  613.     If $result = 0 Then $result = @error
  614.     If $result = 0 Then
  615.         $runany = True
  616.     Else
  617.         WinSetState( $maindlg , $maindlg , @SW_RESTORE )
  618.         If ShowGUIInGerman() Then
  619.             $sMsgBoxTitle = 'Fehler'
  620.             $sMsgBoxText  = 'Fehler beim Kopieren der Dateien für ' & $stroptions & '.'
  621.         Else
  622.             $sMsgBoxTitle = 'Error'
  623.             $sMsgBoxText  = 'Error copying files for ' & $stroptions & '.'
  624.         EndIf
  625.         MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText )
  626.     EndIf
  627.     WinSetTitle( $maindlg , $maindlg , $title )
  628.     EnableGUI()
  629.  
  630.     Return $result
  631. EndFunc
  632.  
  633. Func RunScripts( $stroptions , $skipdl , $strdownloadswitches , $runiso , $strisoswitches , $runusb , $strusbpath )
  634.     Local $result
  635.  
  636.     If $skipdl Then
  637.         $result = 0
  638.     Else
  639.         $result = RunDownloadScript( $stroptions , $strdownloadswitches )
  640.     EndIf
  641.     If $result = 0 AND $runiso Then
  642.         $result = RunISOCreationScript( $stroptions , $strisoswitches )
  643.     EndIf
  644.     If $result = 0 AND $runusb AND FileExists( $strusbpath ) Then
  645.         $result = RunUSBCreationScript( $stroptions , $strisoswitches , $strusbpath )
  646.     EndIf
  647.  
  648.     Return $result
  649. EndFunc
  650.  
  651. Func SaveSettings()
  652.     Local $ii , $sOffString , $sWinString
  653.     Local $sIniString , $sCurrentVar
  654.  
  655.     ; Make Pretty INI If None Exists
  656.     If NOT FileExists( $inifilename ) Then
  657.         For $ii = 1 To $aMainArray[0][0]
  658.             If $aMainArray[$ii][0] <> '' Then
  659.                 If $aMainArray[$ii][1] <> '' Then
  660.                     Local $aSplit = StringSplit( $aMainArray[$ii][1] , '|' )
  661.                     For $jj = 1 To $aSplit[0]
  662.                         $sCurrentVar = Eval( StringReplace( 'ini section ' & $aSplit[$jj] , ' ' , '_' ))
  663.                         If StringInStr( $sWinString , $sCurrentVar ) = 0 Then $sWinString &= '[' & $sCurrentVar & ']' & @CRLF & @CRLF
  664.                     Next
  665.                 EndIf
  666.                 If $aMainArray[$ii][2] <> '' Then
  667.                     Local $aSplit = StringSplit( $aMainArray[$ii][2] , '|' )
  668.                     For $jj = 1 To $aSplit[0]
  669.                         $sCurrentVar = Eval( StringReplace( 'ini section ' & $aSplit[$jj] , ' ' , '_' ))
  670.                         If StringInStr( $sOffString , $sCurrentVar ) = 0 Then $sOffString &= '[' & $sCurrentVar & ']' & @CRLF & @CRLF
  671.                     Next
  672.                 EndIf
  673.             EndIf
  674.         Next
  675.         $sIniString &= $sWinString & $sOffString & '[ISO Images]' & @CRLF & @CRLF & '[USB Images]' & @CRLF & @CRLF & '[Options]' & @CRLF & @CRLF & '[Miscellaneous]' & @CRLF
  676.         FileWrite( $inifilename , $sIniString )
  677.     EndIf
  678.  
  679.     ; Write Windows Settings
  680.     _SaveSettingsWindowsAndOffice( 1 )
  681.  
  682.     ; Write Office Settings
  683.     _SaveSettingsWindowsAndOffice( 2 )
  684.  
  685.     ; Image Creation
  686.     IniWrite( $inifilename , $ini_section_iso , $iso_token_cd      , CheckBoxStateToString( $cdiso   ))
  687.     IniWrite( $inifilename , $ini_section_iso , $iso_token_dvd     , CheckBoxStateToString( $dvdiso  ))
  688.     IniWrite( $inifilename , $ini_section_usb , $usb_token_copy    , CheckBoxStateToString( $usbcopy ))
  689.     IniWrite( $inifilename , $ini_section_usb , $usb_token_path    , GUICtrlRead( $usbpath ))
  690.     IniWrite( $inifilename , $ini_section_usb , $usb_token_cleanup , CheckBoxStateToString( $usbclean ))
  691.  
  692.     ; Miscellaneous
  693.     IniWrite( $inifilename , $ini_section_opts , $opts_token_verify        , CheckBoxStateToString( $verifydownloads ))
  694.     IniWrite( $inifilename , $ini_section_opts , $opts_token_includesp     , CheckBoxStateToString( $includesp ))
  695.     IniWrite( $inifilename , $ini_section_opts , $opts_token_includedotnet , CheckBoxStateToString( $dotnet ))
  696.     IniWrite( $inifilename , $ini_section_opts , $opts_token_wle           , CheckBoxStateToString( $wle    ))
  697.     IniWrite( $inifilename , $ini_section_opts , $opts_token_msse          , CheckBoxStateToString( $msse   ))
  698.     IniWrite( $inifilename , $ini_section_opts , $opts_token_wddefs        , CheckBoxStateToString( $wddefs ))
  699.     IniWrite( $inifilename , $ini_section_misc , $misc_token_proxy         , $proxy )
  700.     IniWrite( $inifilename , $ini_section_misc , $misc_token_wsus          , $wsus  )
  701.  
  702.     Return 0
  703. EndFunc
  704.  
  705. Func _SaveSettingsWindowsAndOffice( $iValue )
  706.     Local $aSavSetSplit , $ii , $jj
  707.     Local $sCurrentSec  , $sCurrentKey , $sCurrentVal
  708.  
  709.     For $ii = 1 To $aMainArray[0][0]
  710.         If $aMainArray[$ii][$iValue] <> '' Then
  711.             $aSavSetSplit = StringSplit( $aMainArray[$ii][$iValue] , '|' )
  712.             For $jj = 1 To $aSavSetSplit[0]
  713.                 $sCurrentSec = StringReplace( 'ini section '           & $aSavSetSplit[$jj]  , ' ' , '_' )
  714.                 $sCurrentKey = StringReplace( 'lang token '            & $aMainArray[$ii][0] , ' ' , '_' )
  715.                 $sCurrentVal = StringReplace( $aSavSetSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  716.                 IniWrite(   $inifilename , _
  717.                                 Eval( $sCurrentSec ) , _
  718.                                 Eval( $sCurrentKey ) , _
  719.                                 CheckBoxStateToString( Eval( $sCurrentVal )))
  720.             Next
  721.         EndIf
  722.     Next
  723. EndFunc
  724.  
  725. Func CalcGUISize()
  726.     Local $reg_val
  727.  
  728.     If StringInStr( 'WIN_VISTA|WIN_2008|WIN_7|WIN_2008R2|WIN_8|WIN_2012|WIN_81|WIN_2012R2' , @OSVersion ) > 0 Then
  729.         DllCall( 'user32.dll' , 'int' , 'SetProcessDPIAware' )
  730.     EndIf
  731.     $reg_val = RegRead( $reg_key_hkcu_winmetrics , $reg_val_applieddpi )
  732.     If $reg_val = '' Then
  733.         $reg_val = RegRead( $reg_key_hkcu_desktop , $reg_val_logpixels )
  734.     EndIf
  735.     If $reg_val = '' Then $reg_val = $default_logpixels
  736.     $dlgheight  = 520 * $reg_val / $default_logpixels
  737.     If ShowGUIInGerman() Then
  738.         $txtwidth = 90 * $reg_val / $default_logpixels
  739.     Else
  740.         $txtwidth = 80 * $reg_val / $default_logpixels
  741.     EndIf
  742.     $txtheight   = 20 * $reg_val / $default_logpixels
  743.     $slimheight  = 15 * $reg_val / $default_logpixels
  744.     $btnwidth    = 80 * $reg_val / $default_logpixels
  745.     $btnheight   = 30 * $reg_val / $default_logpixels
  746.     $txtxoffset  = 10 * $reg_val / $default_logpixels
  747.     $txtyoffset  = 10 * $reg_val / $default_logpixels
  748.  
  749.     Return 0
  750. EndFunc
  751.  
  752. ; Main Dialog
  753. CalcGUISize()
  754. $groupwidth = 8 * $txtwidth + 2 * $txtxoffset
  755. $groupheight_lng = 4 * $txtheight
  756. $groupheight_glb = 2 * $txtheight
  757. $maindlg = GUICreate( $title , $groupwidth + 4 * $txtxoffset , $dlgheight )
  758. GUISetFont( 8.5 , 400 , 0 , 'Sans Serif' )
  759. If $CmdLine[0] > 0 AND StringRight( $CmdLine[$CmdLine[0]] , 4 ) = '.ini' Then
  760.     $inifilename = $CmdLine[$CmdLine[0]]
  761. Else
  762.     $inifilename = StringLeft( @ScriptFullPath , StringInStr( @ScriptFullPath , '.' , 0 , -1 )) & 'ini'
  763. EndIf
  764.  
  765. ; Label
  766. $txtxpos = $txtxoffset
  767. $txtypos = $txtyoffset
  768. GUICtrlCreateLabel( ShowGUIInGerman() ? 'Lade Microsoft-Updates für...' : 'Download Microsoft Updates for...' , _
  769.                 $txtxpos , $txtypos , 3 * $groupwidth / 4 , $txtheight )
  770.  
  771. ; ==========================================
  772. ; == Medium Info Group
  773. ; ==========================================
  774. $txtxpos = $txtxoffset + 3 * $groupwidth / 4
  775. $txtypos = 0
  776. GUICtrlCreateGroup( ShowGUIInGerman() ? 'Repository-Info' : 'Repository info' , _
  777.                 $txtxpos , $txtypos , $groupwidth / 4 + 2 * $txtxoffset , 2 * $txtheight )
  778. $txtypos  = $txtypos + 1.5 * $txtyoffset + 2
  779. $txtxpos  = $txtxpos + $txtxoffset
  780. $buildlbl = GUICtrlCreateLabel(( ShowGUIInGerman() ? 'Letzter Download: ' : 'Last download: ' ) & LastDownloadRun() , _
  781.                 $txtxpos , $txtypos , $groupwidth / 4 , $txtheight )
  782.  
  783. ; Tab control
  784. $txtypos = $txtyoffset + $txtheight
  785. $txtxpos = $txtxoffset
  786. GuiCtrlCreateTab( $txtxpos , $txtypos , $groupwidth + 2 * $txtxoffset , $groupheight_lng + 4 * $groupheight_glb + 3.5 * $txtyoffset )
  787.  
  788. ;   ////////////////////////////////////////
  789. ;  ///  Operating Systems' Tab
  790. ; ////////////////////////////////////////
  791. #Region
  792. $tabitemfocused = GuiCtrlCreateTabItem( 'Windows' )
  793.  
  794.  
  795. ; ==========================================
  796. ; == Windows Vista / Server 2008 Group
  797. ; ==========================================
  798. $txtypos = 3.5 * $txtyoffset + $txtheight
  799. $txtxpos = 2 * $txtxoffset
  800. GUICtrlCreateGroup( 'Windows Vista / Server 2008 (w60 / w60-x64)' , $txtxpos , $txtypos , $groupwidth , $groupheight_glb )
  801.  
  802. ; Windows Vista / Server 2008 Global
  803. $txtypos = $txtypos + 1.5 * $txtyoffset
  804. $txtxpos = 3 * $txtxoffset
  805. $w60_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  806.  
  807. ; Windows Vista / Server 2008 x64 Global
  808. $txtxpos     = $txtxpos + $groupwidth / 2 - $txtxoffset
  809. $w60_x64_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  810.  
  811. ; ==========================================
  812. ; == Windows 7 / Server 2008 R2 Group
  813. ; ==========================================
  814. $txtypos = $txtypos + 2.5 * $txtyoffset
  815. $txtxpos = 2 * $txtxoffset
  816. GUICtrlCreateGroup( 'Windows 7 / Server 2008 R2 (w61 / w61-x64)' , $txtxpos , $txtypos , $groupwidth , $groupheight_glb )
  817.  
  818. ; Windows 7 Global
  819. $txtypos = $txtypos + 1.5 * $txtyoffset
  820. $txtxpos = 3 * $txtxoffset
  821. $w61_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  822.  
  823. ; Windows 7 / Server 2008 R2 x64 Global
  824. $txtxpos     = $txtxpos + $groupwidth / 2 - $txtxoffset
  825. $w61_x64_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  826.  
  827. ; ==========================================
  828. ; == Windows 8 / Server 2012 Group
  829. ; ==========================================
  830. $txtypos = $txtypos + 2.5 * $txtyoffset
  831. $txtxpos = 2 * $txtxoffset
  832. GUICtrlCreateGroup( 'Windows 8 / Server 2012 (w62 / w62-x64)' , $txtxpos , $txtypos , $groupwidth , $groupheight_glb )
  833.  
  834. ; Windows 8 Global
  835. $txtypos = $txtypos + 1.5 * $txtyoffset
  836. $txtxpos = 3 * $txtxoffset
  837. $w62_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  838.  
  839. ; Windows 8 / Server 2012 x64 Global
  840. $txtxpos     = $txtxpos + $groupwidth / 2 - $txtxoffset
  841. $w62_x64_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  842.  
  843. ; ==========================================
  844. ; == Windows 8.1 / Server 2012 R2 Group
  845. ; ==========================================
  846. $txtypos = $txtypos + 2.5 * $txtyoffset
  847. $txtxpos = 2 * $txtxoffset
  848. GUICtrlCreateGroup( 'Windows 8.1 / Server 2012 R2 (w63 / w63-x64)' , $txtxpos , $txtypos , $groupwidth , $groupheight_glb )
  849.  
  850. ; Windows 8.1 Global
  851. $txtypos = $txtypos + 1.5 * $txtyoffset
  852. $txtxpos = 3 * $txtxoffset
  853. $w63_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  854.  
  855. ; Windows 8.1 / Server 2012 R2 x64 Global
  856. $txtxpos     = $txtxpos + $groupwidth / 2 - $txtxoffset
  857. $w63_x64_glb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $groupwidth / 2 - $txtxoffset , $txtheight )
  858. #EndRegion
  859.  
  860. ;   ////////////////////////////////////////
  861. ;  ///  Office Suites' Tab
  862. ; ////////////////////////////////////////
  863. #Region
  864. GuiCtrlCreateTabItem( 'Office' )
  865.  
  866. ; ==========================================
  867. ; == Office 2007 Group
  868. ; ==========================================
  869. #Region
  870. $txtypos = 3.5 * $txtyoffset + $txtheight
  871. $txtxpos = 2 * $txtxoffset
  872. GUICtrlCreateGroup( 'Office 2007 (o2k7)' , $txtxpos , $txtypos , $groupwidth , $groupheight_lng )
  873.  
  874. ; Office 2007 English
  875. $txtypos  = $txtypos + 1.5 * $txtyoffset
  876. $txtxpos  = 3 * $txtxoffset
  877. $o2k7_enu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  878.  
  879. ; Office 2007 French
  880. $txtxpos  = $txtxpos + $txtwidth - 5
  881. $o2k7_fra = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  882.  
  883. ; Office 2007 Spanish
  884. $txtxpos  = $txtxpos + $txtwidth + 10
  885. $o2k7_esn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  886.  
  887. ; Office 2007 Japanese
  888. $txtxpos  = $txtxpos + $txtwidth - 5
  889. $o2k7_jpn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  890.  
  891. ; Office 2007 Korean
  892. $txtxpos  = $txtxpos + $txtwidth
  893. $o2k7_kor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  894.  
  895. ; Office 2007 Russian
  896. $txtxpos  = $txtxpos + $txtwidth + 5
  897. $o2k7_rus = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  898.  
  899. ; Office 2007 Portuguese
  900. $txtxpos  = $txtxpos + $txtwidth - 10
  901. $o2k7_ptg = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  902.  
  903. ; Office 2007 Brazilian
  904. $txtxpos  = $txtxpos + $txtwidth + 5
  905. $o2k7_ptb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  906.  
  907. ; Office 2007 German
  908. $txtypos  = $txtypos + $txtheight
  909. $txtxpos  = 3 * $txtxoffset
  910. $o2k7_deu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  911.  
  912. ; Office 2007 Dutch
  913. $txtxpos  = $txtxpos + $txtwidth - 5
  914. $o2k7_nld = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  915.  
  916. ; Office 2007 Italian
  917. $txtxpos  = $txtxpos + $txtwidth + 10
  918. $o2k7_ita = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  919.  
  920. ; Office 2007 Chinese Simplified
  921. $txtxpos  = $txtxpos + $txtwidth - 5
  922. $o2k7_chs = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  923.  
  924. ; Office 2007 Chinese Traditional
  925. $txtxpos  = $txtxpos + $txtwidth
  926. $o2k7_cht = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  927.  
  928. ; Office 2007 Polish
  929. $txtxpos  = $txtxpos + $txtwidth + 5
  930. $o2k7_plk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  931.  
  932. ; Office 2007 Hungarian
  933. $txtxpos  = $txtxpos + $txtwidth - 10
  934. $o2k7_hun = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  935.  
  936. ; Office 2007 Czech
  937. $txtxpos  = $txtxpos + $txtwidth + 5
  938. $o2k7_csy = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  939.  
  940. ; Office 2007 Swedish
  941. $txtypos  = $txtypos + $txtheight
  942. $txtxpos  = 3 * $txtxoffset
  943. $o2k7_sve = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  944.  
  945. ; Office 2007 Turkish
  946. $txtxpos  = $txtxpos + $txtwidth - 5
  947. $o2k7_trk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  948.  
  949. ; Office 2007 Greek
  950. $txtxpos  = $txtxpos + $txtwidth + 10
  951. $o2k7_ell = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  952.  
  953. ; Office 2007 Arabic
  954. $txtxpos  = $txtxpos + $txtwidth - 5
  955. $o2k7_ara = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  956.  
  957. ; Office 2007 Hebrew
  958. $txtxpos  = $txtxpos + $txtwidth
  959. $o2k7_heb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  960.  
  961. ; Office 2007 Danish
  962. $txtxpos  = $txtxpos + $txtwidth + 5
  963. $o2k7_dan = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  964.  
  965. ; Office 2007 Norwegian
  966. $txtxpos  = $txtxpos + $txtwidth - 10
  967. $o2k7_nor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  968.  
  969. ; Office 2007 Finnish
  970. $txtxpos  = $txtxpos + $txtwidth + 5
  971. $o2k7_fin = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  972. #EndRegion
  973.  
  974. ; ==========================================
  975. ; == Office 2010 Group
  976. ; ==========================================
  977. #Region
  978. $txtypos = $txtypos + 2.5 * $txtyoffset
  979. $txtxpos = 2 * $txtxoffset
  980. GUICtrlCreateGroup( 'Office 2010 (o2k10)' , $txtxpos , $txtypos , $groupwidth , $groupheight_lng )
  981.  
  982. ; Office 2010 English
  983. $txtypos   = $txtypos + 1.5 * $txtyoffset
  984. $txtxpos   = 3 * $txtxoffset
  985. $o2k10_enu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  986.  
  987. ; Office 2010 French
  988. $txtxpos   = $txtxpos + $txtwidth - 5
  989. $o2k10_fra = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  990.  
  991. ; Office 2010 Spanish
  992. $txtxpos   = $txtxpos + $txtwidth + 10
  993. $o2k10_esn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  994.  
  995. ; Office 2010 Japanese
  996. $txtxpos   = $txtxpos + $txtwidth - 5
  997. $o2k10_jpn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  998.  
  999. ; Office 2010 Korean
  1000. $txtxpos   = $txtxpos + $txtwidth
  1001. $o2k10_kor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1002.  
  1003. ; Office 2010 Russian
  1004. $txtxpos   = $txtxpos + $txtwidth + 5
  1005. $o2k10_rus = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1006.  
  1007. ; Office 2010 Portuguese
  1008. $txtxpos   = $txtxpos + $txtwidth - 10
  1009. $o2k10_ptg = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1010.  
  1011. ; Office 2010 Brazilian
  1012. $txtxpos   = $txtxpos + $txtwidth + 5
  1013. $o2k10_ptb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1014.  
  1015. ; Office 2010 German
  1016. $txtypos   = $txtypos + $txtheight
  1017. $txtxpos   = 3 * $txtxoffset
  1018. $o2k10_deu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1019.  
  1020. ; Office 2010 Dutch
  1021. $txtxpos   = $txtxpos + $txtwidth - 5
  1022. $o2k10_nld = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1023.  
  1024. ; Office 2010 Italian
  1025. $txtxpos   = $txtxpos + $txtwidth + 10
  1026. $o2k10_ita = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1027.  
  1028. ; Office 2010 Chinese simplified
  1029. $txtxpos   = $txtxpos + $txtwidth - 5
  1030. $o2k10_chs = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1031.  
  1032. ; Office 2010 Chinese traditional
  1033. $txtxpos   = $txtxpos + $txtwidth
  1034. $o2k10_cht = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1035.  
  1036. ; Office 2010 Polish
  1037. $txtxpos   = $txtxpos + $txtwidth + 5
  1038. $o2k10_plk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1039.  
  1040. ; Office 2010 Hungarian
  1041. $txtxpos   = $txtxpos + $txtwidth - 10
  1042. $o2k10_hun = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1043.  
  1044. ; Office 2010 Czech
  1045. $txtxpos   = $txtxpos + $txtwidth + 5
  1046. $o2k10_csy = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1047.  
  1048. ; Office 2010 Swedish
  1049. $txtypos   = $txtypos + $txtheight
  1050. $txtxpos   = 3 * $txtxoffset
  1051. $o2k10_sve = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1052.  
  1053. ; Office 2010 Turkish
  1054. $txtxpos   = $txtxpos + $txtwidth - 5
  1055. $o2k10_trk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1056.  
  1057. ; Office 2010 Greek
  1058. $txtxpos   = $txtxpos + $txtwidth + 10
  1059. $o2k10_ell = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1060.  
  1061. ; Office 2010 Arabic
  1062. $txtxpos   = $txtxpos + $txtwidth - 5
  1063. $o2k10_ara = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1064.  
  1065. ; Office 2010 Hebrew
  1066. $txtxpos   = $txtxpos + $txtwidth
  1067. $o2k10_heb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1068.  
  1069. ; Office 2010 Danish
  1070. $txtxpos   = $txtxpos + $txtwidth + 5
  1071. $o2k10_dan = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1072.  
  1073. ; Office 2010 Norwegian
  1074. $txtxpos   = $txtxpos + $txtwidth - 10
  1075. $o2k10_nor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1076.  
  1077. ; Office 2010 Finnish
  1078. $txtxpos   = $txtxpos + $txtwidth + 5
  1079. $o2k10_fin = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1080. #EndRegion
  1081.  
  1082. ; ==========================================
  1083. ; == Office 2013 Group
  1084. ; ==========================================
  1085. #Region
  1086. $txtxpos = 2 * $txtxoffset
  1087. $txtypos = $txtypos + 2.5 * $txtyoffset
  1088. GUICtrlCreateGroup( 'Office 2013 (o2k13)' , $txtxpos , $txtypos , $groupwidth , $groupheight_lng )
  1089.  
  1090. ; Office 2013 English
  1091. $txtypos   = $txtypos + 1.5 * $txtyoffset
  1092. $txtxpos   = 3 * $txtxoffset
  1093. $o2k13_enu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1094.  
  1095. ; Office 2013 French
  1096. $txtxpos   = $txtxpos + $txtwidth - 5
  1097. $o2k13_fra = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1098.  
  1099. ; Office 2013 Spanish
  1100. $txtxpos   = $txtxpos + $txtwidth + 10
  1101. $o2k13_esn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1102.  
  1103. ; Office 2013 Japanese
  1104. $txtxpos   = $txtxpos + $txtwidth - 5
  1105. $o2k13_jpn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1106.  
  1107. ; Office 2013 Korean
  1108. $txtxpos   = $txtxpos + $txtwidth
  1109. $o2k13_kor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1110.  
  1111. ; Office 2013 Russian
  1112. $txtxpos   = $txtxpos + $txtwidth + 5
  1113. $o2k13_rus = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1114.  
  1115. ; Office 2013 Portuguese
  1116. $txtxpos   = $txtxpos + $txtwidth - 10
  1117. $o2k13_ptg = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1118.  
  1119. ; Office 2013 Brazilian
  1120. $txtxpos   = $txtxpos + $txtwidth + 5
  1121. $o2k13_ptb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1122.  
  1123. ; Office 2013 German
  1124. $txtypos   = $txtypos + $txtheight
  1125. $txtxpos   = 3 * $txtxoffset
  1126. $o2k13_deu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1127.  
  1128. ; Office 2013 Dutch
  1129. $txtxpos   = $txtxpos + $txtwidth - 5
  1130. $o2k13_nld = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1131.  
  1132. ; Office 2013 Italian
  1133. $txtxpos   = $txtxpos + $txtwidth + 10
  1134. $o2k13_ita = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1135.  
  1136. ; Office 2013 Chinese simplified
  1137. $txtxpos   = $txtxpos + $txtwidth - 5
  1138. $o2k13_chs = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1139.  
  1140. ; Office 2013 Chinese traditional
  1141. $txtxpos   = $txtxpos + $txtwidth
  1142. $o2k13_cht = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1143.  
  1144. ; Office 2013 Polish
  1145. $txtxpos   = $txtxpos + $txtwidth + 5
  1146. $o2k13_plk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1147.  
  1148. ; Office 2013 Hungarian
  1149. $txtxpos   = $txtxpos + $txtwidth - 10
  1150. $o2k13_hun = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1151.  
  1152. ; Office 2013 Czech
  1153. $txtxpos   = $txtxpos + $txtwidth + 5
  1154. $o2k13_csy = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1155.  
  1156. ; Office 2013 Swedish
  1157. $txtypos   = $txtypos + $txtheight
  1158. $txtxpos   = 3 * $txtxoffset
  1159. $o2k13_sve = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1160.  
  1161. ; Office 2013 Turkish
  1162. $txtxpos   = $txtxpos + $txtwidth - 5
  1163. $o2k13_trk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1164.  
  1165. ; Office 2013 Greek
  1166. $txtxpos   = $txtxpos + $txtwidth + 10
  1167. $o2k13_ell = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1168.  
  1169. ; Office 2013 Arabic
  1170. $txtxpos   = $txtxpos + $txtwidth - 5
  1171. $o2k13_ara = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1172.  
  1173. ; Office 2013 Hebrew
  1174. $txtxpos   = $txtxpos + $txtwidth
  1175. $o2k13_heb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1176.  
  1177. ; Office 2013 Danish
  1178. $txtxpos   = $txtxpos + $txtwidth + 5
  1179. $o2k13_dan = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1180.  
  1181. ; Office 2013 Norwegian
  1182. $txtxpos   = $txtxpos + $txtwidth - 10
  1183. $o2k13_nor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1184.  
  1185. ; Office 2013 Finnish
  1186. $txtxpos   = $txtxpos + $txtwidth + 5
  1187. $o2k13_fin = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1188. #EndRegion
  1189. #EndRegion
  1190.  
  1191. ;   ////////////////////////////////////////
  1192. ;  ///  Legacy products Tab
  1193. ; ////////////////////////////////////////
  1194. #Region
  1195. GuiCtrlCreateTabItem( ShowGUIInGerman() ? 'Altprodukte' : 'Legacy Products' )
  1196.  
  1197. ; ==========================================
  1198. ; == Windows Server 2003 Group
  1199. ; ==========================================
  1200. #Region
  1201. $txtypos = 3.5 * $txtyoffset + $txtheight
  1202. $txtxpos = 2 * $txtxoffset
  1203. GUICtrlCreateGroup( 'Windows Server 2003 (w2k3)' , $txtxpos , $txtypos , $groupwidth , $groupheight_lng )
  1204.  
  1205. ; Windows Server 2003 English
  1206. $txtypos  = $txtypos + 1.5 * $txtyoffset
  1207. $txtxpos  = 3 * $txtxoffset
  1208. $w2k3_enu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1209.  
  1210. ; Windows Server 2003 French
  1211. $txtxpos  = $txtxpos + $txtwidth - 5
  1212. $w2k3_fra = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1213.  
  1214. ; Windows Server 2003 Spanish
  1215. $txtxpos  = $txtxpos + $txtwidth + 10
  1216. $w2k3_esn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1217.  
  1218. ; Windows Server 2003 Japanese
  1219. $txtxpos  = $txtxpos + $txtwidth - 5
  1220. $w2k3_jpn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1221.  
  1222. ; Windows Server 2003 Korean
  1223. $txtxpos  = $txtxpos + $txtwidth
  1224. $w2k3_kor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1225.  
  1226. ; Windows Server 2003 Russian
  1227. $txtxpos  = $txtxpos + $txtwidth + 5
  1228. $w2k3_rus = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1229.  
  1230. ; Windows Server 2003 Portuguese
  1231. $txtxpos  = $txtxpos + $txtwidth - 10
  1232. $w2k3_ptg = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1233.  
  1234. ; Windows Server 2003 Brazilian
  1235. $txtxpos  = $txtxpos + $txtwidth + 5
  1236. $w2k3_ptb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1237.  
  1238. ; Windows Server 2003 German
  1239. $txtypos  = $txtypos + $txtheight
  1240. $txtxpos  = 3 * $txtxoffset
  1241. $w2k3_deu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1242.  
  1243. ; Windows Server 2003 Dutch
  1244. $txtxpos  = $txtxpos + $txtwidth - 5
  1245. $w2k3_nld = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1246.  
  1247. ; Windows Server 2003 Italian
  1248. $txtxpos  = $txtxpos + $txtwidth + 10
  1249. $w2k3_ita = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1250.  
  1251. ; Windows Server 2003 Chinese Simplified
  1252. $txtxpos  = $txtxpos + $txtwidth - 5
  1253. $w2k3_chs = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1254.  
  1255. ; Windows Server 2003 Chinese Traditional
  1256. $txtxpos  = $txtxpos + $txtwidth
  1257. $w2k3_cht = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1258.  
  1259. ; Windows Server 2003 Polish
  1260. $txtxpos  = $txtxpos + $txtwidth + 5
  1261. $w2k3_plk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1262.  
  1263. ; Windows Server 2003 Hungarian
  1264. $txtxpos  = $txtxpos + $txtwidth - 10
  1265. $w2k3_hun = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1266.  
  1267. ; Windows Server 2003 Czech
  1268. $txtxpos  = $txtxpos + $txtwidth + 5
  1269. $w2k3_csy = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1270.  
  1271. ; Windows Server 2003 Swedish
  1272. $txtypos  = $txtypos + $txtheight
  1273. $txtxpos  = 3 * $txtxoffset
  1274. $w2k3_sve = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1275.  
  1276. ; Windows Server 2003 Turkish
  1277. $txtxpos  = $txtxpos + $txtwidth - 5
  1278. $w2k3_trk = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1279.  
  1280. ; Windows Server 2003 Greek
  1281. $txtxpos  = $txtxpos + $txtwidth + 10
  1282. $w2k3_ell = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1283.  
  1284. ; Windows Server 2003 Arabic
  1285. $txtxpos  = $txtxpos + $txtwidth - 5
  1286. $w2k3_ara = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1287.  
  1288. ; Windows Server 2003 Hebrew
  1289. $txtxpos  = $txtxpos + $txtwidth
  1290. $w2k3_heb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1291.  
  1292. ; Windows Server 2003 Danish
  1293. $txtxpos  = $txtxpos + $txtwidth + 5
  1294. $w2k3_dan = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1295.  
  1296. ; Windows Server 2003 Norwegian
  1297. $txtxpos  = $txtxpos + $txtwidth - 10
  1298. $w2k3_nor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1299.  
  1300. ; Windows Server 2003 Finnish
  1301. $txtxpos  = $txtxpos + $txtwidth + 5
  1302. $w2k3_fin = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1303. #EndRegion
  1304.  
  1305. ; ==========================================
  1306. ; == Windows Server 2003 x64 Group
  1307. ; ==========================================
  1308. #Region
  1309. $txtxpos = 2 * $txtxoffset
  1310. $txtypos = $txtypos + 2.5 * $txtyoffset
  1311. GUICtrlCreateGroup( ShowGUIInGerman() ? 'Windows Server 2003 x64-Editionen (w2k3-x64)' : 'Windows Server 2003 x64 editions (w2k3-x64)' , _
  1312.                 $txtxpos , $txtypos , $groupwidth , $groupheight_glb )
  1313.  
  1314. ; Windows Server 2003 x64 English
  1315. $txtypos      = $txtypos + 1.5 * $txtyoffset
  1316. $txtxpos      = 3 * $txtxoffset
  1317. $w2k3_x64_enu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1318.  
  1319. ; Windows Server 2003 x64 French
  1320. $txtxpos      = $txtxpos + $txtwidth - 5
  1321. $w2k3_x64_fra = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 10 , $txtheight )
  1322.  
  1323. ; Windows Server 2003 x64 Spanish
  1324. $txtxpos      = $txtxpos + $txtwidth + 10
  1325. $w2k3_x64_esn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 5 , $txtheight )
  1326.  
  1327. ; Windows Server 2003 x64 Japanese
  1328. $txtxpos      = $txtxpos + $txtwidth - 5
  1329. $w2k3_x64_jpn = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1330.  
  1331. ; Windows Server 2003 x64 Korean
  1332. $txtxpos      = $txtxpos + $txtwidth
  1333. $w2k3_x64_kor = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1334.  
  1335. ; Windows Server 2003 x64 Russian
  1336. $txtxpos      = $txtxpos + $txtwidth + 5
  1337. $w2k3_x64_rus = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth - 10 , $txtheight )
  1338.  
  1339. ; Windows Server 2003 x64 Brazilian
  1340. $txtxpos      = $txtxpos + $txtwidth - 10
  1341. $w2k3_x64_ptb = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth + 5 , $txtheight )
  1342.  
  1343. ; Windows Server 2003 x64 German
  1344. $txtxpos      = $txtxpos + $txtwidth + 5
  1345. $w2k3_x64_deu = GUICtrlCreateCheckbox( '' , $txtxpos , $txtypos , $txtwidth , $txtheight )
  1346. #EndRegion
  1347.  
  1348. ; ==========================================
  1349. ; == Product Lifecycle Group
  1350. ; ==========================================
  1351. #Region
  1352. $txtypos = $txtypos + 2.5 * $txtyoffset
  1353. $txtxpos = 2 * $txtxoffset
  1354. GUICtrlCreateGroup( ShowGUIInGerman() ? 'Produkt-Lebenszyklus-Informationen' : 'Product lifecycle information' , _
  1355.                 $txtxpos , $txtypos , $groupwidth , $groupheight_glb )
  1356.  
  1357. ; Product Lifecycle Label
  1358. $txtypos = $txtypos + 2 * $txtyoffset
  1359. $txtxpos = 3 * $txtxoffset
  1360. GUICtrlCreateLabel( ShowGUIInGerman() ? 'Diese Produkte wurden von Microsoft zum 14. Juli 2015 abgekündigt.' : 'Microsoft will discontinue support for these products on July 14th , 2015.' , _
  1361.                 $txtxpos , $txtypos , $groupwidth - 2 * $txtxoffset , $txtheight )
  1362.  
  1363. ; End Tab Item Definition
  1364. GuiCtrlCreateTabItem('')
  1365. GUICtrlSetState( $tabitemfocused , $GUI_SHOW )
  1366. #EndRegion
  1367. #EndRegion
  1368.  
  1369. ; ==========================================
  1370. ; == Options Group
  1371. ; ==========================================
  1372. #Region
  1373. $txtypos = $groupheight_lng + 4 * $groupheight_glb + 7 * $txtyoffset
  1374. $txtxpos = $txtxoffset
  1375. GUICtrlCreateGroup( ShowGUIInGerman() ? 'Optionen' : 'Options' , $txtxpos , $txtypos , $groupwidth + 2 * $txtxoffset , $groupheight_lng )
  1376.  
  1377. ; Verify Downloads
  1378. $txtypos = $txtypos + 1.5 * $txtyoffset
  1379. $txtxpos = 2 * $txtxoffset
  1380. $verifydownloads = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Heruntergeladene Updates verifizieren' : 'Verify downloaded updates' , _
  1381.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1382. If IniRead( $inifilename , $ini_section_opts , $opts_token_verify       , $enabled  ) = $enabled Then GUICtrlSetState( -1 , $GUI_CHECKED )
  1383. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1384.  
  1385. ; Include Service Packs
  1386. $txtxpos   = $txtxpos + $groupwidth / 2
  1387. $includesp = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Service-Packs einschließen' : 'Include Service Packs' , _
  1388.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1389. If IniRead(    $inifilename , $ini_section_opts , $opts_token_allowsp   , $enabled ) = $enabled Then
  1390.     If IniRead( $inifilename , $ini_section_opts , $opts_token_includesp , $enabled ) = $enabled Then
  1391.         GUICtrlSetState( -1 , $GUI_CHECKED )
  1392.     Else
  1393.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  1394.     EndIf
  1395. Else
  1396.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  1397. EndIf
  1398. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1399.  
  1400. ; Include .NET Frameworks 3.5 SP1 and 4
  1401. $txtypos = $txtypos + $txtheight
  1402. $txtxpos = 2 * $txtxoffset
  1403. $dotnet  = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'C++-Laufzeitbibliotheken und .NET Frameworks einschließen' : 'Include C++ Runtime Libraries and .NET Frameworks' , _
  1404.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1405. If IniRead(    $inifilename , $ini_section_opts , $opts_token_allowdotnet   , $enabled  ) = $enabled Then
  1406.     If IniRead( $inifilename , $ini_section_opts , $opts_token_includedotnet , $disabled ) = $enabled Then
  1407.         GUICtrlSetState( -1 , $GUI_CHECKED )
  1408.     Else
  1409.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  1410.     EndIf
  1411. Else
  1412.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  1413. EndIf
  1414.  
  1415. ; Include Windows Essentials 2012
  1416. $txtxpos = $txtxpos + $groupwidth / 2
  1417. $wle     = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Windows Essentials 2012 einschließen' : 'Include Windows Essentials 2012' , _
  1418.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1419. If IniRead( $inifilename , $ini_section_opts , $opts_token_wle          , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_CHECKED )
  1420. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1421.  
  1422. ; Include Microsoft Security Essentials
  1423. $txtypos = $txtypos + $txtheight
  1424. $txtxpos = 2 * $txtxoffset
  1425. $msse    = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Microsoft Security Essentials einschließen' : 'Include Microsoft Security Essentials' , _
  1426.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1427. If IniRead( $inifilename , $ini_section_opts , $opts_token_msse         , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_CHECKED )
  1428. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1429.  
  1430. ; Include Windows Defender Definitions
  1431. $txtxpos = $txtxpos + $groupwidth / 2
  1432. $wddefs  = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Windows Defender-Definitionen einschließen' : 'Include Windows Defender definitions' , _
  1433.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1434. If IniRead( $inifilename , $ini_section_opts , $opts_token_wddefs       , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_CHECKED )
  1435. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1436. #EndRegion
  1437.  
  1438. ; ==========================================
  1439. ; == ISO-Image Group
  1440. ; ==========================================
  1441. #Region
  1442. $txtypos = $txtypos + 2.5 * $txtyoffset
  1443. $txtxpos = $txtxoffset
  1444. GUICtrlCreateGroup( ShowGUIInGerman() ? 'Erstelle ISO-Image(s)...' : 'Create ISO image(s)...' , _
  1445.                 $txtxpos , $txtypos , $groupwidth + 2 * $txtxoffset ,  $groupheight_glb )
  1446.  
  1447. ; CD ISO Image
  1448. $txtypos = $txtypos + 1.5 * $txtyoffset
  1449. $txtxpos = 2 * $txtxoffset
  1450. $cdiso   = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'pro Produkt und Sprache' : 'per selected product and language' , _
  1451.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1452. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then
  1453.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  1454. Else
  1455.     If IniRead( $inifilename , $ini_section_iso , $iso_token_cd , $disabled ) = $enabled Then
  1456.         GUICtrlSetState( -1 , $GUI_CHECKED )
  1457.     Else
  1458.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  1459.     EndIf
  1460. EndIf
  1461.  
  1462. ; Cross-Platform DVD ISO image
  1463. $txtxpos = $txtxpos + $groupwidth / 2
  1464. $dvdiso  = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'pro Sprache, x86-produktübergreifend (nur Desktop-Produkte)' : 'per selected language, x86-cross-product (desktop only)' , _
  1465.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1466. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then
  1467.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  1468. Else
  1469.     If IniRead( $inifilename , $ini_section_iso , $iso_token_dvd , $disabled ) = $enabled Then
  1470.         GUICtrlSetState( -1 , $GUI_CHECKED )
  1471.     Else
  1472.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  1473.     EndIf
  1474. EndIf
  1475. #EndRegion
  1476.  
  1477. ; ==========================================
  1478. ; == USB-Image Group
  1479. ; ==========================================
  1480. #Region
  1481. $txtypos = $txtypos + 2.5 * $txtyoffset
  1482. $txtxpos = $txtxoffset
  1483. GUICtrlCreateGroup( ShowGUIInGerman() ? 'USB-Medium' : 'USB Medium' , $txtxpos , $txtypos , $groupwidth + 2 * $txtxoffset ,  $groupheight_glb )
  1484.  
  1485. ; USB Image
  1486. $txtypos = $txtypos + 1.5 * $txtyoffset
  1487. $txtxpos = 2 * $txtxoffset
  1488. $usbcopy = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Kopiere Updates für gewählte Produkte ins Verzeichnis:' : 'Copy updates for selected products into directory:' , _
  1489.                 $txtxpos , $txtypos , $groupwidth / 2 , $txtheight )
  1490. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled Then
  1491.     GUICtrlSetState( -1 , $GUI_UNCHECKED + $GUI_DISABLE )
  1492. Else
  1493.     If IniRead( $inifilename , $ini_section_usb , $usb_token_copy , $disabled ) = $enabled AND _
  1494.         IniRead( $inifilename , $ini_section_usb , $usb_token_path , '' ) <> '' Then
  1495.         GUICtrlSetState( -1 , $GUI_CHECKED )
  1496.     Else
  1497.         GUICtrlSetState( -1 , $GUI_UNCHECKED )
  1498.     EndIf
  1499. EndIf
  1500.  
  1501. ; USB Target
  1502. $txtxpos = $txtxpos + $groupwidth / 2
  1503. $usbpath = GUICtrlCreateInput( IniRead( $inifilename , $ini_section_usb , $usb_token_path , '' ) , _
  1504.                 $txtxpos , $txtypos - 2 , 2 * $txtwidth - $txtxoffset - $txtheight , $txtheight )
  1505.  
  1506. ; USB FSF button - FileSelectFolder
  1507. $txtxpos = $txtxpos + 2 * $txtwidth - $txtxoffset - $txtheight
  1508. $usbfsf  = GUICtrlCreateButton( '...' , $txtxpos , $txtypos - 2 , $txtheight , $txtheight )
  1509.  
  1510. ; USB Cleanup
  1511. $txtxpos  = $txtxpos + $txtheight + $txtxoffset
  1512. $usbclean = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Zielverzeichnis bereinigen' : 'Clean up target directory' , _
  1513.                 $txtxpos , $txtypos , 2 * $txtwidth , $txtheight )
  1514. If IniRead( $inifilename , $ini_section_usb , $usb_token_cleanup , $disabled  ) = $enabled Then GUICtrlSetState( -1 , $GUI_CHECKED )
  1515. If IsCheckBoxChecked( $usbcopy ) Then
  1516.     GUICtrlSetState( $usbpath  , $GUI_ENABLE )
  1517.     GUICtrlSetState( $usbfsf   , $GUI_ENABLE )
  1518.     GUICtrlSetState( $usbclean , $GUI_ENABLE )
  1519. Else
  1520.     GUICtrlSetState( $usbpath  , $GUI_DISABLE )
  1521.     GUICtrlSetState( $usbfsf   , $GUI_DISABLE )
  1522.     GUICtrlSetState( $usbclean , $GUI_DISABLE )
  1523. EndIf
  1524. #EndRegion
  1525.  
  1526. #Region Other Controls
  1527. ; Start Button
  1528. $txtypos   = $txtypos + 1.5 * $txtyoffset + $txtheight
  1529. $txtxpos   = $txtxoffset
  1530. $btn_start = GUICtrlCreateButton( 'Start' , $txtxpos , $txtypos , $btnwidth , $btnheight )
  1531. GUICtrlSetResizing( -1 , $GUI_DOCKLEFT + $GUI_DOCKBOTTOM )
  1532.  
  1533. ; Image Only Checkbox
  1534. $txtxpos   = $txtxpos + $btnwidth + $txtxoffset
  1535. $imageonly = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Nur ISO / USB präparieren' : 'Only prepare ISO / USB' , _
  1536.                 $txtxpos , $txtypos , 2 * $txtwidth , $slimheight )
  1537. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled    Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1538. If NOT IsCheckBoxChecked( $cdiso ) OR IsCheckBoxChecked( $dvdiso ) OR IsCheckBoxChecked( $usbcopy ) Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1539.  
  1540. ; Scripting Checkbox
  1541. $scripting = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Nur Sammelskript erstellen' : 'Only create collection script' , _
  1542.                 $txtxpos , $txtypos + $slimheight , 2 * $txtwidth , $slimheight )
  1543. If IniRead( $inifilename , $ini_section_misc , $misc_token_showshutdown , $disabled ) = $enabled Then GUICtrlSetState( -1 , $GUI_HIDE )
  1544.  
  1545. ; Shutdown Checkbox
  1546. $shutdown = GUICtrlCreateCheckbox( ShowGUIInGerman() ? 'Herunterfahren nach Abschluss' : 'Shut down on completion' , _
  1547.                 $txtxpos , $txtypos + $slimheight , 2 * $txtwidth , $slimheight )
  1548. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled  Then GUICtrlSetState( -1 , $GUI_DISABLE )
  1549. If IniRead( $inifilename , $ini_section_misc , $misc_token_showshutdown , $disabled ) = $disabled Then GUICtrlSetState( -1 , $GUI_HIDE )
  1550.  
  1551. ; Proxy Button
  1552. $txtxpos   = 2 * $txtxoffset + $groupwidth / 2 - $btnwidth
  1553. $btn_proxy = GUICtrlCreateButton( 'Proxy...' , $txtxpos , $txtypos , $btnwidth , $btnheight )
  1554. GUICtrlSetResizing( -1 , $GUI_DOCKBOTTOM )
  1555. $proxy = IniRead( $inifilename , $ini_section_misc , $misc_token_proxy , '' )
  1556.  
  1557. ; WSUS Button
  1558. $txtxpos  = 2 * $txtxoffset + $groupwidth / 2
  1559. $btn_wsus = GUICtrlCreateButton( 'WSUS...' , $txtxpos , $txtypos , $btnwidth , $btnheight )
  1560. GUICtrlSetResizing( -1 , $GUI_DOCKBOTTOM )
  1561. If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $enabled OR _
  1562.     IniRead( $inifilename , $ini_section_misc , $misc_token_skipdynamic  , $disabled ) = $enabled Then
  1563.     GUICtrlSetState( -1 , $GUI_DISABLE )
  1564. EndIf
  1565. $wsus = IniRead( $inifilename , $ini_section_misc , $misc_token_wsus , '' )
  1566.  
  1567. ; Donate Button
  1568. $txtxpos    = 2.5 * $txtxoffset + 3 * $groupwidth / 4 - $btnwidth / 2
  1569. $btn_donate = GUICtrlCreateButton( ShowGUIInGerman() ? 'Spenden...' : 'Donate...' , $txtxpos , $txtypos , $btnwidth , $btnheight )
  1570. GUICtrlSetResizing( -1 , $GUI_DOCKBOTTOM )
  1571. If IniRead( $inifilename , $ini_section_misc , $misc_token_showdonate , $enabled ) = $disabled Then GUICtrlSetState( -1 , $GUI_HIDE )
  1572.  
  1573. ; Exit Button
  1574. $txtxpos  = 3 * $txtxoffset + $groupwidth - $btnwidth
  1575. $btn_exit = GUICtrlCreateButton( ShowGUIInGerman() ? 'Ende' : 'Exit' , $txtxpos , $txtypos , $btnwidth , $btnheight )
  1576. GUICtrlSetResizing( -1 , $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM )
  1577. #EndRegion
  1578.  
  1579. ; Update Windows Controls
  1580. For $ii = 1 To $aMainArray[0][0]
  1581.     If $aMainArray[$ii][1] <> '' Then
  1582.         $aWinCtrSplit = StringSplit( $aMainArray[$ii][1] , '|' )
  1583.         For $jj = 1 To $aWinCtrSplit[0]
  1584.             $sCurrentVar1 = Eval( StringReplace( $aWinCtrSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' ))
  1585.             $sCurrentVar2 = Eval( StringReplace( 'ini section ' & $aWinCtrSplit[$jj] , ' ' , '_' ))
  1586.             $sCurrentVar3 = Eval( 'lang_token_' & $aMainArray[$ii][0] )
  1587.             If StringInStr( 'ell|ara|heb|dan|nor|fin' , $aMainArray[$ii][0] ) > 0 Then
  1588.                 GUICtrlSetData(  $sCurrentVar1 , LanguageCaption( $sCurrentVar3 , ShowGUIInGerman()))
  1589.                 GUICtrlSetState( $sCurrentVar1 , $GUI_UNCHECKED )
  1590.                 GUICtrlSetState( $sCurrentVar1 , $GUI_DISABLE )
  1591.             ElseIf $aMainArray[$ii][0] = 'glb' Then
  1592.                 If StringInStr( $aWinCtrSplit[$jj] , 'x64' ) > 0 Then
  1593.                     $glb_label = ( ShowGUIInGerman() ? 'x64 Global (mehrsprachige updates)' : 'x64 Global (multilingual updates)' )
  1594.                 Else
  1595.                     $glb_label = ( ShowGUIInGerman() ? 'x86 Global (mehrsprachige updates)' : 'x86 Global (multilingual updates)' )
  1596.                 EndIf
  1597.                 GUICtrlSetData( $sCurrentVar1 , $glb_label )
  1598.                 If IniRead( $inifilename , $sCurrentVar2 , $sCurrentVar3 , $disabled ) = $enabled Then
  1599.                     GUICtrlSetState( $sCurrentVar1 , $GUI_CHECKED )
  1600.                 EndIf
  1601.             Else
  1602.                 GUICtrlSetData( $sCurrentVar1 , LanguageCaption( $sCurrentVar3 , ShowGUIInGerman()))
  1603.                 If IniRead( $inifilename , $sCurrentVar2 , $sCurrentVar3 , $disabled ) = $enabled Then
  1604.                     GUICtrlSetState( $sCurrentVar1 , $GUI_CHECKED )
  1605.                 EndIf
  1606.             EndIf
  1607.         Next
  1608.     EndIf
  1609. Next
  1610.  
  1611. ; Update Office Controls
  1612. For $ii = 1 To $aMainArray[0][0]
  1613.     If $aMainArray[$ii][2] <> '' Then
  1614.         $aOffCtrSplit = StringSplit( $aMainArray[$ii][2] , '|' )
  1615.         For $jj = 1 To $aOffCtrSplit[0]
  1616.             $sCurrentVar = StringReplace( $aOffCtrSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  1617.             GUICtrlSetData( Eval( $sCurrentVar ) , LanguageCaption( Eval( 'lang_token_' & $aMainArray[$ii][0] ) , ShowGUIInGerman()))
  1618.             If IniRead( $inifilename , Eval( 'ini_section_' & $aOffCtrSplit[$jj] ) , Eval( 'lang_token_' & $aMainArray[$ii][0] ) , $disabled ) = $enabled Then
  1619.                 GUICtrlSetState( Eval( $sCurrentVar ) , $GUI_CHECKED )
  1620.             EndIf
  1621.         Next
  1622.     EndIf
  1623. Next
  1624.  
  1625. ; GUI Message Loop
  1626. GUISetState()
  1627. If IsUNCPath( @ScriptDir ) Then
  1628.     If ShowGUIInGerman() Then
  1629.         $sMsgBoxTitle = 'Fehler'
  1630.         $sMsgBoxText  = 'Das Skript wurde von einem UNC-Pfad gestartet.' & @LF & _
  1631.                              'Bitte weisen Sie der Netzwerkfreigabe einen Laufwerksbuchstaben zu.'
  1632.     Else
  1633.         $sMsgBoxTitle = 'Error'
  1634.         $sMsgBoxText  = 'The script was started from a UNC path.' & @LF & _
  1635.                              'Please map a drive letter to the network share.'
  1636.     EndIf
  1637.     MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText )
  1638.     Exit(1)
  1639. EndIf
  1640. If NOT PathValid( @ScriptDir ) Then
  1641.     If ShowGUIInGerman() Then
  1642.         $sMsgBoxTitle = 'Fehler'
  1643.         $sMsgBoxText  = 'Der Skript-Pfad darf nicht mehr als ' & $path_max_length & ' Zeichen lang sein und' & @LF & _
  1644.                              'darf keines der folgenden Zeichen enthalten: ' & $path_invalid_chars
  1645.     Else
  1646.         $sMsgBoxTitle = 'Error'
  1647.         $sMsgBoxText  = 'The script path must not be more than ' & $path_max_length & ' characters long and' & @LF & _
  1648.                              'must not contain any of the following characters: ' & $path_invalid_chars
  1649.     EndIf
  1650.     MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText )
  1651.     Exit(1)
  1652. EndIf
  1653. If NOT PathValid( @TempDir ) Then
  1654.     If ShowGUIInGerman() Then
  1655.         $sMsgBoxTitle = 'Fehler'
  1656.         $sMsgBoxText  = 'Der %TEMP%-Pfad darf nicht mehr als ' & $path_max_length & ' Zeichen lang sein und' & @LF & _
  1657.                              'darf keines der folgenden Zeichen enthalten: ' & $path_invalid_chars
  1658.     Else
  1659.         $sMsgBoxTitle = 'Error'
  1660.         $sMsgBoxText  = 'The %TEMP% path must not be more than ' & $path_max_length & ' characters long and' & @LF & _
  1661.                              'must not contain any of the following characters: ' & $path_invalid_chars
  1662.     EndIf
  1663.     MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText )
  1664.     Exit(1)
  1665. EndIf
  1666. If StringRight( EnvGet( 'TEMP' ) , 1 ) = '\' Then
  1667.     If ShowGUIInGerman() Then
  1668.         $sMsgBoxTitle = 'Fehler'
  1669.         $sMsgBoxText  = 'Der %TEMP%-Pfad enthält einen abschließenden Backslash "\".'
  1670.     Else
  1671.         $sMsgBoxTitle = 'Error'
  1672.         $sMsgBoxText  = 'The %TEMP% path contains a trailing backslash "\".'
  1673.     EndIf
  1674.     MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText )
  1675.     Exit(1)
  1676. EndIf
  1677. If NOT DirectoryStructureExists() Then
  1678.     If ShowGUIInGerman() Then
  1679.         $sMsgBoxTitle = 'Fehler'
  1680.         $sMsgBoxText  = 'Die Verzeichnisstruktur ist unvollständig.' & @LF & _
  1681.                              'Bitte behalten Sie diese beim Entpacken des Zip-Archivs bei.'
  1682.     Else
  1683.         $sMsgBoxTitle = 'Error'
  1684.         $sMsgBoxText  = 'The directory structure is incomplete.' & @LF & _
  1685.                              'Please keep it when you unpack the Zip archive.'
  1686.     EndIf
  1687.     MsgBox( 0x2010 , $sMsgBoxTitle , $sMsgBoxText )
  1688.     Exit(1)
  1689. EndIf
  1690. While 1
  1691.     Switch GUIGetMsg()
  1692.         ; Window Closed
  1693.         Case $GUI_EVENT_CLOSE
  1694.             ExitLoop
  1695.  
  1696.         ; Exit Button Pressed
  1697.         Case $btn_exit
  1698.             ExitLoop
  1699.  
  1700.         ; 'Include Service Packs' Check Box Toggled
  1701.         Case $includesp
  1702.             If NOT IsCheckBoxChecked( $includesp ) AND IniRead( $inifilename , $ini_section_opts , $opts_token_cleanup , $enabled ) = $enabled Then
  1703.                 If ShowGUIInGerman() Then
  1704.                     $sMsgBoxTitle = 'Warnung'
  1705.                     $sMsgBoxText  = 'Durch die Option "Service-Packs ausschließen" werden bereits'           & @LF & _
  1706.                                          'heruntergeladene Service Packs für die selektierten Produkte gelöscht.' & @LF & _
  1707.                                          'Möchten Sie fortsetzen?'
  1708.                 Else
  1709.                     $sMsgBoxTitle = 'Warning'
  1710.                     $sMsgBoxText  = 'The option "Exclude Service Packs" will delete previously' & @LF & _
  1711.                                          'downloaded Service Packs for the selected products.'       & @LF & _
  1712.                                          'Do you wish to proceed?'
  1713.                 EndIf
  1714.                 If MsgBox( 0x2134 , $sMsgBoxTitle , $sMsgBoxText ) = $msgbox_btn_no Then GUICtrlSetState( $includesp , $GUI_CHECKED )
  1715.             EndIf
  1716.  
  1717.         ; CD ISO Image Button Pressed
  1718.         Case $cdiso
  1719.             If IsCheckBoxChecked( $cdiso ) OR IsCheckBoxChecked( $dvdiso ) OR IsCheckBoxChecked( $usbcopy ) Then
  1720.                 GUICtrlSetState( $imageonly , $GUI_ENABLE )
  1721.             Else
  1722.                 GUICtrlSetState( $imageonly , $GUI_UNCHECKED + $GUI_DISABLE )
  1723.                 If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled Then
  1724.                     GUICtrlSetState( $verifydownloads , $GUI_ENABLE )
  1725.                     GUICtrlSetState( $shutdown , $GUI_ENABLE )
  1726.                 EndIf
  1727.             EndIf
  1728.  
  1729.         ; DVD ISO Image Button Pressed
  1730.         Case $dvdiso
  1731.             If IsCheckBoxChecked( $cdiso ) OR IsCheckBoxChecked( $dvdiso ) OR IsCheckBoxChecked( $usbcopy ) Then
  1732.                 GUICtrlSetState( $imageonly , $GUI_ENABLE )
  1733.             Else
  1734.                 GUICtrlSetState( $imageonly , $GUI_UNCHECKED + $GUI_DISABLE )
  1735.                 If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled Then
  1736.                     GUICtrlSetState( $verifydownloads , $GUI_ENABLE )
  1737.                     GUICtrlSetState( $shutdown , $GUI_ENABLE )
  1738.                 EndIf
  1739.             EndIf
  1740.  
  1741.         ; USB Copy Button Pressed
  1742.         Case $usbcopy
  1743.             If IsCheckBoxChecked( $usbcopy ) Then
  1744.                 GUICtrlSetState( $usbpath  , $GUI_ENABLE )
  1745.                 GUICtrlSetState( $usbfsf   , $GUI_ENABLE )
  1746.                 GUICtrlSetState( $usbclean , $GUI_ENABLE )
  1747.             Else
  1748.                 GUICtrlSetState( $usbpath  , $GUI_DISABLE )
  1749.                 GUICtrlSetState( $usbfsf   , $GUI_DISABLE )
  1750.                 GUICtrlSetState( $usbclean , $GUI_DISABLE )
  1751.             EndIf
  1752.             If IsCheckBoxChecked( $cdiso ) OR IsCheckBoxChecked( $dvdiso ) OR IsCheckBoxChecked( $usbcopy ) Then
  1753.                 GUICtrlSetState( $imageonly , $GUI_ENABLE )
  1754.             Else
  1755.                 GUICtrlSetState( $imageonly , $GUI_UNCHECKED + $GUI_DISABLE )
  1756.                 If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled Then
  1757.                     GUICtrlSetState( $verifydownloads , $GUI_ENABLE )
  1758.                     GUICtrlSetState( $shutdown , $GUI_ENABLE )
  1759.                 EndIf
  1760.             EndIf
  1761.  
  1762.         ; FSF Button Pressed
  1763.         Case $usbfsf
  1764.             If ShowGUIInGerman() Then
  1765.                 $FileSelectText = 'Wählen Sie das Zielverzeichnis:'
  1766.             Else
  1767.                 $FileSelectText = 'Choose target directory:'
  1768.             EndIf
  1769.             $dummy = FileSelectFolder( $FileSelectText , '' , 1 , GUICtrlRead( $usbpath ))
  1770.             If FileExists( $dummy ) Then GUICtrlSetData( $usbpath , $dummy )
  1771.  
  1772.         ; 'Clean up target directory' Check Box Toggled
  1773.         Case $usbclean
  1774.             If IsCheckBoxChecked( $usbclean ) Then
  1775.                 If ShowGUIInGerman() Then
  1776.                     $sMsgBoxTitle = 'Warnung'
  1777.                     $sMsgBoxText  = 'Durch die Option "Zielverzeichnis bereinigen"'      & @LF & _
  1778.                                          'werden dort bereits existierende Dateien gelöscht.' & @LF & _
  1779.                                          'Möchten Sie fortsetzen?'
  1780.                 Else
  1781.                     $sMsgBoxTitle = 'Warning'
  1782.                     $sMsgBoxText  = 'The option "Clean up target directory"' & @LF &  _
  1783.                                          'will delete existing files there.'      & @LF & _
  1784.                                          'Do you wish to proceed?'
  1785.                 EndIf
  1786.                 If MsgBox( 0x2134 , $sMsgBoxTitle , $sMsgBoxText ) = $msgbox_btn_no Then GUICtrlSetState( $usbclean , $GUI_UNCHECKED )
  1787.             EndIf
  1788.  
  1789.         ; Image Only Checkbox Toggled
  1790.         Case $imageonly
  1791.             If IsCheckBoxChecked( $imageonly ) Then
  1792.                 If ShowGUIInGerman() Then
  1793.                     $sMsgBoxTitle = 'Warnung'
  1794.                     $sMsgBoxText  = 'Durch diese Option verhindern Sie das Herunterladen aktueller Updates.' & @LF & _
  1795.                                          'Dies kann ein erhöhtes Sicherheitsrisiko für das Zielsystem bedeuten.'  & @LF & _
  1796.                                          'Möchten Sie fortsetzen?'
  1797.                 Else
  1798.                     $sMsgBoxTitle = 'Warning'
  1799.                     $sMsgBoxText  = 'This option prevents downloading of recent updates.'     & @LF & _
  1800.                                          'This may increase security risks for the target system.' & @LF & _
  1801.                                          'Do you wish to proceed?'
  1802.                 EndIf
  1803.                 If MsgBox( 0x2134 , $sMsgBoxTitle , $sMsgBoxText ) = $msgbox_btn_no Then
  1804.                     GUICtrlSetState( $imageonly , $GUI_UNCHECKED )
  1805.                 Else
  1806.                     GUICtrlSetState( $verifydownloads , $GUI_DISABLE )
  1807.                     GUICtrlSetState( $shutdown , $GUI_UNCHECKED + $GUI_DISABLE )
  1808.                 EndIf
  1809.             Else
  1810.                 If IniRead( $inifilename , $ini_section_misc , $misc_token_skipdownload , $disabled ) = $disabled Then
  1811.                     GUICtrlSetState( $verifydownloads , $GUI_ENABLE )
  1812.                     GUICtrlSetState( $shutdown , $GUI_ENABLE )
  1813.                 EndIf
  1814.             EndIf
  1815.  
  1816.         ; Proxy Button Pressed
  1817.         Case $btn_proxy
  1818.             If ShowGUIInGerman() Then
  1819.                 $sInputBoxTitle = 'HTTP-Proxy-Einstellung'
  1820.                 $sInputBoxText  = 'ACHTUNG: Sonderzeichen müssen hier gemäß RFC1738 codiert werden.'   & @LF & _
  1821.                                         'Um die Speicherung Ihres Passworts zu vermeiden,'                   & @LF & _
  1822.                                         'lassen Sie es hier bitte weg (http://Benutzername:@Server[:Port]).' & @LF & @LF & _
  1823.                                         'Bitte geben Sie Ihre HTTP-Proxy-URL ein'                            & @LF & _
  1824.                                         '(http://[Benutzername:[Passwort]@]Server[:Port]):'
  1825.             Else
  1826.                 $sInputBoxTitle = 'HTTP Proxy setting'
  1827.                 $sInputBoxText  = 'NOTE: Special characters have to be encoded according to RFC1738 here.' & @LF & _
  1828.                                         'To avoid storage of your password, please omit it here' & @LF & _
  1829.                                         '(http://username:@server[:port]).'                      & @LF & @LF & _
  1830.                                         'Please enter your HTTP Proxy URL'                       & @LF & _
  1831.                                         '(http://[username:[password]@]server[:port]):'
  1832.             EndIf
  1833.             $dummy = InputBox( $sInputBoxTitle , $sInputBoxText , $proxy , '' , 420 )
  1834.             If @error = 0 AND $proxy <> $dummy Then
  1835.                 $proxy = $dummy
  1836.                 $proxypwd = ""
  1837.             EndIf
  1838.  
  1839.         ; WSUS Button Pressed
  1840.         Case $btn_wsus
  1841.             If ShowGUIInGerman() Then
  1842.                 $sInputBoxTitle = 'WSUS-Einstellung'
  1843.                 $sInputBoxText  = 'Bitte geben Sie Ihre WSUS-URL ein' & @LF & '(http://server):'
  1844.             Else
  1845.                 $sInputBoxTitle = 'WSUS setting'
  1846.                 $sInputBoxText  = 'Please enter your WSUS URL' & @LF & '(http://server):'
  1847.             EndIf
  1848.             $dummy = InputBox( $sInputBoxTitle , $sInputBoxText , $wsus , '' , 220 )
  1849.             If @error = 0 Then
  1850.                 $wsus = $dummy
  1851.             EndIf
  1852.  
  1853.         ; Donate Button Pressed
  1854.         Case $btn_donate
  1855.             ShellExecute( $donationURL )
  1856.  
  1857.         ; Start Button Pressed
  1858.         Case $btn_start
  1859.             $runany = False
  1860.             If NOT IsCheckBoxChecked( $imageonly ) Then
  1861.                 If StringInStr( $proxy , ':@' ) > 0 AND $proxypwd = '' Then
  1862.                     If ShowGUIInGerman() Then
  1863.                         $sInputBoxTitle = 'HTTP-Proxy-Passwort'
  1864.                         $sInputBoxText  = 'ACHTUNG: Bitte codieren Sie Sonderzeichen hier nicht.' & @LF & _
  1865.                                                 'Dies geschieht automatisch.'                           & @LF & @LF & _
  1866.                                                 'Bitte geben Sie Ihr HTTP-Proxy-Passwort ein:'
  1867.                     Else
  1868.                         $sInputBoxTitle = 'HTTP Proxy password'
  1869.                         $sInputBoxText  = 'NOTE: Please do not encode special characters here.' & @LF & _
  1870.                                                 'This will be done automatically.'                    & @LF & @LF & _
  1871.                                                 'Please enter your HTTP Proxy password:'
  1872.                     EndIf
  1873.                     $dummy = InputBox( $sInputBoxTitle , $sInputBoxText , '' , '*' , 300 )
  1874.                     If @error = 0 Then
  1875.                         $proxypwd = RFC1738EncodedString( $dummy )
  1876.                     Else
  1877.                         ContinueLoop
  1878.                     EndIf
  1879.                 EndIf
  1880.                 If IniRead( $inifilename , $ini_section_misc , $misc_token_chkver , $enabled ) = $enabled Then
  1881.                     Switch RunVersionCheck( AuthProxy( $proxy , $proxypwd ))
  1882.                         ; Yes
  1883.                         Case -1
  1884.                             RunSelfUpdate( AuthProxy( $proxy , $proxypwd ))
  1885.                             ExitLoop
  1886.  
  1887.                         ; Cancel / Close
  1888.                         Case 1
  1889.                             ContinueLoop
  1890.                     EndSwitch
  1891.                 EndIf
  1892.             EndIf
  1893.         If IniRead( $inifilename , $ini_section_misc , $misc_token_wsus_trans , $disabled ) = $enabled AND $wsus <> '' Then
  1894.             IniWrite( ClientIniFileName() , $ini_section_misc , $misc_token_clt_wustat , $wsus )
  1895.         Else
  1896.             IniDelete( ClientIniFileName() , $ini_section_misc , $misc_token_clt_wustat )
  1897.         EndIf
  1898.         If IniRead( $inifilename , $ini_section_misc , $misc_token_minimize , $disabled ) = $enabled Then
  1899.             WinSetState( $maindlg , $maindlg , @SW_MINIMIZE )
  1900.         EndIf
  1901.  
  1902.             ; Windows Downloads
  1903.             For $ii = 1 To $aMainArray[0][0]
  1904.                 If $aMainArray[$ii][1] <> '' Then
  1905.                     $aBtnWinSplit = StringSplit( $aMainArray[$ii][1] , '|' )
  1906.                     For $jj = 1 To $aBtnWinSplit[0]
  1907.                         If StringInStr( $aBtnWinSplit[$jj] , 'w2k3' ) > 0 AND StringInStr( 'ell|ara|heb|dan|nor|fin' , $aMainArray[$ii][0] ) > 0 Then ContinueLoop
  1908.                         $sCurrentVar1 = StringReplace( $aBtnWinSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  1909.                         $sCurrentVar2 = StringReplace( $aBtnWinSplit[$jj] , ' ' , '-' ) & ' ' & $aMainArray[$ii][0]
  1910.                         If IsCheckBoxChecked( Eval( $sCurrentVar1 )) Then
  1911.                             If RunScripts( $sCurrentVar2 , IsCheckBoxChecked( $imageonly ) , DetermineDownloadSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $verifydownloads , AuthProxy( $proxy , $proxypwd ) , $wsus ) , IsCheckBoxChecked( $cdiso ) , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean ) , IsCheckBoxChecked( $usbcopy ) , GUICtrlRead( $usbpath )) <> 0 Then
  1912.                                 ContinueLoop 3
  1913.                             EndIf
  1914.                         EndIf
  1915.                     Next
  1916.                 EndIf
  1917.             Next
  1918.  
  1919.             ; Office Global Downloads
  1920.             If IsLangOfficeChecked() Then
  1921.                 If RunScripts( 'ofc glb' , IsCheckBoxChecked( $imageonly ) , DetermineDownloadSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $verifydownloads , AuthProxy( $proxy , $proxypwd ) , $wsus ) , False , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean ) , False , GUICtrlRead( $usbpath )) <> 0 Then
  1922.                     ContinueLoop
  1923.                 EndIf
  1924.             EndIf
  1925.  
  1926.             ; Office Downloads
  1927.             For $ii = 1 To $aMainArray[0][0]
  1928.                 If $aMainArray[$ii][2] <> '' Then
  1929.                     $aBtnOffSplit = StringSplit( $aMainArray[$ii][2] , '|' )
  1930.                     For $jj = 1 To $aBtnOffSplit[0]
  1931.                         $sCurrentVar = StringReplace( $aBtnOffSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  1932.                         If IsCheckBoxChecked( Eval( $sCurrentVar )) Then
  1933.                             If RunScripts( $aBtnOffSplit[$jj] & ' ' & $aMainArray[$ii][0] , IsCheckBoxChecked( $imageonly ) , DetermineDownloadSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $verifydownloads , AuthProxy( $proxy , $proxypwd ) , $wsus ) , False , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean ) , False , GUICtrlRead( $usbpath )) <> 0 Then
  1934.                                 ContinueLoop 3
  1935.                             EndIf
  1936.                         EndIf
  1937.                     Next
  1938.                 EndIf
  1939.             Next
  1940.  
  1941.             ; Office Language Specific Downloads
  1942.             For $ii = 1 To $aMainArray[0][0]
  1943.                 If $aMainArray[$ii][2] <> '' Then
  1944.                     $aOffLangSplit = StringSplit( $aMainArray[$ii][2] , '|' )
  1945.                     For $jj = 1 To $aOffLangSplit[0]
  1946.                         $sCurrentVal = StringReplace( $aOffLangSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  1947.                         If IsCheckBoxChecked( Eval( $sCurrentVal )) Then
  1948.                             If RunScripts( 'ofc ' & $aMainArray[$ii][0] , True , DetermineDownloadSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $verifydownloads , AuthProxy( $proxy , $proxypwd ) , $wsus ) , IsCheckBoxChecked( $cdiso ) , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean ) , IsCheckBoxChecked( $usbcopy ) , GUICtrlRead( $usbpath )) <> 0 Then
  1949.                                 ContinueLoop 3
  1950.                             EndIf
  1951.                         EndIf
  1952.                     Next
  1953.                 EndIf
  1954.             Next
  1955.  
  1956.             ; Create Cross-Platform DVD ISO Images
  1957.             If IsCheckBoxChecked( $dvdiso ) Then
  1958.                 ; Windows Server 2003
  1959.                 For $ii = 1 To $aMainArray[0][0]
  1960.                     If StringInStr( $aMainArray[$ii][1] , 'w2k3' ) = 0 Then ContinueLoop
  1961.                     If IsCheckBoxChecked( Eval( 'w2k3_' & $aMainArray[$ii][0] )) Then
  1962.                         If RunISOCreationScript( Eval( 'lang_token_' & $aMainArray[$ii][0] ) , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean )) <> 0 Then
  1963.                             ContinueLoop 2
  1964.                         EndIf
  1965.                     EndIf
  1966.                 Next
  1967.                 ; Office
  1968.                 For $ii = 1 To $aMainArray[0][0]
  1969.                     If $aMainArray[$ii][2] <> '' Then
  1970.                         $aOffIsoSplit = StringSplit( $aMainArray[$ii][2] , '|' )
  1971.                         For $jj = 1 To $aOffIsoSplit[0]
  1972.                             $sCurrentVal = StringReplace( $aOffIsoSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
  1973.                             If IsCheckBoxChecked( Eval( $sCurrentVal )) Then
  1974.                                 If RunISOCreationScript( Eval( 'lang_token_' & $aMainArray[$ii][0] ) , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean )) <> 0 Then
  1975.                                     ContinueLoop 3
  1976.                                 EndIf
  1977.                             EndIf
  1978.                         Next
  1979.                     EndIf
  1980.                 Next
  1981.             EndIf
  1982.  
  1983.             ; Restore Window And Show Success Dialog
  1984.             WinSetState( $maindlg , $maindlg , @SW_RESTORE )
  1985.             If $runany Then
  1986.                 If IsCheckBoxChecked( $scripting ) Then
  1987.                     If ShowGUIInGerman() Then
  1988.                         $sMsgBoxText  = 'Sammelskript "' & @ScriptDir & '\cmd\custom\RunAll.cmd" erstellt.' & @LF & _
  1989.                                              'Möchten Sie das Skript nun prüfen?'
  1990.                     Else
  1991.                         $sMsgBoxText  = 'Collection script "' & @ScriptDir & '\cmd\custom\RunAll.cmd" created.' & @LF & _
  1992.                                              'Would you like to check the script now?'
  1993.                     EndIf
  1994.                     If MsgBox( 0x2044 , 'Info' , $sMsgBoxText ) = $msgbox_btn_yes Then ShowRunAll()
  1995.                 Else
  1996.                     If IsCheckBoxChecked( $shutdown ) Then
  1997.                         Run( @SystemDir & '\shutdown.exe /s /f /t 5' , '' , @SW_HIDE )
  1998.                         ExitLoop
  1999.                     EndIf
  2000.                     If IsCheckBoxChecked( $imageonly ) Then
  2001.                         If ShowGUIInGerman() Then
  2002.                             $sMsgBoxText  = 'Image-Erstellung / Kopieren erfolgreich.'
  2003.                         Else
  2004.                             $sMsgBoxText  = 'Image creation / copying successful.'
  2005.                         EndIf
  2006.                         MsgBox( 0x2040 , 'Info' , $sMsgBoxText )
  2007.                     Else
  2008.                         If ShowGUIInGerman() Then
  2009.                             $sMsgBoxText  = 'Herunterladen / Image-Erstellung / Kopieren erfolgreich.' & @LF & _
  2010.                                                  'Möchten Sie nun die Protokolldatei auf mögliche Warnungen prüfen?'
  2011.                         Else
  2012.                             $sMsgBoxText  = 'Download / image creation / copying successful.' & @LF & _
  2013.                                                  'Would you like to check the log file for possible warnings now?'
  2014.                         EndIf
  2015.                         If MsgBox( 0x2044 , 'Info' , $sMsgBoxText ) = $msgbox_btn_yes Then ShowLogFile()
  2016.                     EndIf
  2017.                 EndIf
  2018.             Else
  2019.                 If ShowGUIInGerman() Then
  2020.                     $sMsgBoxText  = 'Nichts zu tun!'
  2021.                 Else
  2022.                     $sMsgBoxText  = 'Nothing to do!'
  2023.                 EndIf
  2024.                 MsgBox( 0x2040 , 'Info' , $sMsgBoxText )
  2025.             EndIf
  2026.  
  2027.     EndSwitch
  2028. WEnd
  2029. SaveSettings()
  2030. Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement