Hallo leute,
ich wollte ein kleines programm schrieben welches msgboxen als .exe erstellt... aber wenn ich den speicherort auswähle, und dieser nicht @scriptdir ist, kommt ein fehler von aut2exe, in dem was steht von wegen das icon konnte nicht gelesen werden und so... wenn ich aber den speicherort in dem ordner habe, wo auch aut2exe un mein script drinne ist, klappt alles.
hier der code(sorry... aber ihr müsst wohl ohne die bilder auskommen^^):
Spoiler anzeigen
#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.0.0
Author: Johann Lentz
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]; Script Start - Add your code below here
[/autoit] [autoit][/autoit] [autoit]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $Icon
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Johann´s little Exe Maker", 558, 483, 630, 138)
GUISetFont(8, 800, 0, "MS Sans Serif")
GUISetBkColor(0xFFFFFF)
$Group2 = GUICtrlCreateGroup("Icon", 296, 280, 233, 105)
$Input2 = GUICtrlCreateInput("Input2", 304, 336, 121, 21)
$Button1 = GUICtrlCreateButton("Durchsuchen", 432, 336, 91, 25, 0)
$Label2 = GUICtrlCreateLabel("Icon der Datei:", 304, 312, 89, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Text", 24, 280, 233, 105)
$Input3 = GUICtrlCreateInput("Input3", 32, 336, 217, 21)
$Label3 = GUICtrlCreateLabel("Text in der MsgBox:", 32, 312, 117, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("C:\Dokumente und Einstellungen\Johann Lentz\Eigene Dateien\Photoshop\Icons\error Kopie.jpg", 56, 192, 60, 52, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic2 = GUICtrlCreatePic("C:\Dokumente und Einstellungen\Johann Lentz\Eigene Dateien\Photoshop\spaß\Exe-maker-logo Kopie.jpg", 72, 8, 420, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label4 = GUICtrlCreateLabel("Flag (Typ)", 248, 136, 61, 17)
$Pic3 = GUICtrlCreatePic("C:\Dokumente und Einstellungen\Johann Lentz\Eigene Dateien\Photoshop\Icons\Hilfe Kopie.jpg", 176, 192, 60, 52, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic4 = GUICtrlCreatePic("C:\Dokumente und Einstellungen\Johann Lentz\Eigene Dateien\Photoshop\Icons\Information Kopie.jpg", 288, 192, 60, 52, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic5 = GUICtrlCreatePic("C:\Dokumente und Einstellungen\Johann Lentz\Eigene Dateien\Photoshop\Icons\Warnung Kopie.jpg", 408, 192, 60, 52, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Radio1 = GUICtrlCreateRadio("Fehler", 48, 168, 65, 17)
$Radio2 = GUICtrlCreateRadio("Hinweis", 168, 168, 73, 17)
$Radio3 = GUICtrlCreateRadio("Information", 280, 168, 81, 17)
$Radio4 = GUICtrlCreateRadio("Warnung", 392, 168, 73, 17)
$Label5 = GUICtrlCreateLabel("Copyright © Johann Lentz", 400, 464, 151, 17)
$Button2 = GUICtrlCreateButton("Erstellen", 240, 400, 75, 25, 0)
$Progress1 = GUICtrlCreateProgress(112, 432, 334, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button1
$Icon = FileOpenDialog ("Wähle ein Icon", "", "Icon (*.ico)")
GUICtrlSetData ($Input2 , $Icon)
$NameIcon = StringRegExp ( $Icon, "([A-Za-z]\:(?:\\|\/)(?:\\|\/)?)(.*(?:\\|\/))?((.*)\.(.*))\Z", 1)
FileCopy ($Icon, @ScriptDir,1)
Sleep (500)
FileMove (@scriptdir & "\" & $NameIcon[3] & "." & $NameIcon[4], @scriptdir & "\JLEMIcon.ico", 1)
Case $Button2
if FileExists("au3File.au3") Then
FileDelete ("au3File.au3")
EndIf
If $Icon = "" Then
MsgBox (16, "Fehler", "Es wurde kein Icon gewählt.")
Else
$ExePfad = FileSaveDialog ("Speicherort Wwählen", "", "Ausführbare Datei (*.exe)")
MsgBox(0, "hallo", $ExePfad)
Sleep (100)
$ExePfad2 = StringRegExp ( $ExePfad & ".exe", "([A-Za-z]\:(?:\\|\/)(?:\\|\/)?)(.*(?:\\|\/))?((.*)\.(.*))\Z", 1)
GUICtrlSetData ($Progress1, 10)
Sleep(200)
_RadioKontrolle()
Sleep (300)
GUICtrlSetData ($Progress1, 60)
Sleep (2000)
$parameter = ' /in "au3File.au3" /out "'& $ExePfad2[3] & '".exe /icon "JLEMIcon.ico" /comp 2 /nodecompile'
MsgBox (0, "hallo", $parameter)
RunWait (@scriptdir & "\Aut2Exe.exe" & $parameter )
GUICtrlSetData ($Progress1, 90)
FileMove (@scriptdir & "\" & $ExePfad2[3] & ".exe", $ExePfad & ".exe")
GUICtrlSetData ($Progress1, 100)
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _RadioKontrolle()
if BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetData ($Progress1, 20)
Sleep(100)
FileWrite("au3File.au3", 'MsgBoX(16, "Jlem", "' & GUICtrlRead($Input3) & '")')
GUICtrlSetData ($Progress1, 50)
ElseIf BitAND(GUICtrlRead($Radio2), $GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetData ($Progress1, 20)
Sleep(100)
FileWrite("au3File.au3", 'MsgBoX(32, "Jlem", "' & GUICtrlRead($Input3) & '")')
GUICtrlSetData ($Progress1, 50)
ElseIf BitAND(GUICtrlRead($Radio3), $GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetData ($Progress1, 20)
Sleep(100)
FileWrite("au3File.au3", 'MsgBoX(64, "Jlem", "' & GUICtrlRead($Input3) & '")')
GUICtrlSetData ($Progress1, 50)
ElseIf BitAND(GUICtrlRead($Radio4), $GUI_CHECKED) = $GUI_CHECKED Then
GUICtrlSetData ($Progress1, 20)
Sleep(100)
FileWrite("au3File.au3", 'MsgBoX(48, "Jlem", "' & GUICtrlRead($Input3) & '")')
GUICtrlSetData ($Progress1, 50)
Else
MsgBox (16, "Fehler", "Es wurde kein Flag gewählt!")
GUICtrlSetData ($Progress1, 0)
EndIf
EndFunc
ach und bitte achtet nicht darauf wennn das villeicht nicht so ordenltich geschrieben ist, ich bin da nich so^^achja...und es kann vorkommen, das ihr da bestimmte sachen unnötig oder so findet... den ich habe so viel da rumprobiert und umgeschrieben, das ich iregndwann selbst ganz durcheinander kam..
achja... und natürlich braucht ir zum testen die upx.exe, aut2exe.exe und AutoItSC.bin.. dies findet ihr alles im autoit ordner unter aut2exe...