1

I've got an installer that installs the oracle XE database. Recently, I've been asked to close/block port 1521 programmatically during installation. My app is installed using Wix 3.8. I've seen the Wix Firewall Extension, but I don't see a way to specify the action (i.e., "block"). I want to block all incoming traffic on that port, effectively shutting down the listener.

Is there another way to do this or am I missing something with Wix?

2
  • 1
    Looking at the Wix Firewall Extension it seems that it doesn't provide the functionality to block a port, only to create an exception to grant access through a port. Maybe another option is to create a C# custom action, and use some API to control the firewall from there? Unfortunately I have no experience with this, so I don't know for sure if it's possible, or how it could be done. Commented Aug 27, 2014 at 21:50
  • I think you are correct, Akos. I'll work on a custom action and post back when I have a solution. Commented Aug 28, 2014 at 13:26

2 Answers 2

1

In case the Wix extension doesn't support this (which would surprise me), perhaps you can try this VBScript.

Note that I didn't write this script, nor have I used it. Use with caution and at your own risk. Test on a virtual machine.

Set objFirewall = CreateObject("HNetCfg.FwMgr")
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
Set colPorts = objPolicy.GloballyOpenPorts

Set objPort = colPorts.Item(9999,6)
objPort.Enabled = FALSE

Similar code, but using C#: Automating Windows Firewall with

Sign up to request clarification or add additional context in comments.

2 Comments

it surprises me too, but I'm pretty sure it doesn't. I'll proceed with a custom action and post back with my solution (unless someone else proves me wrong WRT to the extension)
@SirLanceAlot Did you find a good solution? I need the same thing. I will assume you are long gone and start writing my own solution to the problem and post back here when something works well.
1

Update: We weren't able to get WiX installer to do what we wanted, so we wrote our own custom process (not a CustomAction) that runs post install.

The 3 mains steps were:

  1. Configure the sqlnet.ora (\database\app\oracle\product\\server\NETWORK\ADMIN\sqlnet.ora) file to only allow connections from the localhost by appending the following lines:
> TCP.VALIDNODE_CHECKING=YES
> TCP.INVITED_NODES = 127.0.0.1
  1. Set up the TNSListener for local access only by running the following sqlplus commands:
> exec DBMS_XDB.SETLISTENERLOCALACCESS(true);
>     SHUTDOWN IMMEDIATE
>     STARTUP
  1. Stop the OracleXETNSListener service and disable it (custom VB.net code)

Hope this helps!

1 Comment

@Shadoninja, see if this ^^^ helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.