#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Description=Uinstall Parameter
#AutoIt3Wrapper_Res_Fileversion=1.0.0.1
#AutoIt3Wrapper_Res_LegalCopyright=Klaus Schulz
#AutoIt3Wrapper_Res_Language=1031
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)

Example()

Func Example()
	Global $gui, $Start_Installation, $Abbrechen, $ProductKey, $Name, $Organisation, $AnF = '"'
    Global $Aufloesung, $Insttyp, $Insttyp_Fag, $check_iView_X, $check_iTools, $check_Experiment_Center
    Global $check_Begaze, $check_Logitech, $check_Scandisk, $check_WinClam, $check_Sysprep, $msg, $Sysprep = ".\sysprep.inf"
	Global $Install_log = "D:\Recorded Data\Install_LOG\Install_Log.txt"
	Global $Konfig_Bat = "C:\Flag_Konfig.bat"




	Opt("GUICoordMode", 1)

	$gui = GUICreate("Windows XP iView X UNENTENDET Parameter", 820, 400, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES

	GUICtrlCreateLabel("Produkt Key? z.B.: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx", 20, 10)
	;$ProductKey = GUICtrlCreateInput("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", 400, 10, 199, 20)
	$check_Sysprep = GUICtrlCreateCheckbox ("Sysprep Starten", 20, 370, 130, 20) ;erstellen einer checkbox

	$Start_Installation = GUICtrlCreateButton("Start Installation",440, 175, 120, 20)
	$Abbrechen = GUICtrlCreateButton("Abbrechen", 440, 210, 120, 20)
	GUISetState()      ; will display an  dialog box with 2 button




	While 1
		$msg = GUIGetMsg()
		If GUICtrlRead ($check_Sysprep) = 1 Then $ProductKey = GUICtrlCreateInput("XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", 400, 10, 199, 20)

		Select
			Case $msg = $GUI_EVENT_CLOSE
				ExitLoop
			Case $msg = $Start_Installation
				FileDelete($Konfig_Bat)
				Sleep(1000)
				;$check_Sysprep = GUICtrlCreateCheckbox ("Sysprep Starten", 20, 370, 130, 20) ;erstellen einer checkbox
				IniWrite(@ScriptDir & $Sysprep, "UserData", "ProductKey", GUICtrlRead($ProductKey)) ; ProductKey wird in die Ini Datei geschrieben
				FileWriteLine ($Install_log, "INSTALLATIONS PROTOKOLL") ;INSTALLATIONS PROTOKOLL wir in Install_log geschrieben
				FileWriteLine ($Install_log, "ProductKey=" & GUICtrlRead($ProductKey)) ;ProductKey wir in Install_log geschrieben
				Sleep(1000)
				ExitLoop

		Case $msg = $Abbrechen
				Sleep(1000)
				FileWriteLine ($Konfig_Bat, "Set INSTABBRESCHEN=JA")
                Sleep(1000)
				ExitLoop

		EndSelect
	WEnd
EndFunc   ;==>Example


