Not sure if this is the best way, but running netsh should work:
netsh firewall add allowedprogram C:\MyApp\MyApp.exe MyApp ENABLE
I think this requires Administrator Permissions though,for obvious reasons 🙂
Edit: I just don’t know enough about ClickOnce to know whether or not you can run external programs through it.
Related Contents:
- Elevating process privilege programmatically?
- How to detect Windows 64-bit platform with .NET?
- How do I check if a given string is a legal/valid file name under Windows?
- Using C#, how does one figure out what process locked a file?
- How to shut down the computer from C#
- How to deal with files with a name longer than 259 characters?
- How to get Windows Display settings?
- Detect Windows version in .NET
- Programmatically Determine a Duration of a Locked Workstation?
- Win32 API function to programmatically enable/disable device
- How can I run an EXE program from a Windows Service using C#?
- System.UnauthorizedAccessException while running .exe under program files
- get the titles of all open windows
- Console application closes immediately after opening in visual studio
- How do I determine a mapped drive’s actual path?
- Is there really any way to uniquely identify any computer at all
- How to get the z-order in windows?
- C# – Detect time of last user interaction with the OS
- Setting up Hook on Windows messages
- Retrieve system uptime using C#
- .NET (C#): Getting child windows when you only have a process handle or PID?
- How to start a new process without administrator privileges from a process with administrator privileges?
- File getting copied to SysWOW64 instead of System32
- Write to Windows Application Event Log without event source registration
- In .NET/C# test if process has administrative privileges
- Enumerate windows like alt-tab does
- Is there Windows system event on active window changed?
- Windows service with timer
- Winforms: Application.Exit vs Environment.Exit vs Form.Close
- How do I get information about recently connected USB device?
- Wrap C# application in .msi installer
- “MoveFile” function in C# (Delete file after reboot)
- How do I spawn threads on different CPU cores?
- Is .NET 4.0 Compatible with Windows XP SP2 or below? [closed]
- Can’t see localhost from UWP app
- How to make my Windows Form app snap to screen edges?
- Photo capture on Windows Store App for Windows Phone
- C# – How to detect a Windows shutdown/logoff and cancel that action (after asking the user)
- How to write an image from byte[] into MS WORD using C# Windows application
- Reading Data from CSV to Screen output [closed]
- How to delete a file after checking whether it exists
- How to check if a String contains any letter from a to z? [duplicate]
- How to stop Windows service programmatically
- Determine OS using Environment.OSVersion [duplicate]
- Lock Windows workstation programmatically in C#
- How to create a Process that outlives its parent
- Single MSI to install correct 32 or 64 bit c# application
- Determining if a folder is shared in .NET
- Impersonating a Windows user
- How to get the output of a System.Diagnostics.Process?