Ok, ich habs mal geschafft, die Dateien anzuzeigen. Jetzt muss ich das nur noch implentieren. Spätestens morgen findet ihr die neue Version
MFG
Ok, ich habs mal geschafft, die Dateien anzuzeigen. Jetzt muss ich das nur noch implentieren. Spätestens morgen findet ihr die neue Version
MFG
Update #1:
Verwendet nun ein URL Protokoll, der dann den Dateinamen übergibt. Allerdings bekomm ich einen Variablenfehler (undeklariert) der aber nur beim Kompilierten existiert. Und da bekommt man ja die Codezeile inklusive aller Include. Kann wer helfen? Der Download Link: Klick!
Der Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Logo.ico
#AutoIt3Wrapper_Outfile=MyOwnWayRunner.exe
#AutoIt3Wrapper_Res_Comment=Change your Windows System - on your way!
#AutoIt3Wrapper_Res_Description=MyOwnWay
#AutoIt3Wrapper_Res_Fileversion=1.0.1.0
#AutoIt3Wrapper_Res_LegalCopyright=(C) LimeSoft Solutions
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#Include <File.au3>
#include <FTPEx.au3>
#include <ListViewConstants.au3>
#include <ComboConstants.au3>
#Include <Array.au3>
#include <String.au3>
#include <IE.au3>
Global $object, $CommandFile,$File, $Cmdline, $Type
FileInstall( "Startup.jpg", "Startup.jpg")
FileInstall( "AutoIt3.exe", "AutoIt3.exe")
AutoItSetOption("WinDetectHiddenText", 1)
If $Cmdline[0] = 1 Then
InetGet( $Cmdline[1])
_RunAction($Cmdline[1])
Else
MsgBox( 64, "Paramters syntax error!", "Syntax error in Parameters! Program will now exit!")
Exit
EndIf
$CommandFile = $Cmdline[1]
$url = "http://myownway.lima-city.de/Files.php"
Global $File_Array[500]
$SplashGUI = GUICreate( "MyOwnWay", 900,600,Default,Default,$WS_POPUPWINDOW, $WS_EX_CONTROLPARENT)
GUICtrlCreatePic( 'Startup.jpg',0,0,900,600)
GUICtrlCreateLabel("MyOwnWay 1.0.1", 0,0)
GUISetState(@SW_SHOW,$SplashGUI)
Sleep(3000)
GUISetState(@SW_HIDE,$SplashGUI)
#Region ### START Koda GUI section ### Form=d:\administrator\documents\stevenx media\myownway\gui.kxf
$Form1_1 = GUICreate("MyOwnWay", 608, 435, 192, 124)
$Program = GUICtrlCreateMenu("&Program")
$About = GUICtrlCreateMenuItem("About MyOwnWay", $Program)
$Submit = GUICtrlCreateMenuItem("Submit a command", $Program)
$Label1 = GUICtrlCreateLabel("Select a command:", 16, 24, 95, 17)
$Description = GUICtrlCreateEdit("", 16, 48, 569, 257)
GUICtrlSetData(-1, "Description")
$Run = GUICtrlCreateButton("Apply", 16, 328, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
;~ Case $Refresh
;~ _Fill_Listview()
Case $Run
_RunAction( $CommandFile)
Case $About
MsgBox( 0, "About", "This is MyOwnWay Beta 1.0 Version Code: 1.0.1; By Stefan Blagojevic for LimeSoft Solutions; LimeSoft-Solutions.com")
Case $Submit
_Submit()
EndSwitch
WEnd
Func _RunAction($CommandFile)
TrayTip( "MyOwnWay", "MyOwnWay runs now the Action. This may take a while. Please wait...",3,1)
$Type = IniRead( $Cmdline[1], "Informations", "Type", "ERROR")
$RestorePoint_Request = IniRead( $Cmdline[1], "Informations", "Restore_Point", "ERROR")
_FileReadToArray( $Cmdline[1], $File_Array)
_ArrayDelete( $File_Array, 1)
_ArrayDelete( $File_Array, 1)
_ArrayDelete( $File_Array, 1)
_ArrayDelete( $File_Array, 1)
_FileWriteFromArray($Cmdline[1], $File_Array,1)
If $RestorePoint_Request = "yes" Then
_CreateRestorePoint("MyOwnWay File: " & $Cmdline[1])
EndIf
If $Type = "batch" Then
$File = StringReplace( $Cmdline[1], "mow", "bat")
Run( $File)
ElseIf $Type = "autoit" Then
If not FileExists($Cmdline[1] & ".exe") Then
$FileString = StringReplace( $Cmdline[1], "mow", "au3")
$FileString = StringReplace( $FileString, " ", "_")
FileCopy( $Cmdline[1], $FileString)
MsgBox(0,"", "Aut2Exe.exe /in '" & $Cmdline[1] & "'")
Run( "Aut2Exe.exe /in '" & $FileString & "'")
EndIf
Run ( StringReplace( $FileString, "au3", "exe"))
FileDelete( $CommandFile)
FileDelete( $File)
EndIf
EndFunc
Func _Submit()
#Region ### START Koda GUI section ### Form=D:\Administrator\Documents\StevenX Media\MyOwnWay\Action_Submit_1.kxf
$Form1 = GUICreate("Creating a Action", 643, 545, 284, 3)
$Label1 = GUICtrlCreateLabel("Hello! Please fill in this informations:", 136, 16, 402, 31)
GUICtrlSetFont(-1, 20, 400, 0, "Miriam")
$Type = GUICtrlCreateCombo("Select Language", 8, 104, 601, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData( -1, "AutoIt|Batch")
$Name = GUICtrlCreateInput("The name of your Action", 8, 72, 601, 21)
$Description = GUICtrlCreateEdit("", 8, 136, 609, 113)
GUICtrlSetData(-1, "Description")
$Restore_Point = GUICtrlCreateCombo("Restore Point?", 8, 264, 609, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1,"Yes|No")
$Next = GUICtrlCreateButton("Upload", 8, 480, 171, 49)
$Action_Edit = GUICtrlCreateEdit("", 8, 296, 609, 177)
GUICtrlSetData(-1, "Now, enter your action")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUISetState( @SW_HIDE, $Form1)
ExitLoop
Case $Next
$File_Path = FileSaveDialog( "Where to save?", @ScriptDir, "MyOwnWay File (*.mow)")
IniWrite( $File_Path, "Informations", "Restore_Point", GUICtrlRead( $Restore_Point))
IniWrite( $File_Path, "Informations", "Description", GUICtrlRead( $Description))
IniWrite( $File_Path, "Informations", "Type", GUICtrlRead( $Type))
$Open = FileOpen( $File_Path,1)
FileWrite( $Open, GUICtrlRead( $Action_Edit))
MsgBox(0,"Finished", "Upload Site will now open! There, just select the MOW file!")
ShellExecute( "http://myownway.lima-city.de")
EndSwitch
WEnd
EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func _CreateRestorePoint($sRestorePointName)
Local $objSystemRestore
$objSystemRestore = ObjGet("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")
If Not $objSystemRestore.createrestorepoint($sRestorePointName, 0, 100) = 0 Then SetError(1)
EndFunc
MFG
Der Fehler ist in zeile 24:
[autoit]Global $object, $CommandFile,$File, $Cmdline, $Type
[/autoit]$Cmdline musst du entfernen,
mfg autoBert
Ja, ganz vergessen, ist ne Konstante. Aber der Fehler lautet "Variable used without being declared" Zeile ist 9316. Ich hab jetzt JEDE Variable deklariart, aber immer noch der Fehler. Und wenn ich ich statt dem Kommandozeilenparameter die eigentliche Datei einsetze, kommt kein Fehler. Da kann jetzt nicht was stimmen?
MFG
P.S.: Ist jetzt mein Lösungsansatz mit dem PHP zufriedenstellend?
warum der Fehler auftritt ist mir nicht klar. Du kannst ihn aber begeben indem du in der Func _RunAction $File_Array loal deklarierst:
[autoit]Func _RunAction($CommandFile)
Local $File_Array
TrayTip("MyOwnWay", "MyOwnWay runs now the Action. This may take a while. Please wait...", 3, 1)
da diese Variable nur in dieser Fun benutzt hat es keine Auswirkungen auf das Programm. Es läuft danach aber auch im kompilierten Zustand. Gefunden habe ich den Fehler indem ich einen Parmeter gesetzet habe (Unter View => Parameters) und danach gestartet:
D:\Programme\AutoIt3\Test\asdf.au3 (78) : ==> Variable used without being declared.:
_FileReadToArray( $Cmdline[1], $File_Array)
_FileReadToArray( $Cmdline[1], ^ ERROR
mfg autoBert
Ersetze das $CmdLine[0] bzw. [1] mal durch $CmdLineRaw. Wahrscheinlich wird einfach der Parameter falsch/nicht übergeben. Aber wenn man sowieso nur einen Parameter hat, ist es generell besser $CmdLineRaw zu benutzen, da $CmdLine[1] gar nicht deklariert wird, wenn kein Parameter angegeben wird...
Hi. Die Idee find ich echt super.
Aber mal ne Frage wegen der Sicherheit.
Kann man beim FTP Server nicht ein Konto anlegen, der zwar daten hoch- und runterladen, aber nichts löschen kann?
Dieses Konto stellt man dann den Leuten zur Verfügung.
Du selbst benutzt das Admin-Konto.
Sry wenn das ne doofe Frage is Kenn mich selbst mit FTP nich so extrem gut aus.
MfG
Commander21
1.: FTP benutz ich nicht mehr. PHP ist sicherer.
2.: Man kann einen Anonymous Account anlegen, Lima City selber bietet diese Möglichkeit aber nicht an.
Ich arbeite jetzt daran weiter - mit einem komplett neuen Ansatz, also kanns bissl länger dauern
Cheers