Page 1 of 2

$WEBSITEINDEXVAR$ problem

Posted: Mon Jan 17, 2011 12:22 am
by xiaosu
Hi,

I have got a problem when I create 2 applications (one is web application and the other is wcf application) in one website.

If there is no site in IIS manager, it works. It creates one web site and under that site it has two applications. All good.

However, if there is an existing site (or more), it does not create $WEBSITE$, and only create one application in the existing site.

I think it is something wrong with site index. In my "Create IIS site" dialog box, I leave site index empty to automatically assign a new index. In "Create IIS Virtual Folder" dialog, I set site index to $WEBSITEINDEXVAR$ for both virtual folders.

And also I check the MSIcode, the logic generated is not quite right. It checks variable WEBSITEINDEXVAR equals 0, if yes, create IIS site and create one virtual folder which has a static name (not $FOLDER$). Then it creates another virtual folder which has $FOLDER$ as its name.

Here is some code:

if Variable WEBSITEINDEXVAR Equals 0
Create IIS Site "$WEBSITE$"
Get IIS Index for site "$WEBSITE$" into WEBSITEINDEXVAR
Get IIS Index for site "$WEBSITE$" into WEBSITEINDEXVAR (dont know why it does twice)
Create Virtual Folder "MyWCFFolder" in IIS Site #$WEBSITEINDEXVAR$, pointing to physical location $TARGETDIR$\somepath
Get System Setting IIS Anonymous User Account into INETUSR
Set Read Permissions on File System Object "" for $INETUSR$
end

Create Virtual Folder "$FOLDER$" in IIS Site #$WEBSITEINDEXVAR$, pointing to physical location $TARGETDIR$\somepath
Get System Setting IIS Anonymous User Account into INETUSR
Set Read Permissions on File System Object "" for $INETUSR$

I am using v10.10 by the way.

Thanks for any help.

Re: $WEBSITEINDEXVAR$ problem

Posted: Mon Jan 17, 2011 8:36 am
by Justin
I too am seeing this issue. It seems to be the Get IIS Site index command that is returning the wrong number.

In IIS 7 i have just the one Default Website and no others. My installer defaults to creating a New Website in IIS with a default name of say "NewSite" but the check to see if that already exists is coming back as 1. When i know it doesnt already exist! :(

This is making the installer use the existing website index rather than creating the new site as intended.

UPDATE: For me at least this seems to only occur with IIS7 or above. IIS 6 is fine, the Get IIS Site command functions as id expect.

It can be replicated using the IIS Example project on WS 2008 (so far thats the only OS ive tried) and IIS 7. When a new site name is entered with no virtual directory name the new site isnt created. The default site is used.

Re: $WEBSITEINDEXVAR$ problem

Posted: Mon Jan 17, 2011 4:05 pm
by xiaosu
I am hoping InstallAware people can give us a reply because it seems to be a bug.

Re: $WEBSITEINDEXVAR$ problem

Posted: Mon Jan 17, 2011 4:22 pm
by giaviv
Dear InstallAware users,

We are now looking into these issues - we will keep you posted of our progress.

Thank you for your patience

Re: $WEBSITEINDEXVAR$ problem

Posted: Fri Jan 21, 2011 3:57 am
by Justin
Hi Giaviv

Just wondered if there was any progress with this? Its the only oustanding issue i have with the IA trial.

Thanks

Re: $WEBSITEINDEXVAR$ problem

Posted: Fri Jan 21, 2011 8:06 am
by redbyron
Is there any news regarding this issue?

Re: $WEBSITEINDEXVAR$ problem

Posted: Fri Jan 21, 2011 10:45 am
by giaviv
Guys,

I am truly sorry for this. We are still looking at this issue, but in the meanwhile, I am providing a work-around.
Basically, what this work-around does is call appcmd.exe, redirect its output to a temporary file, and parse the result.
Please let me know if you found this helpful!

Re: $WEBSITEINDEXVAR$ problem

Posted: Fri Jan 21, 2011 10:59 am
by redbyron
Thanx Aviv,

but by researching a little more the IIS Installation, i found out that on the repair, the existing IIS Site physicalPath changes to the $TARGET$ path, when adding the VirtualFolder to the site. If you uninstall the application, the site has no physical path ......

I think that we are unable at the moment to use the IIS plugins, i will try to make the setup by using appcmd.

I am using version 10.10 , does the same problem exists on version 10? maybe i could downgrade?

Re: $WEBSITEINDEXVAR$ problem

Posted: Fri Jan 21, 2011 3:08 pm
by giaviv
Dear Michael,

Unfortunately, these issues occur on all versions of InstallAware with IIS7 support. I truly apologize for the inconvenience and I assure you that we are working on resolving these problems.

Thank you for your patience

Re: $WEBSITEINDEXVAR$ problem

Posted: Wed Jan 26, 2011 2:02 am
by Justin
Hi Giaviv

I tried to use your workaround for getting the site index which does work but now i am having problems creating a new website under IIS7.

Using the IIS Example, and the new index workaround, the new site is being created but the bindings are being set to https with no ssl port. No http bindings are being set :(. Even if i change the tcp port number the bindings are not being set correctly for http. This means (for me at least) obviously that the site will not function when browsed to using http.

Re: $WEBSITEINDEXVAR$ problem

Posted: Wed Jan 26, 2011 11:31 am
by giaviv
hey guys,

Again, we are very sorry about the IIS 7 issues - let me assure you that we are working on fixing them ASAP.
As for your problem, I would advise you to create your site with appcmd by using the following command:
appcmd add site /name: MySite /id:2 /physicalPath: c:\MySite /bindings:http/*:8080:
You can use my example from above and change the scripts to have appcmd create your site. Please let me know if you need help with it.

Re: $WEBSITEINDEXVAR$ problem

Posted: Fri Jan 28, 2011 8:09 am
by redbyron
Hello,

i dit the whole script based on appcmd, created site, app , apppool, parameterize app pool etc...
It is not as convenient as IIS support from IA, but you can do anything with IIS sites,vdirs,apps and apppools...

I hope that along with the fix you will add more tweakining actions for IIS...

Below is the script i used... (The logic behind this is that a user can select an existing web site, so will add an application and an applicationpool, otherwise it will add also a new site)

get IIS sites
Get IIS Site List into variable SITELIST

setup

if Variable SUCCESS not Equals ERROR
if Variable SUCCESS not Equals CANCEL
Comment: Add Application Pool
Run Program $WINDIR$\system32\inetsrv\appcmd.exe add apppool /name:"$WEBAPPLICATION$" (WAIT, get result into variable APPCMDCODE)
Comment: apppool error, 183=exists
if Variable APPCMDCODE not Equals 0
if Variable APPCMDCODE not Equals 183
MessageBox: IIS AppPool Creation Failed, Could not create AppPool $WEBAPPLICATION$$NEWLINE$Return Code $APPCMDCODE$
Terminate with Exit Code $APPCMDCODE$
end
end
Comment: Enable 32 Bits , ASP.Net v4.0 and integrated Mode
Run Program $WINDIR$\system32\inetsrv\appcmd.exe set apppool /apppool.name:"$WEBAPPLICATION$" /managedRuntimeVersion:v4.0 /enable32BitAppOnWin64:true /managedPipelineMode:Integrated (WAIT, get result into variable APPCMDCODE)
Comment: set apppool error
if Variable APPCMDCODE not Equals 0
MessageBox: IIS AppPool Configuration Failed, Could set settings for Application Pool$WEBAPPLICATION$$NEWLINE$Return Code $APPCMDCODE$
Terminate with Exit Code $APPCMDCODE$
end
Comment: check if site exists
Run Program $WINDIR$\system32\inetsrv\appcmd.exe list site "$WEBSITE$" (WAIT, get result into variable APPCMDCODE)
if Variable APPCMDCODE Equals 1
Comment: site does not exist, add it
Run Program $WINDIR$\system32\inetsrv\appcmd.exe add site /name:"$WEBSITE$" /physicalPath:"$TARGETDIR$" /bindings:https/*:443: (WAIT, get result into variable APPCMDCODE)
if Variable APPCMDCODE not Equals 0
MessageBox: IIS Site Creation Failed, Site $WEBSITE$ is not created.
Terminate with Exit Code $APPCMDCODE$
end
Set Persistent Variable NEWWEBSITE to TRUE
Write Registry Key HKLM\SOFTWARE\Broker Systems\ALPHATrade\NEWWEBSITE, $NEWWEBSITE$ (permanent)
Apply Install (get result into variable SUCCESS)
end
Comment: add https binding to site
Run Program $WINDIR$\system32\inetsrv\appcmd.exe set site /site.name:"$WEBSITE$" /+bindings.[protocol='https',bindingInformation='*:443:'] (WAIT, get result into variable APPCMDCODE)
if Variable APPCMDCODE not Equals 0
if Variable APPCMDCODE not Equals 183
MessageBox: IIS Could not add HTTPS Binding to site, Could not add HTTPS Binding to site $WEBSITE$$NEWLINE$Return Code $APPCMDCODE$
end
end
if Variable NEWWEBSITE Equals TRUE
Run Program $WINDIR$\system32\inetsrv\appcmd.exe set site "$WEBSITE$" -applicationDefaults.applicationPool:"$WEBAPPLICATION$" (WAIT, get result into variable APPCMDCODE)
if Variable APPCMDCODE not Equals 0
MessageBox: IIS Could not set Application Pool, Could not set $WEBSITE$'s application pool to $WEBAPPLICATION$$NEWLINE$Return Code $APPCMDCODE$
Terminate with Exit Code $APPCMDCODE$
end
else
Comment: Add Application to WebSite
Run Program $WINDIR$\system32\inetsrv\appcmd.exe add app /site.name:"$WEBSITE$" /path:"/$WEBAPPLICATION$" /physicalPath:"$TARGETDIR$" (WAIT, get result into variable APPCMDCODE)
Comment: application error, 183=exists
if Variable APPCMDCODE not Equals 0
if Variable APPCMDCODE not Equals 183
MessageBox: IIS AppPool Creation Failed, Could not create AppPool $WEBAPPLICATION$$NEWLINE$Return Code $APPCMDCODE$
Terminate with Exit Code $APPCMDCODE$
end
end
Comment: set application pool of application
Run Program $WINDIR$\system32\inetsrv\appcmd.exe set app "$WEBSITE$/$WEBAPPLICATION$" /applicationPool:"$WEBAPPLICATION$" (WAIT, get result into variable APPCMDCODE)
if Variable APPCMDCODE not Equals 0
MessageBox: IIS Could not set Application Pool, Could not set $WEBSITE$\$WEBAPPLICATION$'s application pool to $WEBAPPLICATION$$NEWLINE$Return Code $APPCMDCODE$
Terminate with Exit Code $APPCMDCODE$
end
end
Comment: Obtain the IIS anonymous account user name
Get System Setting IIS Anonymous User Account into INETUSR
Comment: Set read permissions on the physical target folder of the new virtual folder
Set Read Permissions on File System Object "$TARGETDIR$" for $INETUSR$
Does File Exist $TARGETDIR$\Web.config (get result into variable WEBCONFIGEXISTS)


and removal

if Variable REMOVAL Equals YES
Comment: Removal confirmed - delete the site and folder
if Variable NEWWEBSITE Equals TRUE
Run Program $WINDIR$\system32\inetsrv\appcmd.exe delete site "$WEBSITE$" (WAIT, get result into variable APPCMDCODE)
if Variable APPCMDCODE not Equals 0
MessageBox: IIS Site removal Failed, Site $WEBSITE$ is not removed.$NEWLINE$Return Code $APPCMDCODE$
end
end
Comment: Delete Application Pool
Run Program $WINDIR$\system32\inetsrv\appcmd.exe delete apppool "$WEBAPPLICATION$" (WAIT, get result into variable APPCMDCODE)
if Variable APPCMDCODE not Equals 0
MessageBox: IIS AppPool removal Failed, Could not remove AppPool $WEBAPPLICATION$$NEWLINE$Return Code $APPCMDCODE$
end
end

Re: $WEBSITEINDEXVAR$ problem

Posted: Mon Jan 31, 2011 11:03 am
by Justin
Hi Giaviv

Do you have any idea of an ETA for the fixes for this?

Thanks

Re: $WEBSITEINDEXVAR$ problem

Posted: Wed Feb 02, 2011 9:31 pm
by giaviv
Dear InstallAware users,

We recently came across several issues regarding IIS 7. Those issues have been fixed. Please regenerate your license, install it, and those issues should be resolved. The fixes were only made to the setup engine, hence they wont apply to debugging inside the InstallAware IDE. They issues that have been fixed are:
1) The SSL empty bindings issue has been fixed
2) The TCP binding issue (not being able to bind to a TCP port) has been fixed
3) The Get IIS Site Index command has been fixed
4) The Get IIS Property command now returns !ERROR! instead of gibberish when passed invalid parameters

Thank you for your patience. We truly appreciate your business.

Re: $WEBSITEINDEXVAR$ problem

Posted: Thu Mar 03, 2011 9:06 am
by claudiov
Hello,

Regarding #2 of your update fixes, I have a problem that if I create a site (e.g.: "Default Web Site") in IIS7 where previously there were none (empty sites) the installer creates a binding to *.443 (https) and NOT *.80 (http). Is this the same problem you fixed or is this something else????

Thanks.
giaviv wrote:Dear InstallAware users,

We recently came across several issues regarding IIS 7. Those issues have been fixed. Please regenerate your license, install it, and those issues should be resolved. The fixes were only made to the setup engine, hence they wont apply to debugging inside the InstallAware IDE. They issues that have been fixed are:
1) The SSL empty bindings issue has been fixed
2) The TCP binding issue (not being able to bind to a TCP port) has been fixed
3) The Get IIS Site Index command has been fixed
4) The Get IIS Property command now returns !ERROR! instead of gibberish when passed invalid parameters

Thank you for your patience. We truly appreciate your business.