NovaES
Posts: 143
Joined: Tue Feb 24, 2015 5:20 pm

Install registry key, depending on the operating system

Tue Dec 28, 2021 4:25 pm

Currently in my application, I am required to use the following code to make the "https" work so that the connections to my server can work.

Code: Select all

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

The problem is that this protocol in Windiws 7 is not activated and must be activated (perhaps in windows server it is necessary to activate it)

As I see in Google, you have to add a registration key, which I have already done.
:arrow: Info protrocol SSL/TLS https://support.microsoft.com/es-es/top ... cjxzdyb000

(I attach a file of the created registry)

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
"DisabledByDefault"=dword:00000000
"Enabled"=dword:00000001

My question here is the following, how can I get this key to install for certain operating systems.

NovaES
Posts: 143
Joined: Tue Feb 24, 2015 5:20 pm

Re: Install registry key, depending on the operating system

Tue Dec 28, 2021 4:34 pm

The advanced installer should be able to detect this and install it if it is not there.

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Install registry key, depending on the operating system

Wed Dec 29, 2021 9:06 am

Hi,
My question here is the following, how can I get this key to install for certain operating systems.

The advanced installer should be able to detect this and install it if it is not there.
You easily achieve this. Please follow these steps:

1. From the "Registry" page create your key structure like this:

Code: Select all

SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client
tls Win 7.png
tls Win 7.png (37.03KiB)Viewed 3539 times

2. Now after you created your values, you can either right click on these values --> "Go to Component" option or you can do that for the CurrentControlKey or any other key:
Component registry.png
Component registry.png (105.17KiB)Viewed 3539 times

3. Here on the component properties, in the condition field add the following condition for Windows 7: VersionNT = 601 OR VersionNT64 = 601
Condition.png
Condition.png (70.77KiB)Viewed 3539 times

You can read more about these conditions in our "How do I install resources based on the Operating System version?" article.

Hope this helps! If you have any other questions, please don't hesitate to contact us.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”