Announcement

Collapse
No announcement yet.

Uninstall former version (Custom screen)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Uninstall former version (Custom screen)

    Uninstall former version of product

    If you wish to uninstall the existing version of your product automatically when your customer runs the installer made with Setup Factory of a newer (or the same) version, you can use this screen and script:



    This is a custom screen, and of course you can customize the layout, captions and number of objects as needed.

    Download location and further info

    MindQuake

  • #2
    Hello Ulrich:

    I adopt the Uninstall former version (custom screen) and found one problem as below:

    1. In the On Pre Install script as below:
    ---------------------------------------------------
    -- check if uninstall was requested
    if (bRequestedUninstall) then

    if (File.DoesExist(sMyUninstallInfo[1])) then



    Application.Minimize();
    -- perform a silent uninstall of the application
    -- add quotes to configuration file argument (it may contain spaces) and add /S at the end
    res = File.Run(sMyUninstallInfo[1], '"'..sMyUninstallInfo[2]..'" /S', "", SW_SHOWNORMAL, true);
    error = Application.GetLastError();
    if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    else
    SetupData.WriteToLogFile("Info\tUninstallation performed successfully\r\n", true);
    -- wait for the uninstaller to be deleted in the background
    -- before deploying the new files (it can take a second or two)
    StatusDlg.Show();
    StatusDlg.SetTitle("Deleting old version");
    StatusDlg.SetMessage("Please wait...");
    StatusDlg.ShowProgressMeter(false);
    while File.DoesExist(sMyUninstallInfo[1]) do
    SetupData.WriteToLogFile("Waiting one second...\r\n", true);
    Application.Sleep(1000);
    end
    StatusDlg.Hide();
    end
    Application.Restore();
    -- wait for the uninstaller to be deleted in the background before deploying the new files



    else
    SetupData.WriteToLogFile("Error\tUninstaller could not be found!\r\n", true);
    end

    end
    ------------------------------------------

    when install found previous version and I decide to uninstall previous version therefore the uninstall.exe is calleded to execute the uninstall process.

    But if I choose cancel button in uninstall.exe screen and then confirmed to abort the installation procedure the whole procedure still executed the On pre Install script and status window shows "Please wait..." message all the time. Actually it did not exist setup installation process only exist uninstall.exe process.

    Is there any solution to fix the problem?

    Bst Regards,

    Daniel Lee 2013/5/26

    Comment


    • #3
      The problem is that you missed the instruction to allow your uninstaller to be processed silently. If you want to offer aditional choices to cancel the uninstaller, then you need to make changes to the script.
      If you didn't set your project correctly, the /S parameter will be ignored.

      Ulrich

      Comment


      • #4
        Hello Ulrich:

        I offer manual Uninstall in control panel add/remove my application. I also offer uninstall shortcut in startmenu->Appfolder.
        Could you guide me how to set uninstaller to be processed silently during former version found auto deleting process and the manual uninstaller in startmenu->Appfolder did not as silent process?

        Thanks.

        Daniel Lee 2013/05/28

        Comment


        • #5
          First of all, just to let you know, there should be no shortcut to the uninstaller in the Start menu, according to current software deployment guidelines. For more information, see the guidelines for "Start menu files" in the Dev Center at Microsoft.

          If you want to allow a silent uninstall, all you need to do is enable the option in the project settings: Uninstall > Settings > Options > Allow silent uninstall. You can also find this information on my web page, linked in the initial post in this thread.

          Ulrich
          Last edited by Ulrich; 05-28-2013, 06:09 AM.

          Comment


          • #6
            Hi Ulrich:

            I follow your suggestion to set uninstall as silent mode and it works normally.
            Thanks.

            Danel Lee 2013/05/29

            Comment


            • #7
              Hello Ulrich,
              Sorry for reply this old topic, but seems like the link provided (http://www.mindquake.com.br/en/screens/uninstall) is no longer pointing to the "Uninstall former version" mentioned, and that would be really useful for me.
              Could you please send us another link?

              Thanks,
              Rodrigo FF.

              Comment

              Working...
              X