KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Configuring IIS6 Application Settings

Hi there,

I am currently using the Advanced Installer evaluation copy to test out whether It would be viable to streamline the installation of an older application our company offers. The program installation requires that an IIS6+ server is enabled on the target machine (Windows 7 for testing but Windows XP support will be needed) and once It has been enabled there are specific settings that need to be changed for the program to run correctly.

The main IIS Settings that need implemented are:

HTTP Header Content Expiration : Immediately
ASP Script Timeout : 300 ms

Any help on implementing these settings as part of the installation would be greatly appreciated.

Thanks,
Kyle
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Update

Hi Daniel,

Thanks for the email reply. (Copied below for anyone else with the same question)
Unfortunately, we don't have predefined support for configuring the HTTP Expires Response Headers. We already have this improvement on our TODO list and it will be available in a future version of Advanced Installer.
Until then, as a workaround you can use your own custom action in order to achieve this.

For example you can create your own BAT file (file.bat) containing the following command line:

appcmd.exe set config /section:staticContent /clientCache.cacheControlMode:DisableCache

After this you can add, in "Files and Folders" page, the file.bat as a temporary file to your installation project. Then, from "Custom Actions"
page you can add a "Launch file" custom action with sequence, scheduled as deferred with no impersonation just before "Install Execution Stage
-> Finish Execution -> InstallFinalize" standard action, like this:

File To Launch: [&file.bat]
Working Directory: [SystemFolder]\inetsrv
Am I able to change the ASP Script Timeout in a similar fashion or even at the same time ?


I am having trouble with the actual install of the IIS configuration as well. I run the installer and it fails on "Configuring Internet Information Services", which invokes the roll-back procedure. However the roll-back does not remove the Application pool and Web site that the installer created. If I run the installer once more while these components are already installed in IIS Manager the setup completes, but does ask to skip the installation of the App pool and Web site as they are already installed. Removing these components from IIS and reinstalling leads to the same initial error on "Configuring I. I. S.".

When the installer completes fully there are still errors which persist as I am unable to edit or view any settings for ASP in IIS Manager. I am presented with the very unhelpful error of :

There was an error while performing this operation.
Details:

Filename:
\\?\C:\Windows\system32\inetsrv\config\applicationHost.config
Error:
I am confused as to what is causing this. I emailed is a copy of the verbose log from the initial install process and roll-back, as well as the .AIP file used to create the installer.


Thanks for your help,
Kyle
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Configuring IIS6 Application Settings

Hello Kyle and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.
Am I able to change the ASP Script Timeout in a similar fashion or even at the same time ?
Yes, you should be able to achieve this using a custom action too. Please take a look on "Configure the HTTP Expires Response Header" and "Set script time-out" articles which could be useful for you.
I am confused as to what is causing this. I emailed is a copy of the verbose log from the initial install process and roll-back, as well as the .AIP file used to create the installer.
Please give us some time to investigate this and we'll get back to you as soon as we have a conclusive answer.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Re: Configuring IIS6 Application Settings

Thanks for the reply email, I created another installer project and simplified the install to ensure the basic components were installing fine - and that it wasn’t another feature which was causing my problems. This removed the initial error with configuring the IIS settings and allows for an 'error-free' install and uninstall (including removing app pool and web app from IIS Manager).

However, the problem still persists where I am unable to view any of the web applications settings in IIS and am presented with the unhelpful error. (attachment: IISM Error.JPG)

I have added the debug IIS.dll to my AI installation and rebuilt and installed my application on the target machine. The Configuring IIS part of the installation throws an error (attachment: Install Error.JPG), which I choose Ignore to and the installation completes.

I have attached the simplified AIP file, the new debug log, and two images of the errors in a hope that this will give you some more information on my problem.

Much appreciated!

had to zip my attachments as there were 4 and there is a limit of 3.
Attachments
aip, AI_IIS log and error images.zip
(111.62 KiB) Downloaded 853 times
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Re: Configuring IIS6 Application Settings

Help is greatly needed ^ ;)

Thanks, Kyle
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Configuring IIS6 Application Settings

Hello Kyle,

I apologize for my delayed reply, yesterday here was a National holiday, so we had a day off.

It seems this happens because the "aspnet_regiis.exe" is not found on target machine. This may happen if .NET Framework 4.0 is not properly installed. Can you please try to reinstall .NET Framework 4.0 and try again? Also, can you please check if your application pool runs properly after it is installed?

You can also try to set your web applications to use .NET Framework 2.0 and see if the behavior still persist.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Re: Configuring IIS6 Application Settings

Hi Daniel,

No bother everyone needs their holidays! Thanks for getting back sharply on your return.

I have reinstalled .NET 4.0 Full on the target machine and I am now able to view the ASP settings in IIS Manager, however the error the debug .dll still shows an error regarding assertion failure with ISSPackageMgr.cpp stating "unsupported parent type". How am I able to resolve this issue?

Having further investigated the differences between the ASP settings on an already installed machine versus the newly installed target machine I noticed that the default document page only pointed to the main default.asp and not the other files. Using the 'Revert to parent' setting in IIS Manager fixed this problem and browsing to localhost/IISName/ shows the correct page.

Thanks again for your help!

Kyle
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Configuring IIS6 Application Settings

Hello Kyle,
I have reinstalled .NET 4.0 Full on the target machine and I am now able to view the ASP settings in IIS Manager, however the error the debug .dll still shows an error regarding assertion failure with ISSPackageMgr.cpp stating "unsupported parent type". How am I able to resolve this issue?
It seems this is an Advanced Installer issue. Can you please replace the sent debug version of the iis.dll with this release version of iis.dll and see if the behavior still persist? The release version should contain a fix for the related issue.
Thanks again for your help!
You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Re: Configuring IIS6 Application Settings

Hi again,

Tried again with the default iis.dll file and now installs without an error.

Now the basic installation works I have implemented the additional features needed; leaving just two final steps. Implementing the IIS configuration batch file executions and setting IIS_IUSRS permissions to Full control.

I have an error free installation without implementing the above changes but adding either I encounter problems.

Adding IIS user permissions to my APPDIR, I am no longer able to view asp.net settings or reach the launchpage at localhost/MyIISName due to insufficient permissions - despite setting full control to IIS_IUSRS in the files and folders view. I actually need to be able to add IIS_IUSRS access to the parent folder of my APPDIR (IE. allowing IIS_IUSRS full control of CompanyName and subfolders instead of just ProductName and subfolders (C:/CompanyName/ProductName))

Adding the scripts in separate batch files (couldn't resolve temporary file in Advanced Installer so i installed the batch files to appdir)

I used the custom action of "Launch File" with the settings below ( I tried using the help files online but the pages appear to be outdated and reference custom actions which have been superseded in newer AI versions?)
File to launch: [#disableCache.bat]
Batch file content: appcmd.exe set config /section:staticContent /clientCache.cacheControlMode:DisableCache
Command Line: left blank
Working Directory: [SystemFolder]\inetsrv

Deferred, No Impersonation
File to launch: [#scriptTimeout.bat]
Batch file content: appcmd.exe set config /section:asp /scriptTimeout:00:00:03
Command Line: left blank
Working Directory: [SystemFolder]\inetsrv

Deferred, No Impersonation
EDIT: I have found that the scripting problem is to do with the "scriptTimeout" batch file; installing and executing the disable cache script runs fine on install and the changes are reflected in IIS Manager.

I am still having problems with assigning permissions to the C:/CompanyName folder, any help you can give is, as always, greatly appreciated.

Thanks again,
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Configuring IIS6 Application Settings

Hello Kyle,
Adding IIS user permissions to my APPDIR, I am no longer able to view asp.net settings or reach the launchpage at localhost/MyIISName due to insufficient permissions - despite setting full control to IIS_IUSRS in the files and folders view. I actually need to be able to add IIS_IUSRS access to the parent folder of my APPDIR (IE. allowing IIS_IUSRS full control of CompanyName and subfolders instead of just ProductName and subfolders (C:/CompanyName/ProductName))
Please keep in mind that when adding permissions to a folder, from "Files and Folders" page, using our "Permissions" support the specified folder permissions are created from scratch (they will not be added to the default Windows permissions). So, if you add permissions (in "Permissions" tab) for IIS_IUSRS user group, then only the related permissions will be set for the related folder at install time (the default Windows permissions will not be set). This may cause some permissions conflicts.

However, in order to achieve what you want can you please remove the related permissions (IIS_IUSRS -> Full Control) added in "Permissions" tab and see if the behavior still persist? Also, you should make sure that the "Allow anonymous web access" option, from "Authentication" tab, is enabled.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Re: Configuring IIS6 Application Settings

Hi again Daniel,

I have tried without the files & folders permissions setting and that allows the IIS to view the settings and the launch page of my IIS Server; but I need to be able to set IIS_IUSRS to have full control of my C:/CompanyName folder in order for parts of my IIS site to work. How should I go about doing this?

It is just this and the changing script timeout setting which I need to have running and then this will be complete.


Thanks, Kyle
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Configuring IIS6 Application Settings

Hello Kyle,

In order to achieve this you can use a custom action which will add full control permissions for IIS_IUSRS on your CompanyName folder. For example you can use a BAT file (myFile.bat) with the following command line:

Code: Select all

cacls %1 /t /e /c /p IIS_IUSRS:f
Then, you can add the BAT file as a temporary file (in "Files and Folders" page) to your project and launch it using a "Launch File" custom action with sequence, scheduled after "Install Execution Stage -> Add Resources" action group. The custom action should be configured like this:
  • File To Launch: [&myFile.bat]
    Command Line: "[WindowsVolume][Manufacturer]"
Also, the custom action should run as deferred with no impersonation.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Re: Configuring IIS6 Application Settings

Hi Daniel,

Thanks for the reply. Have tried to implement the above but it appears cacls.exe has been superseded by Icacls.exe which I am trying to get going.

I have added the batch file to the project and used deferred no impersonation but I am unable to correctly assign the permissions with Icacls.exe.

I am currently using:

Icacls \ /grant IIS_IUSRS:(F) /T
pause


to grant IIS_IUSRS full permission in the sub-directory its run from (C:/BM) with permissions being applied to the subfolders (/T) but I get an access denied error when running this batch.


EDIT

Running as Administrator fixed the above problem but still having trouble with the script timeout



Thanks again, Kyle.
KyleBM
Posts: 9
Joined: Mon Aug 12, 2013 2:45 pm

Re: Configuring IIS6 Application Settings

Hi,

I've got the Script-timeout going now, used the following batch file command:
appcmd.exe set config "Default Web Site/EvoNET" -section:asp /limits.scriptTimeout:"00:00:03" /commit:apphost

As for the permissions I believe I have it working but the permissions for IIS_IUSRS goes under SPECIAL PERMISSIONS; and when I look at the effective permissions the IIS_IUSRS group has full. Is this the expected result??


Cheers, Kyle
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Configuring IIS6 Application Settings

Hello Kyle,

I'm glad you got this working.
As for the permissions I believe I have it working but the permissions for IIS_IUSRS goes under SPECIAL PERMISSIONS; and when I look at the effective permissions the IIS_IUSRS group has full. Is this the expected result??
Yes, this is the expected result.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”