I'm currently writing an Inno installation script for an application I'm writing and i've run into an interesting problem. My application is an ASP.NET MVC 4 application which I want to run through IIS.
The installation script I'm writing checks that IIS is installed on the machine and if it is not present will install it via a call to pkgmgr. The problem I've got is that the check function I'm using tells me IIS is installed even though that's not the case
[Code]
const
IISRegKey = 'SOFTWARE\Microsoft\InetStp';
function GetIISVersion(var MajorVersion, MinorVersion: DWORD): Boolean;
begin
Result := RegQueryDWordValue(HKEY_LOCAL_MACHINE, IISRegKey, 'MajorVersion', MajorVersion) and
RegQueryDWordValue(HKLM, IISRegKey, 'MinorVersion', MinorVersion);
end;
function IsIIS75AboveInstalled: Boolean;
var
MajorVersion: DWORD;
MinorVersion: DWORD;
begin
result := GetIISVersion(MajorVersion, MinorVersion) and (MajorVersion >= 7);
end;
While testing I have installed IIS and uninstalled, I initially thought the problem was that the registry keys I'm checking still existed after the uninstall, but i've manually deleted those keys and the problem remains so i'm not sure why the call to read the registry key still reports a valid value? I would expect it to error or give a 0 value