Ich fange endlich an, Wapt-Pakete zu erstellen, und mein erstes ist sehr einfach. Es besteht darin, eine Datei (ein Batch-Skript) in einen speziell dafür erstellten Ordner zu kopieren.
In PyScripter füge ich es meinem Projekt hinzu und kopiere es in der `install()`-Funktion von `setup.py` mit `filecopyto()`
Und der setup.py-Code
Code: Alle auswählen
# -*- coding: utf-8 -*-
from setuphelpers import *
def install():
# Utilise l'uninstall créé par le msi
if isfile(r'c:\cygwin\unins000.exe'):
run(r'"c:\cygwin\unins000.exe" /verysilent')
# Supprime le paquet de l'installation wapt
softs = installed_softwares('cygwin')
if softs:
for soft in softs:
run(WAPT.uninstall_cmd(soft['key']))
# Purge des répertoires cygwin et cygwin64
if isdir(r'c:\cygwin'):
remove_tree('c:\cygwin')
if isdir(r'c:\cygwin64'):
remove_tree('c:\cygwin64')
path = makepath(programfiles, 'xxx', 'Backup')
mkdirs(path)
filecopyto(r'backup_nomade.bat', path)
passCode: Alle auswählen
Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\common.py", line 4235, in install_wapt
exitstatus = setup.install()
File "E:\waptdev\hil-robocopy-nomade_0_Windows_DEV-wapt\setup.py", line 27, in install
filecopyto(r'backup_nomade.bat', path)
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 601, in filecopyto
raise FileNotFoundError('filecopyto: Cannot copy file %s: file not found' % filename)
FileNotFoundError: filecopyto: Cannot copy file backup_nomade.bat: file not found
FATAL ERROR : None : None
Exit code: 3Dank im Voraus,
Philippe.
