Results 1 to 5 of 5

Thread: add to uac and firewall exception

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2009
    Posts
    193

    add to uac and firewall exception

    is there a way to add to firewall and uac exception list for XP,Vista,Win7?

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: add to uac and firewall exception

    I don't believe there is a way to add anything to the Firewall exception list and there is not an exception list for UAC. If any application could add themselves to the Firewall's exception list, it would become mute.

    As for UAC, you can change the UAC settings in your project properties so that when your app runs, it automatically requests admin privileges. However, if your app will not always need admin privileges, then it is best to only call it when needed.

    What are you trying to do exactly? Perhaps if you told us, we could provide a better way of doing it that would not require the User to add your application as an exception to Windows Firewall.
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2009
    Posts
    193

    Re: add to uac and firewall exception

    My application connects to net to check for updates and downloads the new files but uca blocks that and firewall doesnt allow to connect

  4. #4
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: add to uac and firewall exception

    Quote Originally Posted by NoobieO.o View Post
    My application connects to net to check for updates and downloads the new files but uca blocks that and firewall doesnt allow to connect
    I wouldn't know exactly what needs to be done when it comes to connecting to the internet and downloading files... but I see people wanting to do that type of thing all of the time and them not running into the type of issues you are.

    I told you how you can elevate permissions. Can you show us how you're connecting to the specific site?
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  5. #5
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: add to uac and firewall exception

    You can add firewall exceptions for your application, but you need to have administrator rights to do so, so you will need to get your UAC problem figured out to get it to work. To add a firewall exception, add a reference to %systemroot%\system32\FirewallAPI.dll to your application. Then you can do something like this:

    Code:
    Imports NetFwTypeLib
    Public Class Form1
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            Dim appType As Type = Type.GetTypeFromProgID("HnetCfg.FwAuthorizedApplication")
            Dim app As INetFwAuthorizedApplication
            app = DirectCast(Activator.CreateInstance(appType), INetFwAuthorizedApplication)
    
            app.Name = "Negative0's Sandbox"
            app.ProcessImageFileName = "C:\Users\Negative0\Documents\Visual Studio 2008\Projects\VBSandbox2\VBSandbox2\bin\Debug\vbsandbox2.exe"
            app.Enabled = True
    
            Dim apps As INetFwAuthorizedApplications
    
    
    
            Dim fwMgrType As Type = Type.GetTypeFromProgID("HnetCfg.FwMgr")
            Dim fwMgr As INetFwMgr
    
            fwMgr = DirectCast(Activator.CreateInstance(fwMgrType), INetFwMgr)
    
            apps = fwMgr.LocalPolicy.CurrentProfile.AuthorizedApplications
            apps.Add(app)
    
    
            
        End Sub
    
    End Class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width