instrumentally
04-06-2017, 07:43 PM
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:
#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?
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:
#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?