Results 1 to 9 of 9

Thread: How to avoid auto-deleting my app on broken Windows 11?

  1. #1

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    354

    How to avoid auto-deleting my app on broken Windows 11?

    I have a full-deplux TCP/IP tranceiver application which I want to run it in another computer for testing purposes but Windows defender antispyware keeps deleting it. (Throws a notification first) My Windows 11 is crashed a bit and I temporarily unable to access Windows Settings>defender antispyware built-in tool. How can I tell it is safe. Is there a way like "Run as administrator" in XAML or such? I'm using 54321 as port and already imported System.Network.Sockets.

  2. #2

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    354

    Re: How to avoid auto-deleting my app on broken Windows 11?

    Let me ask it differently:
    Is it normal? How developers deal with it? I mean the port and the goal itself are not harmful.

    Following changes were needed to achieve keeping .exe file:
    Name:  builtinthreat.jpg
Views: 177
Size:  55.3 KB
    The rest items are toggled off, a third party antivirus is taking care of things.

    Notifications and accesses were also set to low through conventional control panel:
    Name:  SafetySlider.png
Views: 122
Size:  16.1 KB

  3. #3
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: How to avoid auto-deleting my app on broken Windows 11?

    A bank has a contractor that needs to come in and do some work inside the bank vault. So they unlock the vault and leave the door wide open indefinitely to ensure that the contractor will have access to it.

    That's the equivalent scenario to what you've done.

    A much better solution would be to exclude the specific exe file, or the folder where this exe file resides, from being scanned.

    Also, this thread has nothing to do with VB.NET. There's nothing unique about this scenario playing out with a VB.NET exe file vs. an exe file generated by any other compiler written in any other language.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: How to avoid auto-deleting my app on broken Windows 11?

    The question probably doesn't belong here, but I'm not quite clear on it, yet, or where would be better. This is a .NET application, but is this happening for ANY application you write, or is it just this one? You also seem to be focusing on the TCP activity, and possibly the port. If you were to comment out that stuff (which might be a fair amount), and build the program, it certainly won't run correctly, but will that solve the problem? If so, then you know what the source of the problem is, but if not, then you are looking at the wrong thing.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    354

    Re: How to avoid auto-deleting my app on broken Windows 11?

    Quote Originally Posted by Shaggy Hiker View Post
    The question probably doesn't belong here
    How is that sir??? As a beginner, "I wrote a program which unable to open on a 2nd console, what should I do" definitely belongs to VB.NET WinForms forum. How to write a program which automatically tells OS that it is safe? Via code? Via certificate files? Via registry files? The user is below ordinary computer-science knowledge to manage system security and/or firewall settings.

    *Edit*: There are portable re*source ha*cker tools out there (wish my account not being suspended for naming these LOL) which are free, plug and play and safe (for operating system) don't know how they're written...

    The message on Windows 10/11 is as follows:
    Name:  Untitled.png
Views: 144
Size:  14.6 KB
    In "more info" my app publisher is shown as unknown which it is (I can put some text in it as company name but I'm sure it's not the case) also there is a "Run it anyway" button appearing after pressing more info.

    Suppose it is on startup applications. Not going to be delightful experience.
    Last edited by pourkascheff; Mar 29th, 2023 at 01:55 AM.

  6. #6

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    354

    Re: How to avoid auto-deleting my app on broken Windows 11?

    Quote Originally Posted by Shaggy Hiker View Post
    then you know what the source of the problem is
    Yes it is sir. Commenting ipv4 tcp/ip network communication lines (the whole point of this app) will not causing any problems.

    App.Settings and manifest xaml did not change.

    I'm not into placing all codes here but here's the form1 class: idea isn't even mine. It belongs to a random french guy in youtube I followed his steps:
    Code:
    Imports System.Net
    Imports System.Net.Sockets
    Imports System.IO
    Public Class Form1
        Private CLIENT As TcpClient
        Public STREAM As StreamReader
        Public SWRITE As StreamWriter
        Public RECEIVE As String
        Public TEXTSEND As String
        Public Sub New()
            InitializeComponent()
            Dim LOCALIP As IPAddress() = Dns.GetHostAddresses(Dns.GetHostName)
            For Each addresses As IPAddress In LOCALIP
                If addresses.AddressFamily = AddressFamily.InterNetwork Then
                    SERVERIP.Text = addresses.ToString
                End If
            Next
        End Sub
        Private Sub Startbtn_Click(sender As Object, e As EventArgs) Handles Startbtn.Click
            Me.Cursor = Cursors.WaitCursor
            Dim LISTENER As New TcpListener(IPAddress.Any, CInt(SERVERPORT.Value))
            LISTENER.Start()
            CLIENT = LISTENER.AcceptTcpClient()
            STREAM = New StreamReader(CLIENT.GetStream())
            SWRITE = New StreamWriter(CLIENT.GetStream())
            SWRITE.AutoFlush = True
            BackgroundWorker1.RunWorkerAsync()
            BackgroundWorker2.WorkerSupportsCancellation = True
            Me.Cursor = Cursors.Default
        End Sub
        Private Sub Connectbtn_Click(sender As Object, e As EventArgs) Handles Connectbtn.Click
            CLIENT = New TcpClient()
            Dim IPEND As New IPEndPoint(IPAddress.Parse(CLIENTIP.Text), CInt(CLIENTPORT.Value))
            Try
                CLIENT.Connect(IPEND)
                If (CLIENT.Connected) Then
                    Convtxt.AppendText("Connected to server." + Environment.NewLine)
                    SWRITE = New StreamWriter(CLIENT.GetStream())
                    STREAM = New StreamReader(CLIENT.GetStream())
                    SWRITE.AutoFlush = True
                    BackgroundWorker1.RunWorkerAsync()
                    BackgroundWorker2.WorkerSupportsCancellation = True
                End If
            Catch ex As Exception
                MessageBox.Show(ex.Message.ToString())
            End Try
        End Sub
        Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
            While (CLIENT.Connected)
                Try
                    RECEIVE = STREAM.ReadLine
                    Me.Convtxt.Invoke(Sub() Convtxt.AppendText("YOU: " + RECEIVE + vbNewLine))
                    RECEIVE = ""
                Catch ex As Exception
                    MessageBox.Show(ex.Message.ToString())
                End Try
            End While
        End Sub
        Private Sub BackgroundWorker2_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker2.DoWork
            If (CLIENT.Connected) Then
                SWRITE.WriteLine(TEXTSEND)
                Me.Convtxt.Invoke(Sub() Convtxt.AppendText("ME: " + TEXTSEND + vbNewLine))
            Else
                MessageBox.Show("Sending failed.")
            End If
            BackgroundWorker2.CancelAsync()
    
        End Sub
        Private Sub Sendbtn_Click(sender As Object, e As EventArgs) Handles Sendbtn.Click
            If (Messagetxt.Text <> "") Then
                TEXTSEND = Messagetxt.Text
                BackgroundWorker2.RunWorkerAsync()
                Messagetxt.Text = ""
            End If
        End Sub
    End Class
    I'm not even happy with the way this app work. Therefore, if there is a better full-duplex multi node simple ipv4 tcp/ip chat transciever app, it is all welcome here... <3

    Here's some of its disadvantages:
    - Not responding on sever start until it accepts a client.
    - Server only accepts one client.

  7. #7
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,116

    Re: How to avoid auto-deleting my app on broken Windows 11?

    Quote Originally Posted by pourkascheff View Post
    How to write a program which automatically tells OS that it is safe? Via code? Via certificate files? Via registry files?
    Think about this for a bit. If this was possible, then wouldn't every piece of malware out there include this "Don't worry, I'm just an innocuous program..." automation?

  8. #8

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    354

    Re: How to avoid auto-deleting my app on broken Windows 11?

    You're right... I hated myself immediately after reading my own quotation. So you're telling me let the user install your suspicious app. They trusted you after all and bought your product. Let them open it once, Oh, Windows asks them to run it anyways? They proceed... Result are satisfying and hopefully operating system remembers to recognize your executive file as a safe one.

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: How to avoid auto-deleting my app on broken Windows 11?

    Yeah, that's often the best option. Signing the application might help, but that's prohibitively expensive for lots of people. I have an application used internally that triggers Windows to warn people when they install it. It's a fairly aggressive warning, too, but so what? It's an internal app, all the users know me.

    The reason I was thinking this didn't belong here is just that this could be seen as an application deployment issue. Still, I think the .NET aspects of it are the more interesting ones.
    My usual boring signature: Nothing

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