I have read many articles and blogs online on writing a custom action in Visual Studio, however the approach for doing the same is not at all clear to me. My setup project is in C++. Can anyone please guide step-by-step how to go about writing a custom uninstaller in C++.
My setup project creates the following file structure:
Setup
-->Input-->file.txt
-->Program-->PrimaryOutput(Active)
-->Output
On successfull, run of the setup, files are created inside the output folder, which remains there during unistall of the setup. How can I write a custom uninstaller in c++ for completely deleting all files after uninstall.
Edit: I have been able to create custom action template like this:
#include "stdafx.h"
extern "C" UINT _stdcall Install(MSIHANDLE hInstall)
{
return ERROR_SUCCESS;
}
extern "C" UINT _stdcall Commit(MSIHANDLE hInstall)
{
return ERROR_SUCCESS;
}
extern "C" UINT _stdcall Rollback(MSIHANDLE hInstall)
{
return ERROR_SUCCESS;
}
extern "C" UINT _stdcall Uninstall(MSIHANDLE hInstall)
{
return ERROR_SUCCESS;
}
How should I proceed to write code for deleting Output folder in Uninstall method.