No announcement yet.

Updating and uninstall registration

  • Filter
  • Time
  • Show
Clear All
new posts

  • Updating and uninstall registration

    When I'm updating an application that I've installed with Setup Factory to a new version, what's the right way to get the "Uninstall" in Windows registered for the new version with the old version removed. As I'm doing it now, my update goes in, applies replacing files as needed, but the result is I have two entries in the Uninstall list, one for the previous and one for the current version.




  • #2
    In order to have a single entry in the Control Panel, your installers should use the same unique registry key. If they share the same key, the uninstaller entry will be overwritten, instead of creating new ones.

    Another way avoiding this problem would be detecting the previous version, and running the uninstaller in the On Pre Install of the project, so the Control Panel is cleaned before the new entry is added.



    • #3
      Thanks Ulrich. I definitely do not want to do a full uninstall. That was one of our key goals with moving to Setup Factory. We were having to with MSIs build with old Wise stuff due to issues I won't elaborate on here.

      I want to keep the version number on the uninstall list. So would you suggest changing the uninstall control panel Description to %ProductName% - %ProductVer% and the Unique registry key to %ProductName% only?


      • #4
        What are the implications to the ability of the system to do an "Complete Uninstall", if I continue to use the same "unique registry key" for each update? If I had a 1.0.0 version installed, and "updated" it to a 1.0.1, using the same "unique registry key" for the uninstall, if a user did an uninstall, would they then end up back to version 1.0.0?


        • #5
          If you use just the %ProductName% as registry key, then the uninstaller will be overwritten. If the uninstaller is executed, the latest product is uninstalled, but there may be some legacy files left on the user's system, which you could clean up manually in the On Post Uninstall event script. The uninstaller won't perform a version rollback, unless this is something you write code for by yourself. This would mean that you also have to include code to create backup copies of all files during the On Pre Install event script...



          • #6
            So, that's good, that it will treat the updated install independently and not try to rollback if it is uninstalled. Works for me. I'm already deleting obsolete files during an update - have a standard script block for it in my On Post Install section. (oops, looks like we could skip the "if File.DoesExist". My offshore dev did that

            -- BEGIN: Delete obsolete files
            for _,v in pairs(obsoleteFiles) do
            	if  File.DoesExist(filename) then 
            		File.Delete(filename, false, false, true, nil); 
            -- END: Delete obsolete files