473,387 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get the installed WebSite in VS2005 WebSetup installer customAction?



Dear All:

In VS2005 WebSetup installer InstallAddress dialog, there is field to
let user to select which website to install the webapp (if there are
more than one WebSite in the IIS).

I want to know how can I get the WebStie info in the customAction.

I can use "/VDIR=[TARGETVDIR]" in customActiondata to get the installed
VirtualDirectory.
However, I cannot find any info how to receive the "WebSite" info.

There is a old example,
http://msdn.microsoft.com/library/de...deployment.asp

to use "/PORT=[TARGETPORT]" to find out the Site, but it does not work
in VS2005 websetup installer.
I need to website info to explicitly set the webapp to use ASPNET2.0 in
case of the machine to have multiple different version Dotnet runtime to
be installed.

The function to set the ASPNET runtime ,

http://www.asp.net/faq/SideBySide.as...ndex=0&tabid=1

,need to use such format ,

aspnet_regiis -s w3svc/1/ROOT/VirtualDirectoy

for different website the "w3svc/[1]/ROOT/..." is different , e.g.
"w3svc/2/ROOT/..."
I need a method to get the information.
Thank you very much
--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk
jacky@compose_DOT_com_DOT_hk
Mar 6 '06 #1
8 6428
Hi Jacky,

Thank for posting!

For the current issue, my understanding is that you want to get the web
info via using ASDI for IIS. If I have misunderstood anything, please let
me know.

Based on my experience, the article you mentioned in the previous thread is
specified for IIS 5.0. So I want to know the current version of the IIS in
your machine. In another word, could you please tell my about the version
of the current OS?

BTW, I'll perform the test to figure out how to get the information for
IIS. It will take me some period to approach this. So, I appreciate your
understanding and patience. I'll reply you ASAP when I get some
information. If you have any concerns, please feel you free to let me know.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====

Mar 6 '06 #2
Yuan Ren[MSFT] wrote:
Hi Jacky,

Thank for posting!

For the current issue, my understanding is that you want to get the web
info via using ASDI for IIS. If I have misunderstood anything, please let
me know.

Based on my experience, the article you mentioned in the previous thread is
specified for IIS 5.0. So I want to know the current version of the IIS in
your machine. In another word, could you please tell my about the version
of the current OS?

BTW, I'll perform the test to figure out how to get the information for
IIS. It will take me some period to approach this. So, I appreciate your
understanding and patience. I'll reply you ASAP when I get some
information. If you have any concerns, please feel you free to let me know.

Regards,

Yuan Ren [MSFT]
Microsoft Online Support
================================================== ====
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD were
updated on February 14, 2006. Please complete a re-registration process
by entering the secure code mmpng06 when prompted. Once you have
entered the secure code mmpng06, you will be able to update your profile
and access the partner newsgroups.
================================================== ====
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from this issue.
================================================== ====
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ====


Thank you very much.

In my case, I do not care what is the IIS version.
My question is I need to make the WebSetup installer which can set the
web application to suitable dotnet version in case of the machine has
multiple framweork installed.

The target machine may be XP or 2003, IIS may be 5 or 6.

In fact, I know how to queue how many websites in the IIS.

In VS2005 Websetup installer, user can select which website to install
the application in the Windows to input VirtualDirectory.

My main question is that how can I know my webapp has been installed in
which website? (in the customAction of the websetup installer)
i.e. "w3svc/1/ROOT/..." or "w3svc/2/ROOT/..." ...

Then my installer can set the suitable framework version by call script
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.xxxx\aspn et_regiis -s
w3svc/N/ROOT/..."
--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk
jacky@compose_DOT_com_DOT_hk
Mar 7 '06 #3
Hi Jacky,

Thanks for your patience!

After my research, the example from the old MSDN article works well. You
can add the installer class in your current website project or create a new
project. Actually, the template of the installer class is supplied by the
windows form project and the class library project. However, we still can
use the installer class in our web project although there is no template.
So could you please give me more details about "but it does not work in
VS2005 websetup installer" you mentioned before?

BTW, if you don't want to use the managed class in the custom action of the
websetup project, I suggest you write a script to do this. The same ADSI
schema is appropriate for any kinds of custom actions such as script,
managed class, unmanaged class etc.

Hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 9 '06 #4
Yuan Ren[MSFT] wrote:
Hi Jacky,

Thanks for your patience!

After my research, the example from the old MSDN article works well. You
can add the installer class in your current website project or create a new
project. Actually, the template of the installer class is supplied by the
windows form project and the class library project. However, we still can
use the installer class in our web project although there is no template.
So could you please give me more details about "but it does not work in
VS2005 websetup installer" you mentioned before?

BTW, if you don't want to use the managed class in the custom action of the
websetup project, I suggest you write a script to do this. The same ADSI
schema is appropriate for any kinds of custom actions such as script,
managed class, unmanaged class etc.

Hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support


I cannot understand how the "the example from the old MSDN article works
well".

I need to know which WebSite my Webapp installed in.

The old example did not mention anything about website.
The old example just use the "PORT" in customAction by adding the
"/PORT=[TARGETPORT]" in customActionData.

However, when I run the example code in the VS2005 WebSetup and
customAction,
"Context.Parameters.Item("Port")" always return empty.

I think it is because there no "port" can be selected in VS2005 web
installer.
("port" can be set in VS.NET 2002 web setup installer only).

In fact, in current time, I use a work around to solve my problem.
In customAction code, I can get the installing "VirtualDirectory".

I will loop through all the existing websites to check the
"VirtualDirectory" existing.

if the "VirtualDirectory" exists, set it to use ASPNET2.0.

then, I will loop through all

"w3svc/1/ROOT/VirtualDirectoy",
"w3svc/2/ROOT/VirtualDirectoy",
...


However, this method may be wrong if there is another webapp in some
other website using the same VirtualDirecory Name.
--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk
jacky@compose_DOT_com_DOT_hk
Mar 9 '06 #5
Hi Jacky,

Sorry for misunderstanding!

My understanding is that you want to get the server number under the
"W3SVC" via the installation of the web site. If I have misunderstood
anything, please let me know.

During the installation, the site should be indicated. Actually, the site
here is the server comment of the current web server such as "Default Web
Site", "My Web Site" etc. As far as I know, we can use this name to get the
number which I mentioned before. The following script which I wrote is a
simple dome to demonstrate how to get the number:
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{authenticationLevel=pktPrivacy}\\" _
& strComputer & "\root\microsoftiisv2")
Dim servercomment
servercomment = "Default Web Site"

Set colItems = objWMIService.ExecQuery("Select * from IIsWebServerSetting
where ServerComment = """ & servercomment & """")

For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Name: " & Right(objItem.Name, 1)
Next

The script works fine on my side. If you don't want to use the script as
the custom action in the setup project, you also can use it as managed
class which as the old document from MSDN does.

Hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 12 '06 #6
Hi Yuan Ren:

Thank you very much.
Your answer should a part of my question.

Following your code, I should get the website number from the website
name (I still do not test the code yet).

However, my problem does still exist.
The first problem I asked was "How can I know what is the website, which
the webapp installed in, in the websetup customAction".
In my case, the IIS server may have multiple websites. User can select
one which is not default one.

The problem is that I cannot ask the user to run another script to input
which website they have selected.
The websetup installer must be able to know the "website" in the
customAction program code automatically. The customAction code should
not prompt any UI to ask the user again.

I believe that there should be a name whish is something like the
"/VDIR=[TARGETVDIR]" which can be used to pass the isntalled
"VirtualDirectory" into the CustomAction.

I will imagine there is a , for example, "/SITE=[TARGETSITE]" which I
can input the CustomActionData field, then the installer will pass the
user selected "WebSite" to the customAction program code. Then, the
customAction code can get the "WebSite" by 'Context.Parameters["SITEV"]'.
However, I cannot find out how to do so.


Yuan Ren[MSFT] wrote:
Hi Jacky,

Sorry for misunderstanding!

My understanding is that you want to get the server number under the
"W3SVC" via the installation of the web site. If I have misunderstood
anything, please let me know.

During the installation, the site should be indicated. Actually, the site
here is the server comment of the current web server such as "Default Web
Site", "My Web Site" etc. As far as I know, we can use this name to get the
number which I mentioned before. The following script which I wrote is a
simple dome to demonstrate how to get the number:
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{authenticationLevel=pktPrivacy}\\" _
& strComputer & "\root\microsoftiisv2")
Dim servercomment
servercomment = "Default Web Site"

Set colItems = objWMIService.ExecQuery("Select * from IIsWebServerSetting
where ServerComment = """ & servercomment & """")

For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Name: " & Right(objItem.Name, 1)
Next

The script works fine on my side. If you don't want to use the script as
the custom action in the setup project, you also can use it as managed
class which as the old document from MSDN does.

Hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk
jacky@compose_DOT_com_DOT_hk
Mar 13 '06 #7
Dear All:

I just find out that

I actually can use the "/SITE=[TARGETSITE]" in the customActionData to
let the Installer to pass the "site" to the customAction code.

In past, I do not know how to find out the [name] of the site and I just
imagine there should be a [name] can be used.

However, I just thought that if the Installer can pass the "WebSite" to
the customAction, there should be some information have been put in the
installer itself.

Then, I tried to use "Orca" tool (a tool in the platform sdk) to examine
the websetup installer file "*.msi".
I just found that there was a key [TARGETSITE] in the "AdminUISequence"
table.
Then, I tried to use the "/SITE=[TARGETSITE]" in the customActionData.
I was very happy I could get the

'Context.Parameters["SITE"]=/LM/W3SVC/1'

It is more than just the site name. I can directly use the path in my case.

Anyway, thanks everyone who had given me comment to solve the problem.
--
Jacky Kwok
jacky@alumni_DOT_cuhk_DOT_edu_DOT_hk
jacky@compose_DOT_com_DOT_hk
jacky kwok wrote:
Hi Yuan Ren:

Thank you very much.
Your answer should a part of my question.

Following your code, I should get the website number from the website
name (I still do not test the code yet).

However, my problem does still exist.
The first problem I asked was "How can I know what is the website, which
the webapp installed in, in the websetup customAction".
In my case, the IIS server may have multiple websites. User can select
one which is not default one.

The problem is that I cannot ask the user to run another script to input
which website they have selected.
The websetup installer must be able to know the "website" in the
customAction program code automatically. The customAction code should
not prompt any UI to ask the user again.

I believe that there should be a name whish is something like the
"/VDIR=[TARGETVDIR]" which can be used to pass the isntalled
"VirtualDirectory" into the CustomAction.

I will imagine there is a , for example, "/SITE=[TARGETSITE]" which I
can input the CustomActionData field, then the installer will pass the
user selected "WebSite" to the customAction program code. Then, the
customAction code can get the "WebSite" by 'Context.Parameters["SITEV"]'.
However, I cannot find out how to do so.


Yuan Ren[MSFT] wrote:
Hi Jacky,

Sorry for misunderstanding!

My understanding is that you want to get the server number under the
"W3SVC" via the installation of the web site. If I have misunderstood
anything, please let me know.

During the installation, the site should be indicated. Actually, the
site here is the server comment of the current web server such as
"Default Web Site", "My Web Site" etc. As far as I know, we can use
this name to get the number which I mentioned before. The following
script which I wrote is a simple dome to demonstrate how to get the
number:
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{authenticationLevel=pktPrivacy}\\" _
& strComputer & "\root\microsoftiisv2")
Dim servercomment
servercomment = "Default Web Site"

Set colItems = objWMIService.ExecQuery("Select * from
IIsWebServerSetting where ServerComment = """ & servercomment & """")

For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Name: " & Right(objItem.Name, 1)
Next

The script works fine on my side. If you don't want to use the script
as the custom action in the setup project, you also can use it as
managed class which as the old document from MSDN does.

Hope this will be helpful!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support


Mar 13 '06 #8
Hi Jacky,

I'm glad to hear the issue has been resolved:)

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 14 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MENTAT | last post by:
Hi, I am trying to create an installer for my web application. So I added a web setup project to my solution (I am using VS.NET 2003). Been playing around with it since then and it basically...
0
by: mike.brydon | last post by:
I'm creating a WebSetup Deployment Solution using VS.Net 2003 to install my web application. I've created several installer classes to go with it. My problem is, I want the installer classes to...
0
by: mdawid | last post by:
Hi, The problem is the WebSetup never removes the assembly MyCustomAction.dll from the virtual directory. Is there any switch/property telling installer to remove custom action assembly after...
10
by: musosdev | last post by:
Hi guys I'm trying to migrate to VS2005... I've managed to do that, but realised I'd opened my web projects as file projects, and I'm getting the error about network BIOS command limit. ...
1
by: Steve | last post by:
I've tried to find out how to do this on MSDN and other sites, but I can't find an example or even a mention of this. I need to install some printer drivers with my application, anyone know how to...
0
by: cit42 | last post by:
Hallo, i have a msi that installs an ASP.NET website to IIS. The MSI is produced by VS2005, using "Web setup project" and the "Web deployment project". The installation works fine, but after...
0
by: Borat | last post by:
Hi all! I have a website that includes different applications and I want to create a setup-project for this, but it seems to me that this is not possible with the VS-WebSetup-project. There is...
1
by: MimiMi | last post by:
I have a deployment project that was originally created in VS2003. Since I don't have VS2003, I now open it in VS2005, but then of course VS2005 has to convert it. Everything seems to work fine. I...
0
by: DocVu | last post by:
Dear everybody, I'm very sad now. I have problem with making the Setup package. Could you share with me a light.Our problem as followings: 1. I expect the deployment package contains the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.