+ Reply to Thread
Results 1 to 2 of 2

Thread: Question about Custom Uninstall Includes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2015
    Location
    CA, Unitedd States
    Posts
    130

    Post Question about Custom Uninstall Includes

    Hello

    Everyone, I was wondering if I had the script logic right to optionally do a completely clean uninstall.

    The goal: run the regular uninstall, after processing the uninstall cue ask the user if they wish to remove any remaining files (such as user-created items not included in the original install). if the user answers "yes" to the question, remove any remaining items then remove the install directory itself. here's what I came up with:

    Code:
    ! //////////////////////////////////////////////////////////////////////////////////////////////////
    ! //
    ! //   SSSS S  BBBBBB
    ! //  S    SS   B    B
    ! //  S     S   B    B
    ! //  S         B    B
    ! //   SSS      BBBBB         SetupBuilder Uninstall Project Script
    ! //      SS    B    B
    ! //        S   B    B        Created with build: 10.0.5710
    ! //  S     S   B    B
    ! //  SS    S   B    B
    ! //  S SSSS   BBBBBB
    ! //
    ! //////////////////////////////////////////////////////////////////////////////////////////////////
      
    #pragma UNINSTALL = "1"
      
    If %_SB_INSTALLERFLAG% Does Not Equal "1" on Position "$SB_SILENTMODEFLAG$" Then
       Display Message Box ("#UNINST_CONFIRM#", "#UNINST_HEADING#")
    Else
       Set Variable %_SB_RETURN% to "$IDYES$"
    End
      
    If %_SB_RETURN% Equals "$IDYES$" Then
       ! --- Process uninstall queue ---
       Process Uninstall Queue
       ! Display message box confirming a complete removal
       Display Message Box ("Would you like to remove ALL files and folders which were added AFTER the initial installation?
    
    **** NOTE: VERY IMPORTANT! ****
    
    ANSWERING "YES" TO THIS QUESTION WILL REMOVE ALL FILES AND FOLDERS THAT WERE NOT INSTALLED INITIALLY WITH THE PROGRAM!
    
    THESE ARE USUALLY FILES CREATED BY THE USER AND SHOULD BE BACKED UP TO AVOID DATA LOSS.", "Remove User Information?") [Noisy]
       If %_SB_RETURN% Equals "$IDYES$" Then
          ! Delete all items in the installation folder then delete the folder itself if the user answers "YES" to the question above
          Delete File(s) ("%_SB_INSTALLDIR%\*.*")
          Delete Folder ("%_SB_INSTALLDIR%")
       End
      
       If %_SB_ERRORCODE% Equals "0" And %_SB_INSTALLERFLAG% Does Not Equal "1" on Position "1" Then
          Display Message Box ("#UNINST_FINISH#", "#UNINST_HEADING#")
       End
    End
    Did I get the logic right?

    This is my first time experimenting with customizing the uninstaller, so given enough tine of doing this, and I'm sure it'll be second nature to me like check box dialogs.

    Thanks for any help.

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Question about Custom Uninstall Includes

    Hello,

    yes, looking good. I am using the following in the SetupBuilder installer.

    Friedrich
    Attached Images Attached Images  

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •