[SOLVED] DELL bios setup package
Published: Dec 17, 2019 - 3:35 PM
Hello everyone,
I am trying to create a configuration package for DELL UEFI BIOS using their cctk tool.
Some computers have a BIOS password, others do not. We also don't want BIOS passwords to be transmitted in plain text, so I generated executables using CCT, one that removes the password and one that resets it.
I would like to follow these steps in my WAPT package:
My problem is that I can't capture this return code.
When I place my order:
I have a CalledProcessErrorOutput (normal) which displays this return code
I would like to be able to retrieve this exit code (58 and 106 in my specific case) in order to be able to verify my first condition.
I tried a try/except on the command to capture the return code, it works great in pyscripter but impossible to launch a package on the clients.
In the PyScripter environment, launching the execution configuration "install" correctly displays the True or False value as well as the relevant return code.
Once the package is in the repository and deployed to a test machine, I get this error:
I tried defining the cctkerrorcode variable at the beginning of the ispwddefined() function, and here's something even more curious: the package is successful, and the result is:
I have the impression that in this case, he doesn't see the cctk error...
I must admit that I'm starting to fall short of what I know how to do...
Does anyone know how to capture return codes in a more basic way?
Thank you in advance for your help.
Seb.
I am trying to create a configuration package for DELL UEFI BIOS using their cctk tool.
Some computers have a BIOS password, others do not. We also don't want BIOS passwords to be transmitted in plain text, so I generated executables using CCT, one that removes the password and one that resets it.
I would like to follow these steps in my WAPT package:
- Check if the password is set
- If so, run the executable that deletes it
- make the scripted changes
- launch the executable that resets the password
My problem is that I can't capture this return code.
When I place my order:
Code: Select all
run (r'"C:\Program Files (x86)\Dell\Command Configure\X86_64\cctk.exe" --numlock=enabled --valsetuppwd=impossiblepasswd'")Code: Select all
Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\common.py", line 3851, in install_wapt
exitstatus = setup.install()
File "C:\waptdev\iut-dell-bios-configuration-wapt\setup.py", line 39, in install
run (r'"C:\Program Files (x86)\Dell\Command Configure\X86_64\cctk.exe" --numlock=enabled --valsetuppwd=impossiblepasswd', return_stderr=errlist, accept_returncodes=[0,3])
File "C:\Program Files (x86)\wapt\common.py", line 3630, in run
return ensure_unicode(setuphelpers.run(*arg,pidlist=self.pidlist,**args))
File "C:\Program Files (x86)\wapt\setuphelpers.py", line 1066, in run
raise CalledProcessErrorOutput(proc.returncode,cmd,''.join(output+return_stderr))
CalledProcessErrorOutput: Command '"C:\\Program Files (x86)\\Dell\\Command Configure\\X86_64\\cctk.exe" --numlock=enabled --valsetuppwd=impossiblepasswd' returned non-zero exit status 58.
Output:
The setup password provided is incorrect. Please try again.I tried a try/except on the command to capture the return code, it works great in pyscripter but impossible to launch a package on the clients.
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
import subprocess
uninstallkey = []
def ispwddefined():
try:
print (subprocess.check_output(["C:\Program Files (x86)\Dell\Command Configure\X86_64\cctk.exe", "--numlock=enabled", "--valsetuppwd=impossiblepasswd "]).decode())
except subprocess.CalledProcessError, e:
cctkerrorcode = e.returncode
print cctkerrorcode
if (cctkerrorcode == 58):
print "password configured"
return True;
elif(cctkerrorcode == 106):
print ("no password configured")
return False
def install():
print ispwddefined()
Code: Select all
Ligne de Commande : install "C:\waptdev\iut-dell-bios-configuration-wapt\WAPT\.."
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
Installing WAPT files C:\waptdev\iut-dell-bios-configuration-wapt
58
password configured
TrueCode: Select all
UnboundLocalError: local variable 'cctkerrorcode' referenced before assignmentCode: Select all
NumLock=Enabled
NoneI must admit that I'm starting to fall short of what I know how to do...
Does anyone know how to capture return codes in a more basic way?
Thank you in advance for your help.
Seb.