Enable huge pages by running gpedit.msc and adding the current user to Local Computer Policy->Computer Configuration->Windows Settings->Security Settings->Local Policies->User Rights Assignment->Lock pages in memory:
and logging out of current Windows session for changes take effect.
where user_name and password are strings that are provided by the app user during the app install. Assuming the service name is MyService this creates a registry key HKEY_LOCAL_MACHINE\SECURITY\Policy\Secrets\_SC_MyService that is hidden by default and even administrator does not have a permission to read it and regedit does not show the content of HKEY_LOCAL_MACHINE\SECURITY key by default. But fortunately the access can be allowed by right clicking on HKEY_LOCAL_MACHINE\SECURITY and selecting Permissions or alternatively by running
in PowerShell. To list the content of the key I used the following command: