Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while running exe after publishing: "This program might not have installed correctly"

Why after I've published my Project, I cant just run my exe (the one you find in your "Debug" folder) without getting this error message after you close your project? - Thus not using my published project, and still just using the exe

I've created a test project just to test if this is the case, and this happens every time.

  • Create a new windows project.
  • Build it.
  • Go to the debug folder.
  • Copy the exe to your desktop
  • Run the program

  • So a blank form opens up.

  • Now close it.
  • And there's the error message again.

How do you get rid of this? I've read you should add stuff to your manifest etc, but surely there must be an easier way? I'm using Visual Studio 2008 on a windows 7 64-bit machine.

EDIT:

I found the solution to the problem. The reason this happened is because I had the word "installer" or "Setup" in my project name, can you believe it... that something like that could influence the project like this.

i found that this question is answered here How to prevent “This program might not have installed correctly” messages on Vista This was indeed the reason the program did this.

like image 579
Ruan Avatar asked Jan 28 '13 12:01

Ruan


2 Answers

This happened because the project had the words "Installer" or "Setup" in the project's name. Creating a project with a name without these words in solved the problem. (A very strange problem indeed)

A link to a similar question and answer here

like image 89
Ruan Avatar answered Oct 03 '22 23:10

Ruan


Add manifest for your application with such content:

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
  <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
      <application> 
        <!--The ID below indicates application support for Windows Vista --> 
          <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> 
        <!--The ID below indicates application support for Windows 7 --> 
          <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> 
      </application> 
    </compatibility>
  </assembly>
like image 24
zabulus Avatar answered Oct 04 '22 01:10

zabulus