Windows 7 - HTTPS error in installer - Advanced Installer Community
EpicEric
Posts: 1
Joined: Thu Oct 03, 2019 3:32 pm

Windows 7 - HTTPS error in installer

Hello. I have an installer for Windows 7 SP1 and above, which is erroring out for some users on a step where it has to send a request to an HTTPS server and set the response to an installer property. This error does not happen with my development machine (running Win10), and no-one using another version of Windows has reported that error so far.

When using either custom action "Send Install Information To Your Web Server" or "Run PowerShell Inline Script" for the HTTPS request, it will error out. The latter creates logs that point to the following error: "The underlying connection was closed: An unexpected error occurred on a send". This seems to be an issue with this version of Windows not having TLS 1.1 and 1.2 (references: [1] [2]), and I have been able to confirm a simple (albeit cumbersome) fix for this specific error on a clean Win7 SP1 installation by following these steps:

Code: Select all

1) Install all "Important Updates" in Windows Update and restart the computer.

2) Install the following security update:

    KB3140245
    - 32-bit: http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/04/windows6.1-kb3140245-x86_cdafb409afbe28db07e2254f40047774a0654f18.msu
    - 64-bit: http://download.windowsupdate.com/c/msdownload/update/software/updt/2016/04/windows6.1-kb3140245-x64_5b067ffb69a94a6e5f9da89ce88c658e52a0dec0.msu

3) Create these registry keys and values:

    32-bit
    - [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0.50727]
        "SystemDefaultTlsVersions"=dword:00000001
    - [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp]
        "DefaultSecureProtocols"=dword:00000a00
    - [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client]
        "DisabledByDefault"=dword:00000000
    - [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client]
        "DisabledByDefault"=dword:00000000

    64-bit (all of the above + the following)
    - [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727]
        "SystemDefaultTlsVersions"=dword:00000001
    - [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp]
        "DefaultSecureProtocols"=dword:00000a00

4) Restart the computer.
I do have .NET Framework 4.5.2 as a prerequisite for the application, and it can create HTTPS requests just fine. I was wondering if there is a way to have Advanced Installer or an utility inside my installer that uses it to create secure requests, while getting/setting installer properties.

For reference, here's the PowerShell 2.0-compatible script that I've created:

Code: Select all

# Block for declaring the script parameters.
Param()

# Your code goes here.
$webClient = New-Object System.Net.WebClient
$webClient.Encoding = [system.Text.Encoding]::UTF8
$webClient.Headers.add("Content-Type", "application/x-www-form-urlencoded")
$value = AI_GetMsiProperty VALUE
try {
	$response = $webClient.UploadString("https://my.url/my-endpoint","POST","VALUE=$value")
	AI_SetMsiProperty HttpPostServerResponse $response
} catch {
	AI_SetMsiProperty HttpPostServerResponse $null
	throw
}
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Windows 7 - HTTPS error in installer

Hi Eric and welcome to our forums,

Unfortunately we do not have any predefined support to work around this scenario.

Maybe we will consider implementing a built-in solution for this scenario in the future, thank you for your suggestion. However I cannot make you any promise nor give you any ETA.

Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”