none
documentation for Microsoft Visual Studio 2017 Installer Projects? RRS feed

  • Question

  • I've installed the 2017 installer projects add-in for VS2017, and I'm using it, but I have many questions.

    I can't seem to find any link to documentation.  Can someone point me to the documentation?

    If there is not documentation, am I just supposed to be able to figure everything out without documentation?

    For example: I have set "remove previous versions" to "true", but the installer does not remove previous versions.  Is there something else that I'm supposed to do?

    Tuesday, March 13, 2018 10:43 PM

Answers

  • My conclusion, after many tests is that I now know how to reliably cause an installer to remove the prior version.  It is necessary to update FOUR things when you create a new version.  Failure to update any one of these will make some cases fail, with a variety of different error messages.

    Update all of these...
    1. Assembly Version
    2. Assembly File Version
    3. Installer Version (must increment)
    4. Installer ProductCode (gotta get a new GUID)

    Of course RemovePreviousVersions in the installer properties must be set to "true".

    VS is set up to automatically increment assembly version, but none of the others.  This is horribly complex and obscure.  Many references list some but not all of the above. 

    The designers get an F for usability. That fact that google gets so many hits on this issue, spread over more than 10 years gives some testimony to this.  The fact that most of the answers found online are incomplete shows that most of the people answering those questions over 10 years didn't understand it completely.

    I wrote a little program to increment the three version numbers and stuff in a new random GUID as a prebuild event, so I'll always get an installer that will actually install.

    Tuesday, March 20, 2018 3:07 AM

All replies

  • Hi,

    Welcome to MSDN forum.

    What's your project type, windows desktop application or office project?

    >>For example: I have set "remove previous versions" to "true", but the installer does not remove previous versions.  Is there something else that I'm supposed to do?

    You can have a look at the following thread that discuss the similar issue with you:

    https://stackoverflow.com/questions/39247420/uninstall-previous-version-installed-new-version-of-setup-project

    https://stackoverflow.com/questions/42498855/c-sharp-setup-project-installer-not-removing-previous-version

    https://stackoverflow.com/questions/43782817/how-to-update-the-assemblies-and-file-using-setup-project

    Creating an MSI/Setup Package for C# Windows Application Using a Visual Studio 2010 Setup Project

    Setup Project Deployment of a Windows Forms Application

    Note:
    This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you.  Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations
    regarding the quality, safety, or suitability of any software or information found there.


    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 14, 2018 7:37 AM
  • Wednesday, March 14, 2018 1:18 PM
  • I sympathize with regarding the lack of current, accurate documentation for Viisual Studio Install Project Extensions.  You may find this very old documentation from VS 6.0 to be helpful - Visual Studio Installer Documentation
    • Edited by RLWA32 Wednesday, March 14, 2018 7:14 PM
    Wednesday, March 14, 2018 7:14 PM
  • What's your project type, windows desktop application or office project?

    Its a WPF desktop app. 

    Thanks for all the info.

    Seems like VS has several kinds of version number that autoincrement, and now I see there's yet another kind of version number that does not auto increment.  That was unexpected.

    I don't really understand why there are so many version numbers and what MS's intent was here.

    The articles don't seem to quite agree, and/or I don't quite understand.. Do I need to increment BOTH the AssemblyVersion and the AssemblyFileVersion? 

    I'm thinking that I will write a tiny program to fire off automatically post build which would increment these versions.  That will keep them changing, and make the installer know to uninstall the prior version.

    • Edited by FAntonio2 Friday, March 16, 2018 8:24 PM
    Friday, March 16, 2018 7:58 PM
  • I have updated the two version numbers in the assemblyinfo.cs file.

    I have verified by looking at properties of the .exe file that the two version numbers are really changed.

    I build my installer project, creating an installer, and I run it, and it gives me the same darn error message as before.  "Another version of this product is already installed.  Installation of this version cannot continue. ..."

    The installer does not uninstall the prior version, even tho I have set "remove previous versions" to "true".

    It seems to me that incrementing the version number could never have been the root problem, because the installer is telling me that it KNOWS that the installed version is different.  The problem is that it refuses to do the uninstall.

    How do I convince the installer to perform the uninstall rather than just complaining about the need to do an uninstall?

    Gosh, it seems like setting "remove previous version" to "true" is rather precisely telling the installer to uninstall the prior version.  I am clearly missing something basic.

    Saturday, March 17, 2018 4:13 PM
  • I think I may have finally figured out the answer.  (and I don't like it)

    This was helpful: https://www.red-gate.com/simple-talk/dotnet/visual-studio/updates-to-setup-projects/

    The problem has nothing to do with the various version numbers discussed by most of the articles linked above.  (Microsoft has lots of version numbers!)  The numbers that matter are two properties of the INSTALL PROJECT.  These apparently important properties are called "Version" and "ProductCode".  You have to change them both.

    If you change neither, or just one of them, you get an error.  Either the error message I described above, or a slightly different version of it.

    This is sad, because there is no automated way to update these numbers.  You have to click on a lot of things every time you want to make a new installer, to install a new version of your program for testing, etc.

    I tried to figure out how to update these numbers programmatically, but that's hard too!  Instead of being kept in a .cs file, as the versions for my C# project are, the installer keeps these numbers in Installer.vdproj .  That's completely undocumented, and therefore a bit scarier.  I suppose I could write a program to modify it and thus automate this process.

    How do other people handle this?

    Microsoft folks: How about some documentation?

    Saturday, March 17, 2018 7:24 PM
  • No, now I've decided I'm wrong again.  I just saw the installer do an automatic uninstall even tho I had not incremented version of the install project.  I was pretty sure after testing that yesterday, now I'm not. 

    So there must be more going on than I understand at this point.

    I've learned a lot about the installer by reading articles written by Phil Wilson, so I ordered a copy of his book "The Definitive Guide to Windows Installer".  It's 13 years old, but given the lack of other documentation available...

    Sunday, March 18, 2018 6:56 PM
  • Hi,

    I will move your thread to Windows Forms > ClickOnce and Setup & Deployment Projects forum to discuss visual studio installer project. If you have problems about visual studio IDE, please feel free to let me know.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 19, 2018 2:03 AM
  • Hi,

    Please refer to the following similar links:

    RemovePreviousVersions=True but previous version is not removed from the target machine

    Visual Studio Setup Project - Upgrade to new version at setup

    VS 2010 Setup Project is NOT removing previous versions

    Regards,

    Frankie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 19, 2018 7:59 AM
    Moderator
  • My conclusion, after many tests is that I now know how to reliably cause an installer to remove the prior version.  It is necessary to update FOUR things when you create a new version.  Failure to update any one of these will make some cases fail, with a variety of different error messages.

    Update all of these...
    1. Assembly Version
    2. Assembly File Version
    3. Installer Version (must increment)
    4. Installer ProductCode (gotta get a new GUID)

    Of course RemovePreviousVersions in the installer properties must be set to "true".

    VS is set up to automatically increment assembly version, but none of the others.  This is horribly complex and obscure.  Many references list some but not all of the above. 

    The designers get an F for usability. That fact that google gets so many hits on this issue, spread over more than 10 years gives some testimony to this.  The fact that most of the answers found online are incomplete shows that most of the people answering those questions over 10 years didn't understand it completely.

    I wrote a little program to increment the three version numbers and stuff in a new random GUID as a prebuild event, so I'll always get an installer that will actually install.

    Tuesday, March 20, 2018 3:07 AM
  • Hi FAntonio2,

    I think you solved your problem now, right?

    If so, hope you can close this thread by marking the helpful reply as answer as this will help others looking for the same or similar issues down the road.

    Thanks for your understanding.

    Best Regards,

    Frankie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 20, 2018 7:16 AM
    Moderator
  • Congratulations on solving this issue that has plagued the community for at least 10 years!

    Would you be so kind as to post your "little program"?

    • Edited by Bull099 Friday, September 28, 2018 12:01 PM
    Friday, September 28, 2018 12:00 PM
  • Hi,

    Why I can use  Microsoft Visual Studio Installer Projects in offline network without internet conneciton ?

    Thanks

    Saturday, August 10, 2019 6:32 AM