- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- DELETE FILE
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
DELETE FILE
I am not able to delete the file using custom action .Is there something wrong with the script.
can someone provide the script to delete the file
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @sreelakshmi ,
First we should make sure the path to file is correct, and at the time of customaction execution the file should be available in the path,
Please refer our installscript sample code for deleting a file,
Sample code to delete file from installdir:, You this code and create a installscript CA and sequence it proper order, If the file is installed by your installer then i suggest you to sequence it to, After installfinalize
function ExFn_DeleteFile(hMSI)
STRING szMsg;
STRING szInstallDir;
INT nvSize;
begin
nvSize= MAX_PATH;
if MsiGetProperty(hMSI, "INSTALLDIR", szInstallDir, nvSize) = ERROR_SUCCESS then
MessageBox( "[INSTALLDIR] = '" + szInstallDir + "'", INFORMATION);
else
MessageBox( "Could not retrieve value of [INSTALLDIR] !!", WARNING);
endif;
MessageBox("szInstallDir is= " + szInstallDir, INFORMATION);
DeleteFile(szInstallDir+"\\Test.config");
end;