How do I create a SETUP.EXE that doesn't get blocked by Windows?

Calab 1 Reputation point
2020-10-17T17:53:04.337+00:00

I've written a small program using Visual Studio 2019. It is a Visual Basic Windows Forms application. I have no issues running it from Visual Studio. It publishes without errors. If I try to use the Setup.exe that was generated, I am met with an "Application Install - Security Warning" window that tells me that "Your administrator has blocked this application because it potentially poses a security risk to your computer." This is on the same Windows 10 computer that the code was generated on.

I would like to be able to take the SETUP.EXE that was generated and install my application on some of my other PC's.

Why is this happening? What can I do in my Project to correct this and publish a usable SETUP.EXE file?

I am aware that there are registry edits that I could do on my PC that would allow the setup program to work, but I don't want to have to alter settings to get my project to install. I would rather correct the issue in the publishing stage of my project to allow SETUP.EXE to run as any other installer would.

Thank you!

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,884 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. David Lowndes 4,711 Reputation points
    2020-10-17T19:08:40.707+00:00

    If your system is set to permit signed installations (see this post) then the solution is to sign your setup.exe with an appropriate certificate.

    2 people found this answer helpful.

  2. Daniel Zhang-MSFT 9,626 Reputation points
    2020-10-22T09:10:03.117+00:00

    Hi Calab,
    First, make sure the following registry keys are enabled:

    [HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\.NETFramework\Security\TrustManager\PromptingLevel]  
    LocalIntranet = Enabled  
    TrustedSites = Enabled  
    

    Then you can try to install it in safe mode.
    More details you can refer to this document.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.