0

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

Nathan Hadley
  • 100
  • 1
  • 10
  • 1
    I guess you've deleted the 64-bit registry key whilst you query the 32-bit one from Inno Setup... But it's just a guess. – TLama Jun 06 '14 at 09:21
  • Thanks for your reply TLama, I think you're correct although I can't reproduce the issue now as my test server has been restored. Something must have gone wrong with the removal during one of my tests which left the keys in place. Actually my next job is to figure out why Inno is trying to install my 64-bit application as 32 bit. – Nathan Hadley Jun 06 '14 at 10:34
  • 1
    As probably you do not set `ArchitecturesInstallIn64BitMode=x64` in `[Setup]` section. By Default Inno is running in 32-bit mode. – RobeN Jun 06 '14 at 12:34
  • Yes this was the case thank you RobeN – Nathan Hadley Jul 02 '14 at 10:45

0 Answers0