Page 1 of 1

[RESOLVED] Waptexit

Published: September 10, 2024 - 11:17 AM
by CyrilM
Hello,

I'd like to use the `propose-upgrade` command to execute a `waptexit`.
I need to know the available options, please.

My ultimate goal is to restart the computer after forcing a `waptexit`.

My package launches an HTA interface; it has a message and a countdown timer.
At t=0, the `waptexit` is launched from the HTA, and when it finishes, the PC restarts (shutdown with a timer and a planned comment - using JavaScript in the HTA to launch `waptexit` and the shutdown).

I just need an option to restart after a `waptexit`; otherwise, the idea would be to check if the process is still active and restart when it's no longer running, but I don't think that's ideal.

Thank you in advance for your help.

Re: Waptexit

Published: September 19, 2024 - 12:57 PM
by CyrilM
- Installed WAPT version: 2.5.5.15697
- Server OS: Debian
- Administration/package creation machine OS: Windows 10 and 11

Hello,

I haven't received an answer to my previous question, but I'm making progress anyway. :D
And I'm encountering another problem:

When I try to install a package from the command line via a batch file or scheduled tasks, I get this error
(from the batch file): 401 client error: could not verify your access level for that URL
(from the task scheduler): return code 2147943691 (I saw online that it's a permissions issue)

Command line executed: wapt-get.exe -S -f install sdis77-tache-maj-NEXSIS
I've raised the permissions to the maximum and am using the System account.

Do you have any idea what the problem might be, please?

Re: Waptexit

Published: September 20, 2024 - 1:07 PM
by sfonteneau
Good morning

The options are documented here:
https://www.wapt.fr/fr/doc/wapt-console ... it-utility

Furthermore, there is:

https://www.wapt.fr/fr/doc/wapt-console ... se-feature

Code: Select all

waptpython -c "from waptservice.enterprise import start_waptexit ;start_waptexit('',{'only_priorities':False,'only_if_not_process_running':True, 'install_wua_updates':False,'countdown':300},'schtask')"
which I think should be useful in your case

Re: Waptexit

Published: September 24, 2024 - 08:07
by CyrilM
Thanks for the feedback.

I'll try the command; however, it only partially answers the question.

Is it normal not to be able to execute this command line from a task or batch script:
wapt-get.exe -S -f install

Re: Waptexit

Published: September 24, 2024 - 11:59 AM
by sfonteneau
If you go through

Code: Select all

-S
The installation goes through the service, so it requires authentication. Therefore, it won't work as a scheduled task.

Use in this case:

Code: Select all

-D
tells the wapt-get command to bypass the service and connect directly.

The scheduled task, however, will need to be launched as administrator.

Re: Waptexit

Published: September 24, 2024 - 12:08 PM
by blemoigne
Cyril,
Here are the two commands launched as the system account via psexec; do not use -S:

Code: Select all

C:\Windows\system32>wapt-get install -S -f tis-test
Waptservice User: SYSTEM
Server: https://srvwapt.blemoigne.lan
Server CABundle: C:\Program Files (x86)\wapt\ssl\server\srvwapt.blemoigne.lan.crt
Server client certificate: C:\Program Files (x86)\wapt\private\71253c6c-f412-455b-a907-93b10ce07490.crt
Server client key: C:\Program Files (x86)\wapt\private\71253c6c-f412-455b-a907-93b10ce07490.pem

Failed to login with Kerberos: 403 Client Error: Restricted access.
WRONG_PASSWORD_USERNAME Self service authentication failed for manage-w10$: ("('socket ssl wrapping error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1147)',)",)
 for url: https://127.0.0.1:8088/login
Password: 



C:\Windows\system32>wapt-get install  -f tis-test
[DEBUG] Logging TWaptwuaLog with level=debug to C:\Program Files (x86)\wapt\log\waptwua.log
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
install using WAPT packages tis-test

Results :

 === install packages ===
  tis-test [x64_fr_PROD]         | tis-test (0-3)
  

Re: Waptexit

Published: September 24, 2024 - 2:48 PM
by CyrilM
Thank you gentlemen for your replies.

The scheduled task worked correctly with the -D parameter instead of -S.

I will also test with pscexec.

Many thanks for your help. :D