No announcement yet.

Uninstall older version.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Uninstall older version.

    Good morning, reviewing the installation windows, i came upon an issue, when i tried to generate an uninstall an older version window i was unable to found it anywhere, as this is a pretty standard window in all kind of installers i'm wondering why there is none to be found in setup factory?

    Can you please help me in here? as i don't know how to generate an uninstall older version of the program inside my installer project. And i seriously need it ASAP.
    Thanks and ill be awaiting a reply.

  • #2
    The screen I developed is a custom screen, and in its On Preload event script a search is performed in the registry for a previous install of the current product. In case no previous install was found, the screen is skipped and the next dialog would be shown instead. In the case that the product had been installed previously, the screen is displayed, offering a checkbox to perform a uninstall of the existing version. The script can be modified further, if needed, of course. ​The removal of the existing product happens during the On Pre Install event script, also using custom Lua script. For this to be as smooth as possible, it is best to allow silent uninstallation, which is an option/feature set in the uninstall settings of your project. Of course, if the existing product was deployed using an uninstaller which was not configured to allow a silent uninstall, the product cannot be removed in unattended mode - the user will need to click through the uninstaller screens. The updated version can change this behavior, so the next upgrade or reinstall could be performed with less user interaction.

    ​Automatic uninstallation, modification or repair of an existing installation is a feature of Windows Installer based setups, which is not the case of Setup Factory. You could get this function automatically if you create your setup with MSI Factory (and it causes issues in many cases when the removal of the existing product is not desired), but in a more flexible and scripted environment like Setup Factory, you have full freedom to perform these tasks in the manner you want or need.

    If you need assistance with your project, please contact me at my site, and send me the project file. I can add the screen and required code to your project for you.



    • #3
      Ok thank you very much, mindquake its the site right? In there i can only find the contact form, but cant find a way to send the project file.


      • #4
        I just sent you an email to the address associated with your forum user account.



        • #5
          HI Ulrich,
          May I request for the screen and code for the installation of older version of the application for setupfactory?


          • #6
            Hello Team,
            Iam using MSI factory version 2.2.1000.0 , I want custom uninstall using lua script, please share the script todo silent uninstall for previous version

            advanced thanks


            • #7
              Originally posted by arun View Post
              Iam using MSI factory version 2.2.1000.0 , I want custom uninstall using lua script, please share the script todo silent uninstall for previous version
              This sub forum is for Setup Factory, not MSI Factory. MSI Factory uses Windows Installer, where you should follow appropriate rules/settings to uninstall a previous version as part of the new deployment process.



              • #8
                Hello Sir, Thank you very much for guiding me,

                My requirement customer can install anydirectory, anyfolder in his system. on the next upgrade version I have to find if customer installed previous version
                then uninstall silently.

                MSI factory/settings incrementing upgrade code does uninstall any previous version automatically,
                But I need custom .lua script to uninstall the installed MSI

                prevInstance = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uni nstall\".."myproduct", "DisplayVersion", true);

                //run uninstaller script

                ​Can you give me the script to uninstall,

                Advanced thanks for your support,

                thanks & regards,

                Attached Files


                • #9
                  Hello Sir,

                  Can you help

                  prevInstance = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\ \Uni nstall\".."myproduct");

                  if(prevInstance) then

                  -- Confirm that the upgrade executable should be launched.
                  result = Dialog.Message("Confirm", "Are you sure you would like to upgrade now?", MB_YESNO, MB_ICONINFORMATION, MB_DEFBUTTON1);

                  -- If the user clicked the Yes button.
                  if (result == IDYES) then
                  -- Run the installation file.
                  File.Run(msiexec /x "myproduct.msi" /q);


                  • #10
                    Registry.GetValue() expects a third argument, which is the value to be read. You are not providing the name of the value to be retrieved, so the code pasted above will cause a runtime error.

                    File.Run() expects an executable name as the first parameter, and the second argument should hold the parameters. You are not providing a valid executable name (it should be in quotes and end with ".exe", and any quotes in the parameters should be escaped. Again, the code as shown above is expected to fail.

                    These explanations can be found in the product documentation, please read it first to understand how to write Lua script with proper syntax.
                    Finally, if your product was installed with Windows Installer, the simplest way to uninstall is retrieving the value of ÜninstallString, parse the string, and construct the proper command for File.Run() or MSI.RunMsiexec() to uninstall the software.



                    • #11
                      Hello Sir, thank you very much,

                      is_there = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\ITS\\myproduct");

                      File.Run('msiexec.exe', '/x', 'C:\Program Files\ITS\MSICLIENT\myproductclient.exe', '/qn');
                      Dialog.Message("MSI Message ", "Previous installation uninstalled silently", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
                      Dialog.Message("MSI Message ", "no previous version", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

                      the above code deteching previous installation, but when uninstalling it got some error,
                      can you give me the correct one
                      File.Run('msiexec.exe', '/x', 'C:\Program Files\ITS\MSICLIENT\myproductclient.exe', '/qn');

                      Other than this location, if customer installed somewhere in the system, how do we find msi installed location and uninstall?

                      thanks & regards


                      • #12
                        Hello Sir,

                        Kindly ignore the previous

                        is_there = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\ITS\\Rezzervi");


                        File.Run("msiexec.exe" /x "F:\1MSI\msiinstaller_output\MSIClient.msi" /quiet);

                        Dialog.Message("MSI message ", "no previous version", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);

                        How to do uninstall by lua script File.Run
                        can you correct this one,

                        File.Run("msiexec.exe" /x "F:\1MSI\msiinstaller_output\MSIClient.msi" /quiet);

                        in dos command prompt it is working fine with product code and full path of the MSI
                        msiexec /x {3B3BBADA-86EA-4ACA-AF53-42F400761251} /qn
                        msiexec /x "F:\1MSI\msiinstaller_output\MSIClient.msi" /quiet​

                        thanks & Regards,


                        • #13

                          if you have a license for Setup Factory, please associate your forum user name with your customer account (this can be done in the Customer Portal). You can also provide your serial number via the contact form. If you have a license, I am happy to help further, once the information you sent was confirmed.

                          How your problem should be resolved was already explained in a previous reply, but if you want me to assist further, you need to have a license. I do not spend my time giving free consulting to "perpetual" evaluation users or those who "found" a serial number on the internet and come to this place asking for help. Thank you for understanding.