[Blockierte Grafik: http://www.abload.de/img/startup9s99q.jpg]
MyOwnWay
Die Vorgeschichte: Wer kennt das nicht? Man will was an Windows ändern und sucht das ganze Internet nach dem richtigen Lösungsweg ab . Die Lösung: MyOwnWay. MOW ist eine Art "soziales Netzwerk", wo User ihre Tipps uploaden und andere sie anwenden können. Natürlich ohne Registry Kenntnisse. Der Ansatz: Man erstellt eine INI Datei mit den Informationen Beschreibung, Typ (AutoIt oder Batch) und ob ein Wiederherstellungspunkt notwendig ist. Danach fügt man den Script ein und uploaded es hoch. Das alles natürlich über mein Programm. Ich hoffe, es macht euch Spaß!
Was ich noch machen will:
Die MOW Dateien mit MyOwnWay öffnen (Wie funktioniert der Registry EIntrag?)
Eine "modernes" User Interface
ACHTUNG!!
Wegen dem neuen Update muss man MOW installieren, da er ein URL Protokoll installiert!!
Der Code:
Spoiler anzeigen
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Logo.ico
#AutoIt3Wrapper_Outfile=Actions\MyOwnWay.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>
FileInstall( "Startup.jpg", "Startup.jpg")
FileInstall( "AutoIt3.exe", "AutoIt3.exe")
If $Cmdline[0] = 1 Then
_RunAction($Cmdline[1])
Else
MsgBox(16,"Error!", "Syntax error!")
EndIf
Global $File_Array[500]
Global $_CommandCommand
$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)
_Fill_Listview()
#Region ### START Koda GUI section ### Form=D:\Administrator\Documents\StevenX Media\MyOwnWay\GUI.kxf
$Form1 = GUICreate("MyOwnWay", 608, 480, 192, 124)
$Program = GUICtrlCreateMenu("Program")
$About = GUICtrlCreateMenuItem("About MyOwnWay", $Program)
$Submit = GUICtrlCreateMenuItem("Submit a command", $Program)
$Refresh = GUICtrlCreateMenuItem("Refresh", $Program)
$_CommandCommand = GUICtrlCreateCombo("Select a Command", 16, 56, 569, 21)
$Label1 = GUICtrlCreateLabel("Select a command:", 16, 24, 95, 17)
$Description = GUICtrlCreateEdit("Select a command to view the description", 16, 96, 569, 257)
GUICtrlSetData(-1, "Description")
$Run = GUICtrlCreateButton("Run", 16, 376, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_Fill_Listview()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Refresh
_Fill_Listview()
Case $Run
_RunAction( GUICtrlRead( $_CommandCommand) & ".mow")
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()
Case $_CommandCommand
InetGet( "http://myownway.lima-city.de/" & GUICtrlRead( $_CommandCommand)& ".mow", GUICtrlRead( $_CommandCommand) & ".mow",1)
GUICtrlSetData( $Description, IniRead(GUICtrlRead( $_CommandCommand)& ".mow","Informations", "Description", "Could not load description"))
EndSwitch
WEnd
Func _Fill_Listview()
GUICtrlSetData($_CommandCommand, "")
$FTP_Open = _FTP_Open( "LimeCloud")
$FTP_Connect = _FTP_Connect( $FTP_Open, "ftp.lima-city.de", "myownway","GELÖSCHT")
If $FTP_Connect = 0 Then
MsgBox(0,"", "Can not connect to Server!")
Exit
EndIf
$FTP_List = _FTP_ListToArray( $FTP_Connect, 2)
If $FTP_List[0] = 0 Then
MsgBox(0,"ERROR", "No entrys found!")
Exit
EndIf
$Liste = ""
For $i = 1 to $FTP_List[0]
$Liste &= StringTrimRight($FTP_List[$i],4) & "|"
Next
$Liste = StringReplace( $Liste, "|upload", "")
$Liste = StringReplace( $Liste, "|index","")
$Liste = StringReplace( $Liste, "_"," ")
GUICtrlSetData( $_CommandCommand, $Liste)
EndFunc
Func _RunAction($File)
TrayTip( "MyOwnWay", "MyOwnWay runs now the Action. This may take a while. Please wait...",30,1)
$Type = IniRead( $File, "Informations", "Type", "ERROR")
$RestorePoint_Request = IniRead( $File, "Informations", "Restore_Point", "ERROR")
_FileReadToArray( $File, $File_Array)
_ArrayDelete( $File_Array, 1)
_ArrayDelete( $File_Array, 1)
_ArrayDelete( $File_Array, 1)
_ArrayDelete( $File_Array, 1)
FileDelete( $File)
_FileWriteFromArray($File, $File_Array,1)
If $RestorePoint_Request = "yes" Then
_CreateRestorePoint("MyOwnWay File: " & $File)
EndIf
If $Type = "batch" Then
$File = StringReplace( $File, "mow", "bat")
Run( $File)
ElseIf $Type = "autoit" Then
ShellExecute( "AutoIt3.exe", $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
Für das Bild und CO die EXE: Klick!
MFG und viel Spaß beim Coden
StevenX
Update #1:
Verwendet nun php, welcher über Hyperlink an die MyOwnWayRunner.exe den Dateinamen übergibt.