Page 1 of 1

Send a message (MessageBox) / .reg

Published: July 1, 2020 - 12:37 PM
by AdriAlpes
Hello everyone,

I'd like to create a MessageBox in the `def install()` function to inform the user that they must restart their machine after installing the package (registry key declaration in the session setup() function).

However, I'm getting a timeout when I install the package, even though I don't encounter any problems on my own machine.

Here's the code I'm using:
`win32ui.MessageBox('test','test')`

or

`os.system('cmd /c "msg /TIME:1750 %username% test"')`


I tried to work around the problem by writing the key (HKCU) in the `def install()` function, but it doesn't work. Is it possible to install the package as the machine's user account, rather than using the System account, to write the key to the HKCU?

Another inconclusive test: I copied a .reg file to the root of my hard drive and then ran it with this code:

`run(r'REG IMPORT C:\test.reg')`

or

`subprocess.call(['reg', 'import', C:\test.reg])`.


Do you have any idea what the problem might be?

Thank you in advance for your help.

Best regards,

Adrien

Re: Sending a message (MessageBox) / .reg

Published: July 1, 2020 - 2:08 PM
by vcardon
Hello,

take a look here: https://lists.tranquil.it/pipermail/wap ... 04007.html

Regards,

Vincent

Re: Sending a message (MessageBox) / .reg

Published: July 1, 2020 - 2:13 PM
by AdriAlpes
Hello Vincent,

Thank you for your reply, I'll try that right away.

Have a good afternoon,

Best regards,

Adrien

Re: Sending a message (MessageBox) / .reg

Published: July 1, 2020 - 2:49 PM
by sfonteneau

Code: Select all

msg /TIME:1750  * test
Alternatively, in Wapt Enterprise:

Code: Select all

from waptenterprise.waptservice.enterprise import show_message
show_message(None,{'msg':'Hello !'},'Simon Fonteneau')

Re: Sending a message (MessageBox) / .reg

Published: July 1, 2020 - 4:04 PM
by AdriAlpes
Hello,

Thank you for your reply. I used "vcardon's" solution, which works, thanks again!

Do you have any ideas for the .reg file? It's a large registry modification with 300 keys to change.

Thank you in advance and have a good afternoon

. Best regards

Adrien