+ Reply to Thread
Results 1 to 4 of 4

Thread: Custom Uninstall failure

  1. #1

    Question Custom Uninstall failure

    All I wish to do is instruct the uninstaller to remove a few files that will exist in a folder which were not present during the installation. These would be scratch files that did not exist during the install. I am used to Wise Install permitting the developer to insert a line of code into the install.log which would easily perform this task, but with SetupBuilder, the task seems overly complex.

    As per the sbuilder.pdf, I tried to follow the instructions on creating a custom uninstall script. The instructions seem lacking in detail.

    I can't even get the following script to compile. SB10Dev generates a "Unable to compile an Include script" message with the following code:

    Code:
    #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 ---
       /* Delete Files "%_CSIDL_LOCAL_APPDATA%\[PRODUCTNAME]\zipcodes.ndx" */
       /* Delete Files "%_CSIDL_LOCAL_APPDATA%\[PRODUCTNAME]\zipdiffs.ndx" */
       /* Delete Files "%_CSIDL_LOCAL_APPDATA%\[PRODUCTNAME]\zipdiffs.dbf" */
       Process Uninstall Queue
       
       If %_SB_ERRORCODE% Equals "0" And %_SB_INSTALLERFLAG% Does Not Equal "1" on Position "1" Then
          Display Message Box "#UNINST_FINISH#" -- "#UNINST_HEADING#"
       End
    Else
       /* Display Message Box "SKIPPED\n\n%_CSIDL_LOCAL_APPDATA%\[PRODUCTNAME]\zi..." -- "SKIPPED" */
    End
    The sbuilder.pdf makes no mention whether variables defined in the install script are accessible in the uninstall script. I don't know if [PRODUCTNAME] is valid, even if I were to un-comment the commented out lines above. Moreover, the sbuilder.pdf file does explain how a custom uninstall script (even if it were to compile successfully) gets linked to the install project. How does the install project know that a separately compiled uninstall script is supposed to be relevant and linked to the final deployment?

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

    Default Re: Custom Uninstall failure

    Hello,

    You have to add your uninstall (.sbi) script to your MAIN .sbp project and then compile. Or send me your main .sbp and I'll do it for you.

    Does this help?

    Friedrich

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

    Default Re: Custom Uninstall failure

    IMO, the task is not complex at all. "New Project..." | "Uninstall Include Script...". Then add whatever you would like to do in your custom uninstall. The IDE generates all the default script lines for you in the standard custom uninstall. Add this newly created uninstall .sbi to your main script, compile and you are done.

    Very often, adding lines to the uninstall .log is simply not enough. You can use ALL script functions (except Install Files of course) in a custom uninstall. Similar to the attached...

    Just let me know if you need more help.

    Friedrich
    Attached Images Attached Images   

  4. #4

    Default Re: Custom Uninstall failure

    Does this help?
    Yes, your instructions helped. Thank you.

+ 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
  •