Seite 1 von 1
Windows-Autorun
Verfasst: Freitag 16. September 2011, 20:18
von akhof
Hallo!
ICh habe vor eine Auto-Run-Python-Datei (Windows) zu erstellen.
Ich habe mich schon im Internet umgeschaut, habe aber nur gefunden, wie man ein Programm (nichteinmal Python) installiert...
Kennt jemand viell. einen Rat???
Vielen Dank schoneinmal im Vorraus...
akhof

Re: Windows-Autorun
Verfasst: Freitag 16. September 2011, 21:11
von Newcomer
Tu die Datei in den AUTORUN Ordner,
Re: Windows-Autorun
Verfasst: Freitag 16. September 2011, 21:34
von ocoal
Hallo auch,
meinst Du "
Autorun" oder "
Autostart"?
Da ich mal auf letzteres Tippe, kannst Du auch alternativ anstelle eine Verknüpfung in den "Autostart" Ordner im Startmenü von Windows abzulegen, auch den Weg über die
Registry nehmen.
Hierfür legst Du einen Schlüssel (
Name=beliebig, Typ=REG_SZ, Wert=Aufruf des Executable) unterhalb von:
- HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
oder
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
an.
Wirf einfach mal einen Blick auf die dort bereits existierenden Einträge, da kannst Du ein wenig abkupfern.
Beste Grüße,
-Colin-
Re: Windows-Autorun
Verfasst: Samstag 17. September 2011, 11:30
von akhof
Eigendlich meint ich, dass man z.B. eine .exe-Datei hat, die man ausführen kan, ohne dass man sich Python, pygame oder wxpython installieren muss...
Re: Windows-Autorun
Verfasst: Samstag 17. September 2011, 11:57
von Dav1d
Py2Exe, cxfreeze ...
Re: Windows-Autorun
Verfasst: Samstag 17. September 2011, 18:50
von Py-Prog
Ich hab vor ner Woche mal was gebastelt was Python Automatisch installiert.
Der User muss bloß vorm Bildschirm sitzen und nix tun. Geht jetzt aber nur mit 3.1.1 kann ich aber noch schnell anpassen.
AutoIt
Code: Alles auswählen
func sendkey($keystr)
Send('{' & $keystr & ' down}')
sleep(500)
Send('{' & $keystr & ' up}')
EndFunc
Func _RegSearch(ByRef $sFound, $sRegPath, $sSearch)
Local $sKey, $sVal, $sVar, $i = 0, $j = 0
While True
$i += 1
$sKey = RegEnumKey($sRegPath, $i)
If @error Then ExitLoop
_RegSearch($sFound, $sRegPath & '\' & $sKey, $sSearch)
$j = 0
While True
$j += 1
$sVal = RegEnumVal($sRegPath & '\' & $sKey, $j)
If @error Then ExitLoop
$sVar = RegRead($sRegPath & '\' & $sKey, $sVal)
If StringInStr($sVar, $sSearch, 2) Then $sFound &= $sRegPath & '\' & $sKey & '\' & $sVal & @CRLF
WEnd
WEnd
Return
EndFunc
$sFound = ''
_RegSearch($sFound, 'HKEY_CURRENT_USER\Software\Python\PythonCore', '3.1')
If $sFound == '' Then
MsgBox(4096, 'Info', 'Python 3.1 wurde noch nicht installiert. Es wird Automatisch Installiert Drücken sie keine Taste auf der Maus und Tastatur!')
$title = 'Python 3.1.1 Setup'
Run('python-3.1.1.msi')
WinWait($title)
WinActivate($title)
Sleep(1000)
sendkey('TAB')
sendkey('TAB')
sendkey('TAB')
sendkey('DOWN')
sendkey('ENTER')
Sleep(1000)
sendkey('ENTER')
Sleep(1000)
sendkey('ENTER')
Sleep(500)
$run = True
While True
If ControlClick($title,"", "Finish") Then
$run = False
EndIf
WEnd
MsgBox(4096, 'Info', 'Die Installation ist abgeschlossen, sie können Maus und Tastatur wieder Benutzen!')
EndIf
FileDelete('python-3.1.1.msi')
FileDelete('install_python_3.1.1.exe')
Wenn es darum geht das man nix installieren will hilft dass nicht, aber man kann es in eine Andere Installationen Einbinden.