PDA

View Full Version : Learning how to make custom uninstall..question



NewsArchive
04-28-2011, 12:07 AM
I need to delete two directories during uninstall. Have I got the script
right?

#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
Delete Folder "%_CSIDL_COMMON_DOCUMENTS%\Blue Line
Technologies\PDManager"
Delete Folder "%_SB_INSTALLDIR%\PDManager"

If %_SB_ERRORCODE% Equals "0" And %_SB_INSTALLERFLAG% Does Not Equal "1"
on Position "1" Then
Display Message Box "#UNINST_FINISH#" -- "#UNINST_HEADING#"
End


Thanks!

Don

NewsArchive
04-28-2011, 12:10 AM
> I need to delete two directories during uninstall. Have I got the script
> right?

Yes, perfect! This will delete the folders if they are empty.

BTW, if the installer created the folders, then there is no need to do this
in a custom uninstall.

Friedrich

NewsArchive
04-29-2011, 01:16 AM
Yes sir, that's what I thought, but all are not deleted during uninstall on
my end. My custom uninstall is not working either.

Thanks,

Don

NewsArchive
04-29-2011, 01:16 AM
Hi Don,

> Yes sir, that's what I thought, but all are not deleted during uninstall
> on my end. My custom uninstall is not working either.

Then I assume you still have files and/or subfolders in the directories.
That's why the "standard" uninstall can't remove the folder(s).

And if your custom uninstall is not working either, then there must be
another problem. First of all, I would make sure that the custom uninstall
is running at all. Display a "dummy" message box to see if your custom
uninstall is called. Then I would check the return value of the "Delete
Folder" functions -- if the function succeeds, the %_SB_ERRORCODE% return
value is nonzero. If it is zero, then the folder is 1) not empty or 2)
"locked".

Friedrich

NewsArchive
04-29-2011, 01:20 AM
Will do.. thanks!

Don

NewsArchive
04-29-2011, 01:20 AM
Custom uninstall script not being called. Inserted message box. Did not
fire....

Don

NewsArchive
04-29-2011, 01:21 AM
> Custom uninstall script not being called. Inserted message box. Did not
> fire....

Then you did not add the custom uninstall script to your main project ;-)
Or you already have an "old" uninstall application on that test machine and
you forgot to update it (see "Overwrite Existing Uninstall Application"
option in your "Create Installation App & Log" script function).

Friedrich

NewsArchive
04-29-2011, 01:21 AM
Hot damn! That did it Friedrich! THANK YOU!

Don

NewsArchive
04-29-2011, 01:21 AM
>
> Hot damn! That did it Friedrich! THANK YOU!
>

You are welcome :)

Friedrich