views:

130

answers:

2

I'm trying to deploy an ASP.NET application using InnoSetup.

I need to perform the following tasks:

  1. Create an IIS application.
  2. Create a new IIS application pool and set it's .NET version to 4.
  3. Set the application pool of the new application to the new application pool.

I have found a script to create a virtual directory, but I need an application and application pool:

procedure CreateIISVirtualDir();
var
  IIS, WebSite, WebServer, WebRoot, VDir: Variant;
  ErrorCode: Integer;
begin
  { Create the main IIS COM Automation object }

  try
    IIS := CreateOleObject('IISNamespace');
  except
    RaiseException('Please install Microsoft IIS first.'#13#13'(Error ''' + GetExceptionMessage + ''' occurred)');
  end;

  { Connect to the IIS server }

  WebSite := IIS.GetObject('IIsWebService', IISServerName + '/w3svc');
  WebServer := WebSite.GetObject('IIsWebServer', IISServerNumber);
  WebRoot := WebServer.GetObject('IIsWebVirtualDir', 'Root');

  { (Re)create a virtual dir }

  try
    WebRoot.Delete('IIsWebVirtualDir', 'eipwebv4');
    WebRoot.SetInfo();
  except
  end;

  VDir := WebRoot.Create('IIsWebVirtualDir', 'eipwebv4');
  VDir.AccessRead := True;
  VDir.AccessScript := TRUE;
  VDir.AppFriendlyName := 'Easy-IP Web Client';
  VDir.Path := ExpandConstant('{app}');
  try
    VDir.AppPoolId := 'Classic .NET AppPool';
  except
  end;

  VDir.AppCreate(True);
  VDir.SetInfo();
end;
A: 

There you go: http://learn.iis.net/page.aspx/285/provisioning-sample-in-c/

Scroll down Create Application Pool. It will show you how to create the AppPool, Application and VirtualDirectories.

Jeroen
Thanks, but I'm looking for an example using Innosetup.
norgepaul
ah missed that.
Jeroen
A: 

Did you ever find a solution to this? I'm looking at this stuff now myself

Justin
Nope, still hoping :o) Please post it here if you find something.
norgepaul