Hallo liebe Autoit Gemeinschaft,
ich habe ein Problem. Ich schreib grad an einem Programm, aber bei IniWrite schreibt es keine INI-Datei. Könnt ihr mir helfen?
[autoit]#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=Backup.exe
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
Program Version: 4.1
Author: Stefan Blagojevic
Script Function:
Ultimate Backup
#ce ----------------------------------------------------------------------------
SoundPlay( @ScriptDir & '\Sound\ProgramStart.mp3')
#include <Process.au3>
[/autoit][autoit][/autoit][autoit]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Stefan\Documents\Ultimate Backup\Images\GUI.kxf
$Form1 = GUICreate("Ultimate Backup", 640, 341, 189, 122)
$Pic1 = GUICtrlCreatePic("C:\Users\Stefan\Documents\Ultimate Backup\Images\UBBanner.jpg", -16, -8, 657, 140, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Target = GUICtrlCreateButton("Ziel auswählen", 0, 240, 209, 65, $WS_GROUP)
$Source = GUICtrlCreateButton("Quelle auswählen", 0, 168, 209, 65, $WS_GROUP)
$Save = GUICtrlCreateButton("Speichern", 224, 240, 81, 41, $WS_GROUP)
$Load = GUICtrlCreateButton("Laden", 224, 192, 81, 41, $WS_GROUP)
$StartBackup = GUICtrlCreateButton("Backup starten", 336, 176, 161, 121, $WS_GROUP)
$Userstart = GUICtrlCreateButton("Benutzerdateien Backup", 512, 176, 145, 121, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Dim $ver = "4.2.0"
InetGet("http://stevenx.co.de/ActualVersionUB.txt",@TempDir & "\update.txt", 1, 0)
$file = FileOpen(@TempDir & "\update.txt", 0)
$line = FileReadLine($file, 1)
If $line = $ver Then
MsgBox(64, "Kein Update", "Du hast die neuste Version: (" & $ver & ")")
FileClose($file)
FileDelete(@TempDir & "\update.txt")
Else
MsgBox(64, "Update!", "Es ist eine Neue Version verfügbar!")
$fg = MsgBox(4, "Updaten?", "Möchtest du jetzt Updaten?")
If $fg = 6 Then
InetGet( 'http://stevenx.co.de/Programme/UltimateBackup.zip', @ScriptDir & '\Downloads\UltimateBackup' & $line & '.zip')
FileClose($file)
FileDelete(@TempDir & "\update.txt")
Exit 0
EndIf
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Target
$Targetwahl = FileSelectFolder( 'Wählen Sie Ihr Ziel aus!', '', 1)
IniWrite( @ScriptDir & '\Data\Temp.ubproject', 'Information', 'Target', $Targetwahl & '\UserBackup')
Case $Source
$Sourcewahl = FileSelectFolder( 'Wählen Sie Ihre Quelle aus!', '', 1)
Case $Save
$Name = InputBox( 'Name?', 'Geben Sie den Namen des Projektes ein! Es wird dann unter ' & @ScriptDir & '\Projects\Name.UBProject gespeichert! Vergessen Sie nicht, die Quelle und das Ziel VORHER ausgewählt zu haben!')
IniWrite( @ScriptDir & '\Projects\' & $Name & '.ubproject', 'Information', 'Source', $Sourcewahl)
IniWrite( @ScriptDir & '\Projects\' & $Name & '.ubproject', 'Information', 'Target', $Targetwahl)
Case $Load
$Loadauswahl = FileOpenDialog( 'Datei öffnen', @ScriptDir & '\Projects', 'Ultimate Backup Projekte (*.ubproject)', 1)
$Sourcewahl = IniRead( $Loadauswahl, 'Information', 'Source', 'ERROR1')
$Targetwahl = IniRead( $Loadauswahl, 'Information', 'Target', 'ERROR1')
Case $StartBackup
IniWrite( @ScriptDir & '\Data\Temp.ubproject', 'Information', 'Source', $Sourcewahl)
IniWrite( @ScriptDir & '\Data\Temp.ubproject', 'Information', 'Target', $Targetwahl)
ShellExecute( @ScriptDir & '\Data\StartBackup.exe')
Case $Userstart
IniWrite( @ScriptDir & '\Data\Temp.ubproject', 'Information', 'Target', $Targetwahl & '\UserBackup')
ShellExecute( @ScriptDir & '\Data\UserBackup.exe')
EndSwitch
WEnd