If you need to check for an active and working internet connection, you would normally use the function HTTP.Connection() in your Lua script. This function, however, has a slight problem: it will block your installer until it times out or receives an answer from the remote server, not giving your customer any visual feedback about the remaining time if no connection can be established. You cannot start a timer with Screen.StartTimer() and control a progress bar, because the connection test will block the application, and the timer will not fire.
If you need to overcome this limitation, you can use this custom screen instead. It will use a very small application (only 22 kB in size!) that performs the connection test for you instead of HTTP.TestConnection(), allowing you to give visual feedback to the user about the process. After you install this custom screen, just add it to your project, and study the provided code in Lua, changing it to fit your needs. The range of the progress bar is set to 40, and the timer will fire twice each second. A full bar represents the maximum wait time of 20 seconds.
This solution has some limitations that may be important to you:
Here is how the screen does look like with the default theme while the connection is being tested (of course you can change everything - after all, it is a custom screen):

The executable to test the connection (TestConnection.exe) will be deployed into the Includes sub folder of your Setup Factory installation. Don't forget to add this program as a primer file in your project.
You find the installer here.
Ulrich
If you need to overcome this limitation, you can use this custom screen instead. It will use a very small application (only 22 kB in size!) that performs the connection test for you instead of HTTP.TestConnection(), allowing you to give visual feedback to the user about the process. After you install this custom screen, just add it to your project, and study the provided code in Lua, changing it to fit your needs. The range of the progress bar is set to 40, and the timer will fire twice each second. A full bar represents the maximum wait time of 20 seconds.
This solution has some limitations that may be important to you:
- The timeout period is fixed at 20 seconds (the default value for Winsock operations);
- The program will connect to the remote server at port 80 (the default port for web servers);
- There is no support for proxies. This can be added later, should there be requests for this.
Here is how the screen does look like with the default theme while the connection is being tested (of course you can change everything - after all, it is a custom screen):

The executable to test the connection (TestConnection.exe) will be deployed into the Includes sub folder of your Setup Factory installation. Don't forget to add this program as a primer file in your project.
You find the installer here.
Ulrich
Comment