Programm funktioniert nach NSIS nicht mehr

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
globox
User
Beiträge: 20
Registriert: Freitag 6. Mai 2005, 14:50
Kontaktdaten:

Ich hoffe ich störe nicht mit mein vielen Threads, nur bin ich auch in vielen IRC channels die aber ziemlich unbesucht sind.

Naja hier mal zu meinen Problem.
Also ich habe hier mein Portscanner Script und das habe ich mit py2exe compiliert. Das Programm funktioniert nach py2exe (als exe natürlich) wunderbar.

So nun jage ich es mit diesem Script durch NSIS, und das Programm macht garnichtsmehr.

NSIS Script

Code: Alles auswählen

!define py2exeOutputDir 'D:\Coding\Python\dist' 
!define exe             'port.exe' 
!define compressor      'lzma'  ;one of 'zlib', 'bzip2', 'lzma'
!define icon            'D:\Coding\Python\dist\icon.ico' 
 
!ifdef compressor 
    SetCompressor ${compressor} 
!else 
    SetCompress Off 
!endif 
Name ${exe} 
OutFile ${exe} 
SilentInstall silent 
!ifdef icon 
    Icon ${icon} 
!endif 
 
Section 
    InitPluginsDir 
    SetOutPath '$PLUGINSDIR' 
    File /r '${py2exeOutputDir}\*.*' 
    SetOutPath '$EXEDIR'        ; uncomment this line to start the exe in the PLUGINSDIR 
    nsExec::Exec $PLUGINSDIR\${exe} 
SectionEnd 
Python Script

Code: Alles auswählen

"""
GloBoX - Simple Portscanner
"""

import sys
import time
from socket import *

usage = '''
GloBoX - Simple Portscanner
----------------
usage: port [host] [startport] [stopport]
''' % sys.argv[0]

gbx = '''
GloBoX - Simple Portscanner
---------------
'''   

def pscan(host, startport, stopport):
    stopport_ = int(stopport)
    startport_ = int(startport)

    print '[-] Beginning scan on %s' % host

    for currport in range(startport_, stopport_+1):
        try:
            sock = socket(AF_INET, SOCK_STREAM)
            sock.settimeout(2)
            sock.connect((host, currport))
            sock.shutdown(SHUT_RDWR)
        except Exception, e:
            print '[-] Port: %s; Closed! (%s)' % (currport, e) 
        else:
            print '[-] Port: %s; Open!' % currport

    print '[-] Scanned from %s to %s on %s' % (startport, stopport, host)
                
def start():
    args = sys.argv[1:]
    if len(args) == 3:
        print gbx
        pscan(sys.argv[1], sys.argv[2], sys.argv[3])
    else:
        print usage

if __name__ == '__main__':
    start()
mfg.
globox
mitsuhiko
User
Beiträge: 1790
Registriert: Donnerstag 28. Oktober 2004, 16:33
Wohnort: Graz, Steiermark - Österreich
Kontaktdaten:

Kriegst du einen Fehler beim Start?
Oder läd es nicht?
TUFKAB – the user formerly known as blackbird
Leonidas
Python-Forum Veteran
Beiträge: 16025
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Geht es dir um eine EXE die in einer Datei ist (also ohne den ganzen Dateizoo der normalerweise zusätzlich nötig ist)? Dies kann py2exe seit version 0.6.1 schon selbst.
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
Antworten