473,769 Members | 5,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 customActiondat a to get the installed
VirtualDirector y.
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_DO T_cuhk_DOT_edu_ DOT_hk
jacky@compose_D OT_com_DOT_hk
Mar 6 '06 #1
8 6457
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 VirtualDirector y.

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\Mic rosoft.NET\Fram ework\v2.0.xxxx \aspnet_regiis -s
w3svc/N/ROOT/..."
--
Jacky Kwok
jacky@alumni_DO T_cuhk_DOT_edu_ DOT_hk
jacky@compose_D OT_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 customActionDat a.

However, when I run the example code in the VS2005 WebSetup and
customAction,
"Context.Parame ters.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 "VirtualDirecto ry".

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

if the "VirtualDirecto ry" 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_DO T_cuhk_DOT_edu_ DOT_hk
jacky@compose_D OT_com_DOT_hk
Mar 9 '06 #5
Hi Jacky,

Sorry for misunderstandin g!

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:{aut henticationLeve l=pktPrivacy}\\ " _
& strComputer & "\root\microsof tiisv2")
Dim servercomment
servercomment = "Default Web Site"

Set colItems = objWMIService.E xecQuery("Selec t * from IIsWebServerSet ting
where ServerComment = """ & servercomment & """")

For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Name: " & Right(objItem.N ame, 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
"VirtualDirecto ry" into the CustomAction.

I will imagine there is a , for example, "/SITE=[TARGETSITE]" which I
can input the CustomActionDat a 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.Parame ters["SITEV"]'.
However, I cannot find out how to do so.


Yuan Ren[MSFT] wrote:
Hi Jacky,

Sorry for misunderstandin g!

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:{aut henticationLeve l=pktPrivacy}\\ " _
& strComputer & "\root\microsof tiisv2")
Dim servercomment
servercomment = "Default Web Site"

Set colItems = objWMIService.E xecQuery("Selec t * from IIsWebServerSet ting
where ServerComment = """ & servercomment & """")

For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Name: " & Right(objItem.N ame, 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_DO T_cuhk_DOT_edu_ DOT_hk
jacky@compose_D OT_com_DOT_hk
Mar 13 '06 #7
Dear All:

I just find out that

I actually can use the "/SITE=[TARGETSITE]" in the customActionDat a 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 "AdminUISequenc e"
table.
Then, I tried to use the "/SITE=[TARGETSITE]" in the customActionDat a.
I was very happy I could get the

'Context.Parame ters["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_DO T_cuhk_DOT_edu_ DOT_hk
jacky@compose_D OT_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
"VirtualDirecto ry" into the CustomAction.

I will imagine there is a , for example, "/SITE=[TARGETSITE]" which I
can input the CustomActionDat a 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.Parame ters["SITEV"]'.
However, I cannot find out how to do so.


Yuan Ren[MSFT] wrote:
Hi Jacky,

Sorry for misunderstandin g!

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:{aut henticationLeve l=pktPrivacy}\\ " _
& strComputer & "\root\microsof tiisv2")
Dim servercomment
servercomment = "Default Web Site"

Set colItems = objWMIService.E xecQuery("Selec t * from
IIsWebServerSet ting where ServerComment = """ & servercomment & """")

For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Name: " & Right(objItem.N ame, 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
5365
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 works. Now, I am wondering if there is any way to change the directory that the installer installs the files to. I want to be able to put my files in a specified directory (user specified is good, but i don't mind hardcoding the path either) and...
0
1083
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 run in a certain sequence. I've seperated the steps into individual installer classes so that I can reuse them for similar product installs. Thanks for any help
0
1292
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 the setup completes? I have created MyCustomAction class based on System.Configuration.Install.I­­nstaller in the Class Library project
10
2537
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. Anyway, I decided to have a go at loading them as web projects from our Win2k3 server. It gets so far and then says "The web server does not appear to have FrontPage server extensions installed".
1
2399
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 accomplish this with a c# Installer Project (MSI)? Thanks for any help, Steve
0
1194
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 deinstall, the IIS-Manager contains still the website-virtual-directory registered as application and the bin-subfolder. The filesystem contains also these two folders. All files and other folders are deleted correctly.
0
1162
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 only the option to make the root-folder an application but I want to create a new site. I hope you can help me. Thanks!
1
1504
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 build the project and an installer.msi - file as well as a setup.exe - file is created. Now to the problem: double-clicking the setup.exe doesn't work! It gives me the error "An error occured while downloading a required file. You may retry...
0
1149
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 following features: - The user will get the deployment package with 2 files: setupname.msi and setupname.ini - The setupname.ini file tell us which modules the end user has permission to install (and which are not-allowed-modules).
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.