- Installed WAPT version: 1.8.0
- Server OS: Debian 10 (VM on Proxmox)
- Operating system of the administration/package creation machine: Windows 10
This is why I am coming to you:
I'm trying to create a package for installing our printer. So I did a first test on my administration machine. By that I mean I opened PowerShell, typed the commands one by one that allowed me to add and install the driver, create the print port, and create the printer in Windows.
Everything works from powershell, live on the administration machine, but when executing powershell commands in my package script, it no longer works, and this from the very first line.
Here is my PyScripter code (the powershell commands work as is when not executed by pyScripter).
Code: Select all
run('powershell pnputil.exe -i -a T5DSETWin_10110FR\Drivers\PCL6\Win_x86\KOAXTJ__.inf')
run('Add-PrinterDriver -Name "KONICA MINOLTA C287SeriesPCL"')
run('powershell Add-PrinterPort -Name "IP_192.168......." -PrinterHostAddress "192.168....."')
run('powershell Add-Printer -Name "5thFloor Printer" -DriverName "KONICA MINOLTA C287SeriesPCL" -PortName IP_192.168......"')Failed to add driver package: The INF file passed as a parameter is invalid.
I also tested `run_notfatal` to see the following lines. They also seem to be showing errors.
However, it works perfectly fine from PowerShell, starting from any line, since the drivers are installed etc. on the administration machine. (Same problem with x64, same problem if I change directories to exit waptdev, etc...)
I suspect an encoding error, but I admit I'm at a loss to analyze what's happening. And for good reason: here's the error message from the second line.
No positional parameter could be found that accepts the argument ®ÿC287SeriesPCLÿ¯.
Do you have any suggestions for a solution?
PS:
As a beginner, my ultimate goal isn't necessarily to successfully install this particular package, but rather to understand how everything works together. Therefore, there might be things in my approach that you find surprising. Feel free to point them out, even if they slightly deviate from the main topic: the printer installation package issue.
PS2: Could a PowerShell script solve the problem? I was too lazy to do it because I would have had to sign my script, since unsigned scripts are blocked from running. And then I figured that if it's possible to develop everything in PyScripter, it might be better than using a script linked in the package. Since I'm not familiar with development, my attempts are cautious, and learning is slow.
I would have liked, among other things, to test the existence of the print port before its creation, but I didn't want to write a gigantic line, and I don't know if it's possible to write a piece of PowerShell code over several lines in the Python script of the package.
