Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deployment project not updating .exe

I have a Winforms project with a single .exe file as the primary output. I'm using a deployment project to distribute it, but the .exe file is not being updated when the new version is installed, meaning I have to ask the users to manually uninstall and then install the new version.

Here's what I'm doing:

  • I increment the assembly version on the output project (which is the primary output of the deployment project)
  • I increment the deployment project version (and update the product code when prompted)
  • The deployment project is set to remove previous versions
  • the 'Permanent' property on the .exe is set to False

I'm sure I've done this before successfully, but I can't seem to do it now. What am I doing wrong?

Edit: I got it to work by changing the file version in the project properties, as in this answer

like image 978
stuartd Avatar asked Apr 30 '09 11:04

stuartd


3 Answers

It's hard to say what may be causing this. How are you installing the MSI that does not remove the previous version? I would recommend running the install that is not working with verbose logging. I would run it from the command line like this:

msiexec /i "project.msi" /l*v "c:\install.log"

/l tells msiexec (which is the installer service) to create a log, * tells it to log everything, and v tells it to use verbose mode.

Run that, and take a look at the log file and it should tell you what is failing and why. You can post that log file here too and I bet we can find something together.

ADDITIONL QUESTIONS: The log file makes it look like the installer thinks there is nothing to do. When you state you update the file version, what are you updating? How do you have the files included to be deployed? Do you have them included as "primary outputs" in the setup project, or are you including the assemblies directly? Do you have it determining the dependencies and automatically including them, or did you include a project output?

UPDATE See this post for a description of what needs to change to automatically upgrade MSI's. Question 511789

like image 87
Mike Ohlsen Avatar answered Oct 19 '22 18:10

Mike Ohlsen


Finally figured this out after banging my head against the wall for hours.

My problem was identical to this one and ended up being very simple to solve. Two answers above led me in the right direction and helped me figure out my problem but here it is in a nutshell.

If you have RemovePreviousVersion set to true then the problem is most likely in the application settings under the assembly information button.

I ran the log as mohlsen showed in the answer above, msiexec /i "project.msi" /l*v "c:\install.log" and ended up with the same response, Won't Overwrite; Won't patch; Existing file is of an equal version

Inverse pointed me in the right direction but also threw me off a bit with the MFC reference. I am writing a windows app and finally put two and two together and went to the properties of the app I am writing under the Application tab. There is a button called Assembly Information that leads to the assembly version and file version. I incremented these and now my .exe file updates.

So you do have to do two things, increment the actual assembly version in the app you are writing as well as the version of the install package.

like image 45
RJ. Avatar answered Oct 19 '22 17:10

RJ.


Your application's executable may not be updating because you did not increment the VERSION information resource in your MFC project.

It's not enough to just increment the setup project version. See below:

http://msdn.microsoft.com/en-us/library/6fkzft86.aspx

"Version information is also used by setup APIs."

like image 5
Inverse Avatar answered Oct 19 '22 17:10

Inverse