Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Array.au3>
- #Region Required For All The Code Below, Must Appear Before Line 62
- Global Const $aMainArray[26][5] = [ [ 25 , 'Windows' , 'Office' , 'Deutsch' , 'English' ] , _
- ['glb' , 'w60|w60 x64|w61|w61 x64|w62|w62 x64|w63|w63 x64' ] , _
- ['enu' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Englisch' , 'English' ] , _
- ['fra' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Französisch' , 'French' ] , _
- ['esn' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Spanisch' , 'Spanish' ] , _
- ['jpn' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Japanisch' , 'Japanese' ] , _
- ['kor' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Koreanisch' , 'Korean' ] , _
- ['rus' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Russisch' , 'Russian' ] , _
- ['ptg' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Portugiesisch' , 'Portuguese' ] , _
- ['ptb' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Brasilianisch' , 'Brazilian' ] , _
- ['deu' , 'w2k3|w2k3 x64', 'o2k7|o2k10|o2k13' , 'Deutsch' , 'German' ] , _
- ['nld' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Niederländisch' , 'Dutch' ] , _
- ['ita' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Italienisch' , 'Italian' ] , _
- ['chs' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Chin. (simpl.)' , 'Chinese (s.)' ] , _
- ['cht' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Chin. (trad.)' , 'Chinese (tr.)'] , _
- ['plk' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Polnisch' , 'Polish' ] , _
- ['hun' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Ungarisch' , 'Hungarian' ] , _
- ['csy' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Tschechisch' , 'Czech' ] , _
- ['sve' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Schwedisch' , 'Swedish' ] , _
- ['trk' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Türkisch' , 'Turkish' ] , _
- ['ell' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Griechisch' , 'Greek' ] , _
- ['ara' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Arabisch' , 'Arabic' ] , _
- ['heb' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Hebräisch' , 'Hebrew' ] , _
- ['dan' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Dänisch' , 'Danish' ] , _
- ['nor' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Norwegisch' , 'Norwegian' ] , _
- ['fin' , 'w2k3' , 'o2k7|o2k10|o2k13' , 'Finnisch' , 'Finnish' ] ]
- ; Not Really Needed, Just for Testing
- ;_ArrayDisplay( $aMainArray , 'Test aMainArray:' )
- #EndRegion
- #Region Replaces Current Lines 62-86
- ; Create Language Tokens ex. $lang_token_glb
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][0] <> '' Then
- Assign( 'lang_token_' & $aMainArray[$ii][0] , $aMainArray[$ii][0] , 2 )
- EndIf
- Next
- ; Not Really Needed, Just for Testing
- ;Dim $aLangTokens[1][3] = [['Name:' , 'Declared:' , 'Value:']]
- ;For $ii = 1 To $aMainArray[0][0]
- ; If $aMainArray[$ii][0] <> '' Then
- ; $sCurrentVar = 'lang_token_' & $aMainArray[$ii][0]
- ; ReDim $aLangTokens[UBound( $aLangTokens ) + 1][3]
- ; $aLangTokens[UBound( $aLangTokens ) - 1][0] = $sCurrentVar
- ; $aLangTokens[UBound( $aLangTokens ) - 1][1] = IsDeclared( $sCurrentVar )
- ; $aLangTokens[UBound( $aLangTokens ) - 1][2] = Eval( $sCurrentVar )
- ; EndIf
- ;Next
- ;_ArrayDisplay( $aLangTokens , 'Test Language Tokens:' )
- ;MsgBox( 0 , 'Test Language Tokens:' , '$lang_token_glb=' & $lang_token_glb )
- #EndRegion
- #Region Replaces Current Lines 127-154
- ; Create Windows Vars ex. $w60_x64_glb
- _CreateEmptyVars( 1 )
- ; Create Office Vars ex. $o2k13_enu
- _CreateEmptyVars( 2 )
- Func _CreateEmptyVars( $iValue )
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][$iValue] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][$iValue] , '|' )
- For $jj = 1 To $aSplit[0]
- Assign( StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' ) , '' , 2 )
- Next
- EndIf
- Next
- EndFunc
- ; Not Really Needed, Just for Testing
- ;_TestEmptyVars( 1 , 'Test Windows Vars:' )
- ;_TestEmptyVars( 2 , 'Test Office Vars:' )
- ;MsgBox( 0 , 'Test Windows Vars:' , '$w60_x64_glb="' & $w60_x64_glb & '"' )
- ;MsgBox( 0 , 'Test Office Vars:' , '$o2k13_enu="' & $o2k13_enu & '"' )
- ;
- ;Func _TestEmptyVars( $iValue , $sTitle )
- ; Local $aEmptyVars[1][3] = [['Name:' , 'Declared:' , 'Value:']]
- ; For $ii = 1 To $aMainArray[0][0]
- ; If $aMainArray[$ii][$iValue] <> '' Then
- ; $aSplit = StringSplit( $aMainArray[$ii][$iValue] , '|' )
- ; For $jj = 1 To $aSplit[0]
- ; $sCurrentVar = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- ; ReDim $aEmptyVars[UBound( $aEmptyVars ) + 1][3]
- ; $aEmptyVars[UBound( $aEmptyVars ) - 1][0] = $sCurrentVar
- ; $aEmptyVars[UBound( $aEmptyVars ) - 1][1] = IsDeclared( $sCurrentVar )
- ; $aEmptyVars[UBound( $aEmptyVars ) - 1][2] = Eval( $sCurrentVar )
- ; Next
- ; EndIf
- ; Next
- ; _ArrayDisplay( $aEmptyVars , $sTitle )
- ;EndFunc
- #EndRegion
- #Region Replaces Current Lines 221-370
- Func LanguageCaption( $token , $german )
- Local $iFind = _ArraySearch( $aMainArray , $token , 1 , 0 , 0 , 0 , 1 , 0 )
- If $iFind = -1 Then
- Return ''
- Else
- If $german Then
- Return $aMainArray[$iFind][3]
- Else
- Return $aMainArray[$iFind][4]
- EndIf
- EndIf
- EndFunc
- ; Not Really Needed, Just for Testing
- ;MsgBox( 0 , 'Test Function Language Caption:' , LanguageCaption( 'ell' , True ))
- ;MsgBox( 0 , 'Test Function Language Caption:' , LanguageCaption( 'ell' , False ))
- #EndRegion
- #Region Replaces Current Lines 384-409
- Func IsLangOfficeChecked()
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][2] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][2] , '|' )
- For $jj = 1 To $aSplit[0]
- $sCurrentVar = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- If IsCheckBoxChecked( Eval( $sCurrentVar )) Then
- Return IsCheckBoxChecked( Eval( $sCurrentVar ))
- EndIf
- Next
- EndIf
- Next
- EndFunc
- #EndRegion
- #Region Replaces Current Lines 411-527
- Func SwitchDownloadTargets( $state )
- $sExempt = 'ell|ara|heb|dan|nor|fin'
- ; Windows
- For $ii = 1 To $aMainArray[0][0]
- If StringInStr( $sExempt , $aMainArray[$ii][0] ) > 0 Then ContinueLoop
- If $aMainArray[$ii][1] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][1] , '|' )
- For $jj = 1 To $aSplit[0]
- $sCurrentVar = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- GUICtrlSetState( Eval( $sCurrentVar ) , $state )
- Next
- EndIf
- Next
- ; Office
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][2] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][2] , '|' )
- For $jj = 1 To $aSplit[0]
- $sCurrentVar = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- GUICtrlSetState( Eval( $sCurrentVar ) , $state )
- Next
- EndIf
- Next
- Return 0
- EndFunc
- #EndRegion
- #Region Replaces Current Lines 956-1106
- Func SaveSettings()
- ; Windows
- _SaveSettingsWindowsAndOffice( 1 )
- ; Office
- _SaveSettingsWindowsAndOffice( 2 )
- ; Image creation
- IniWrite( $inifilename , $ini_section_iso , $iso_token_cd , CheckBoxStateToString( $cdiso ))
- IniWrite( $inifilename , $ini_section_iso , $iso_token_dvd , CheckBoxStateToString( $dvdiso ))
- IniWrite( $inifilename , $ini_section_usb , $usb_token_copy , CheckBoxStateToString( $usbcopy ))
- IniWrite( $inifilename , $ini_section_usb , $usb_token_path , GUICtrlRead( $usbpath ))
- IniWrite( $inifilename , $ini_section_usb , $usb_token_cleanup , CheckBoxStateToString( $usbclean))
- ; Miscellaneous
- IniWrite( $inifilename , $ini_section_opts , $opts_token_verify , CheckBoxStateToString( $verifydownloads ))
- IniWrite( $inifilename , $ini_section_opts , $opts_token_includesp , CheckBoxStateToString( $includesp ))
- IniWrite( $inifilename , $ini_section_opts , $opts_token_includedotnet , CheckBoxStateToString( $dotnet ))
- IniWrite( $inifilename , $ini_section_opts , $opts_token_wle , CheckBoxStateToString( $wle ))
- IniWrite( $inifilename , $ini_section_opts , $opts_token_msse , CheckBoxStateToString( $msse ))
- IniWrite( $inifilename , $ini_section_opts , $opts_token_wddefs , CheckBoxStateToString( $wddefs ))
- IniWrite( $inifilename , $ini_section_misc , $misc_token_proxy , $proxy )
- IniWrite( $inifilename , $ini_section_misc , $misc_token_wsus , $wsus )
- Return 0
- EndFunc
- Func _SaveSettingsWindowsAndOffice( $iValue )
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][$iValue] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][$iValue] , '|' )
- For $jj = 1 To $aSplit[0]
- $sCurrentSec = StringReplace( 'ini section ' & $aSplit[$jj] , ' ' , '_' )
- $sCurrentKey = StringReplace( 'lang token ' & $aMainArray[$ii][0] , ' ' , '_' )
- $sCurrentVal = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- IniWrite( $inifilename _
- , Eval( $sCurrentSec ) _
- , Eval( $sCurrentKey ) _
- , CheckBoxStateToString( Eval( $sCurrentVal )))
- Next
- EndIf
- Next
- EndFunc
- #EndRegion
- #Region Replaces Current Lines 2733-3316
- $sExempt = 'ell|ara|heb|dan|nor|fin'
- ; Windows
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][1] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][1] , '|' )
- For $jj = 1 To $aSplit[0]
- If StringInStr( $aSplit[$jj] , 'w2k3' ) > 0 Then
- If StringInStr( $sExempt , $aMainArray[$ii][0] ) > 0 Then ContinueLoop
- EndIf
- $sCurrentVar1 = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- $sCurrentVar2 = StringReplace( $aSplit[$jj] , ' ' , '-' ) & ' ' & $aMainArray[$ii][0]
- If IsCheckBoxChecked( Eval( $sCurrentVar1 )) Then
- 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
- ContinueLoop 3
- EndIf
- EndIf
- Next
- EndIf
- Next
- ; Office Global
- If IsLangOfficeChecked() Then
- 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
- ContinueLoop
- EndIf
- EndIf
- ; Office
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][2] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][2] , '|' )
- For $jj = 1 To $aSplit[0]
- $sCurrentVar = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- If IsCheckBoxChecked( Eval( $sCurrentVar )) Then
- If RunScripts( $aSplit[$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
- ContinueLoop 3
- EndIf
- EndIf
- Next
- EndIf
- Next
- #EndRegion
- #Region Replaces Current Lines 3318-3438
- ; Office Language Specific
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][2] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][2] , '|' )
- For $jj = 1 To $aSplit[0]
- $sCurrentVal = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- If IsCheckBoxChecked( Eval( $sCurrentVal )) Then
- 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
- ContinueLoop 3
- EndIf
- EndIf
- Next
- EndIf
- Next
- #EndRegion
- #Region Replaces Current Lines 3440-3562
- ; Create cross-platform DVD ISO images
- If IsCheckBoxChecked( $dvdiso ) Then
- ; Windows Server 2003
- For $ii = 1 To $aMainArray[0][0]
- If StringInStr( $aMainArray[$ii][1] , 'w2k3' ) = 0 Then ContinueLoop
- If IsCheckBoxChecked( Eval( 'w2k3_' & $aMainArray[$ii][0] )) Then
- If RunISOCreationScript( Eval( 'lang_token_' & $aMainArray[$ii][0] ) , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean )) <> 0 Then
- ContinueLoop 2
- EndIf
- EndIf
- Next
- ; Office
- For $ii = 1 To $aMainArray[0][0]
- If $aMainArray[$ii][2] <> '' Then
- $aSplit = StringSplit( $aMainArray[$ii][2] , '|' )
- For $jj = 1 To $aSplit[0]
- $sCurrentVal = StringReplace( $aSplit[$jj] & ' ' & $aMainArray[$ii][0] , ' ' , '_' )
- If IsCheckBoxChecked( Eval( $sCurrentVal )) Then
- If RunISOCreationScript( Eval( 'lang_token_' & $aMainArray[$ii][0] ) , DetermineISOSwitches( $includesp , $dotnet , $wle , $msse , $wddefs , $usbclean )) <> 0 Then
- ContinueLoop 3
- EndIf
- EndIf
- Next
- EndIf
- Next
- EndIf
- #EndRegion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement