I am trying to uninstall an application installed with Inno Setup from another Inno Setup installer. I am able to find the uninstall string from the registry but I am not able to execute it silently. I am using RemoveQuotes()
function of Inno Setup as below:
RunProcess(RemoveQuotes(sUnInstallString), '/SILENT');
But it the uninstaller window is still visible.
Where RunProcess()
method is given as:
function RunProcess(name : String; args : String) : Integer;
var
path : String;
dir : String;
errorCode : Integer;
begin
path := ExpandConstant(name);
dir := ExtractFileDir(path);
Log(' Running: ' + path + ' ' + args + ' ...');
Exec(path, args, dir, SW_SHOWNORMAL, ewWaitUntilTerminated, errorCode);
if errorCode = 0 then
Log(' Succeeded.')
else
Log(' Failed. Error Code: ' + IntToStr(errorCode));
Result := errorCode;
end;