[Resolved] Problem with the registry

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
dsp
Messages: 9
Registration: February 27, 2018 - 09:15

February 27, 2018 - 09:19

Good morning,
I have a small problem; when I try to modify the HKEY_CURRENT_USER For example:

Code: Select all

registry_setstring(HKEY_CURRENT_USER,r'Software\Microsoft\Windows\CurrentVersion\Internet Settings','toto1','tata1')
The Wapt agent on the other machine makes the change in the HKEY_USERS.
Did I do something wrong?

Sincerely
Last edited by dsp on 27 Feb 2018 - 10:21, edited 2 times.
WAPT version: 1.8.2
Server OS: Debian 10
Administration/package creation machine OS: Windows 10 1909
User avatar
agauvrit
WAPT Expert
Messages: 238
Registration: Nov 17, 2016 - 10:25
Location: Nantes
Contact :

February 27, 2018 - 09:48

Good morning,

This is what is called a context problem.

The beehive HKEY_CURRENT_USER refers to the current user context, therefore during package installation (function install() ), this refers to the local SYSTEM user of the machine.

During your tests, this must have worked very well since the modifications are made in the hive of the user account used for package development.
But once the package is pushed to the workstations, the changes are not made in the user hives.

If you need to make changes to the user hive, you should therefore execute the function within the user customization context by defining the function session_setup():

Code: Select all

def install():
	[...]

def session_setup():
	registry_setstring(HKEY_CURRENT_USER,r'Software\Microsoft\Windows\CurrentVersion\Internet Settings','toto1','tata1')
The documentation on this subject: https://www.wapt.fr/fr/doc-1.5/Creation ... index.html

Sincerely,

Alexander
dsp
Messages: 9
Registration: February 27, 2018 - 09:15

February 27, 2018 - 10:20

Thanks for your quick reply, it works better when things are done correctly ^^
WAPT version: 1.8.2
Server OS: Debian 10
Administration/package creation machine OS: Windows 10 1909
Locked