473,473 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

simple question: Web setup project installer. changing installation directory

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 point my virtual directory to it.

Is there any way to do this. Right now the files are just being stored
in c:\...\inetput\wwwroot\ProjectFileName directory. I opened up the
File system editor and looked at the properties for the WebApplication
Folder. One of the properties is called property TARGETDIR. I assume
this is the property i need to change?
From what I gathered on the web and newsgroups, this property can be

accessed "programatically". Is this correct? Can anyone tell me me how
to access and set this property. As I said, Ideally I would like to
give the user the option of specifying the physical directory, but i
don't mind hardcoding that during design time either.

Jul 21 '05 #1
2 5311
Thanks for the reply Kannan,

Yes, the articles have helped. But from what i gather the CustomAction
is executed after the installation. By this time the directory
structure has already been created. (Isn't that correct?)

Is there any way to programmatically create virtual directories. I.e
create and ordinary directory structure and point a virtual directory
to it. There are some code snippets for this floating around, but they
are all written in VB, not C#. I haven't found one in C# yet. Is the
only way to create virtual directories and configure IIS to use VB? (If
so, I might have to start learning to code in VB). Or is there a c#
option?

I read somewhere that the solution to this is to use an ordinary setup
project (not a web setup) and create the directory structure, and then
point the virtual directory to it. Is this really the best way to do
things or is there a web setup solution?

How do I get CustomAction to execute before the installation. In the
installer class there is a BeforeInstall event. Is this what I have to
use create my virtual directory programmatically (if that is the way to
go).

There seems to be a lot of bits and pieces around and related sequence
tasks to be done. So far I haven't found a good comprehensive solution.
Surely someone out there has already done this before? Just need a bit
more help piecing the puzzle together.

Thanks all in advance.
PS: I haven't been able to access Context.Parameters["INSTALLDIR"] so
far. Keeps throwing an "object reference not set to an object instance"
error during installation. And from what I gather, this is a property
that is set by the installer after installation. Not something the
CustomAction can set before installation. Am I correct?
Kannan.V [MCSD.net] wrote:
hi....

for reading the values from the install program, i guess u must have added custom forms to ur install app from the setup project, in this case u have to create a custom installer class to read the values from the installer application and do the required job, once u have created ur installer class u need to add this dll file as a custom action to the installer,
so when the installer runs, the code in the installer class also gets executed.

you need to pass the parameters thro the custom action data property in the setup app.
Ex. - /INSTALLDIR="[INSTALLDIR]"
and inside the installer class you can read the parameters as shown below. Console.WriteLine(Context.Parameters["INSTALLDIR"].ToString());

check out these links for further reading.
http://www.c-sharpcorner.com/Code/20...nstClasses.asp

http://msdn.microsoft.com/library/de...classtopic.asp
hope this helps,
Bye

Kannan.V
http://kannanv.blogspot.com

"MENTAT" wrote:
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 point my virtual directory to it.

Is there any way to do this. Right now the files are just being stored in c:\...\inetput\wwwroot\ProjectFileName directory. I opened up the File system editor and looked at the properties for the WebApplication Folder. One of the properties is called property TARGETDIR. I assume this is the property i need to change?
From what I gathered on the web and newsgroups, this property can
be accessed "programatically". Is this correct? Can anyone tell me me how to access and set this property. As I said, Ideally I would like to
give the user the option of specifying the physical directory, but i don't mind hardcoding that during design time either.


Jul 21 '05 #2
hi MENTAT,

As you have said the directory structure for the web setup projects are
created at the start of the install process, tried to play around with it,
but was not able to get a way to manipulate it.

You can programatically create directories and point to a virtual directory.
and there is no difference in using VB or C#, you must be able to do
whatever you do in VB using C#, the only difference is the syntax and a
little bit of the way they both handle things, but thats got nothing to do
with the coding or the logic part.

Yes we can use the Ordinary setup project to create folders and point to the
virtual directory.

Will post with more info once try something on my box.

PS : For websetup projects use the ["TARGETDIR"] as the parameter.

"MENTAT" wrote:
Thanks for the reply Kannan,

Yes, the articles have helped. But from what i gather the CustomAction
is executed after the installation. By this time the directory
structure has already been created. (Isn't that correct?)

Is there any way to programmatically create virtual directories. I.e
create and ordinary directory structure and point a virtual directory
to it. There are some code snippets for this floating around, but they
are all written in VB, not C#. I haven't found one in C# yet. Is the
only way to create virtual directories and configure IIS to use VB? (If
so, I might have to start learning to code in VB). Or is there a c#
option?

I read somewhere that the solution to this is to use an ordinary setup
project (not a web setup) and create the directory structure, and then
point the virtual directory to it. Is this really the best way to do
things or is there a web setup solution?

How do I get CustomAction to execute before the installation. In the
installer class there is a BeforeInstall event. Is this what I have to
use create my virtual directory programmatically (if that is the way to
go).

There seems to be a lot of bits and pieces around and related sequence
tasks to be done. So far I haven't found a good comprehensive solution.
Surely someone out there has already done this before? Just need a bit
more help piecing the puzzle together.

Thanks all in advance.
PS: I haven't been able to access Context.Parameters["INSTALLDIR"] so
far. Keeps throwing an "object reference not set to an object instance"
error during installation. And from what I gather, this is a property
that is set by the installer after installation. Not something the
CustomAction can set before installation. Am I correct?
Kannan.V [MCSD.net] wrote:
hi....

for reading the values from the install program, i guess u must have

added
custom forms to ur install app from the setup project, in this case u

have to
create a custom installer class to read the values from the installer

application and do the required job, once u have created ur installer

class u
need to add this dll file as a custom action to the installer,
so when the installer runs, the code in the installer class also gets

executed.

you need to pass the parameters thro the custom action data property

in the
setup app.
Ex. - /INSTALLDIR="[INSTALLDIR]"
and inside the installer class you can read the parameters as shown

below.
Console.WriteLine(Context.Parameters["INSTALLDIR"].ToString());

check out these links for further reading.
http://www.c-sharpcorner.com/Code/20...nstClasses.asp

http://msdn.microsoft.com/library/de...classtopic.asp

hope this helps,
Bye

Kannan.V
http://kannanv.blogspot.com

"MENTAT" wrote:
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 point my virtual directory to it.

Is there any way to do this. Right now the files are just being stored in c:\...\inetput\wwwroot\ProjectFileName directory. I opened up the File system editor and looked at the properties for the WebApplication Folder. One of the properties is called property TARGETDIR. I assume this is the property i need to change?

>From what I gathered on the web and newsgroups, this property can be accessed "programatically". Is this correct? Can anyone tell me me how to access and set this property. As I said, Ideally I would like to
give the user the option of specifying the physical directory, but i don't mind hardcoding that during design time either.


Jul 21 '05 #3

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

Similar topics

3
by: Ryno Rijnsburger | last post by:
I am busy packaging our product as a standard Setup project in VS.NET that uses a bunch of merge modules (basically, a merge module for every key infrastructure component in our system). Part...
1
by: santhosh_176 | last post by:
:I Created a Pocket PC application for iPAQ 5450. Every thing went fine even installer creation. I could run the setup and install it into the actual device and worked fine. The application enables...
1
by: Michael A. Covington | last post by:
When I build my setup project, I get three files: setup.exe, setup.ini. and myapplication.msi. These go into a folder called (setup project)/bin/Release. If any other files are in that folder,...
4
by: bob lambert | last post by:
Help I am trying to deploy to another pc a vb.net std 2002 windows form application. I am confused. I created a project - windows form I built form, compiled and debugged. I created a...
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: thomas.dunn | last post by:
Hello, I am writing a web setup project that acts as a patch that replaces some resource files of an asp.net application that has previously been installed by a web setup installer. What I want...
1
by: kplkumar | last post by:
Hi I am new to this. I am trying to create a setup project to package our stuff and create an installer. This is what I want to do, I have a directory sructure in which we have our...
0
by: kplkumar | last post by:
Hi I am new to this. I am trying to create a setup project to package our stuff and create an installer. This is what I want to do, I have a directory sructure in which we have our...
1
by: capella07 | last post by:
In VS2005 I have a working setup project that installs several CABs with the main app. I also need to have a setup project that only installs the app itself. I created a new setup project and added...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.