Sometimes Developers may need to identify the Firewall rules created in a windows machine from a Delphi App programmatically? Not sure how to do. Don’t worry. MiTec’s System Information Management Suite’s helps to enumerate the available Firewall rules created for a profile, we will learn how to use the MiTeC_FW Component in this blog post.
Platforms: Windows.
Installation Steps:
You can easily install this Component Suite from GetIt Package Manager. The steps are as follows.
- Navigate In RAD Studio IDE->Tools->GetIt Package Manager->select Components in Categories->Components->Trail -MiTec system Information Component Suite 14.3 and click Install Button.
- Read the license and Click Agree All. An Information dialog saying ‘Requires a restart of RAD studio at the end of the process. Do you want to proceed? click yes and continue.
- It will download the plugin and installs it. Once installed Click Restart now.
How to run the Demo app:
- Navigate to the System Information Management Suite trails setup, Demos folder which is installed during Get It installation e.g) C:UsersDocumentsEmbarcaderoStudio21.0CatalogRepositoryMiTeC-14.3DemosDelphi27
- Open the FW project in RAD studio 10.4.1 compile and Run the application.
- This Demo App shows how to list down the Firewall rules created and enumerate among them.
Components used in MSIC FW Demo App:
- TMiTeC_FW enumerates settings and rules from Windows Firewall. It also introduces methods for rules management.
- TListView to show the Firewall settings and its rules properties.
- TButton to save the listed Firewall settings to a .sif file and close the application.
Implementation Details:
- An Instance is created FW of TMiTeC_FW. Loop through the FW RulesCount and add firewall rules item to the list view. List down the properties such as Name, Description, AppName, ServiceName, Protocol, LocalPorts, RemotePorts, Enabled, etc. of each TRule item to list view subitems.
- Using AddRule, RemoveRule, EnableRule methods you can Add, Remove, Enable firewall rules respectively.
- Display the available Windows firewall rules as shown below.
It’s that simple to enumerate the windows firewall rules and list its rule properties for your application. Use this MiTeC component suite and get the job done quickly.
Interested in building an app that supports the Windows platform? Try out the Windows App Development Tool and make the most of it. Request a Free Trial here.