This is my function to remove the directory after uninstalling. Basically, in my .ism file, there are 2 .rul files(setup.rul and VerGetFileProperty.rul). I have added some code to clean the directory in setup.rul. I build, and one setup.exe is formed. While I run setup.exe, it will ask me to select the db, if I select a db, its says the db server is not found. But if I run the original setup, it will auto detect db server and install. How is the setup.exe getting created? I haven't made any changes on searching for db server part. I have just created a function to remove the directory while uninstalling.
function fnClean()
NUMBER nrv;
begin
if (ExistsDir (INSTALLDIR ^ "XYZ Dir") = EXISTS) then
SetDialogTitle(DLG_ASK_YESNO,"Delete Logs");
nrv = AskYesNo( "Do you want to delete all log files now? Say No if you prefer delete them later manually.", YES );
if ( nrv ) then
nrv = DeleteDir (INSTALLDIR ^ "XYZ Dir", ALLCONTENTS);
DeleteDir (INSTALLDIR, ALLCONTENTS);
endif;
else
DeleteDir (INSTALLDIR, ALLCONTENTS);
endif;
end;