473,880 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
+ 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\Project FileName 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 "programaticall y". 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 5372
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 programmaticall y 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 programmaticall y (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.Paramet ers["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.WriteLi ne(Context.Para meters["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\Project FileName 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 "programaticall y". 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 programmaticall y 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 programmaticall y (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.Paramet ers["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.WriteLi ne(Context.Para meters["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\Project FileName 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 "programaticall y". 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
2120
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 of the installation needs to "dump" a bunch of files (third party product's project files) to the user's system. These files are transient in nature in that the user may choose
1
1028
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 syncronization with remote database using merge replication. I found contradictory results while installing the application. I will mention here all the steps that I done while creating and installing setups. Result: Case 1: worked fine. ...
1
2116
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, they get deleted. What I'd *like* is that when I build the setup project, the files that it creates should go into a directory that I specify, and not delete any other files that are already in it. That way I can maintain an image of my...
4
7093
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 deployment project (myproj installer) I added my windows app to the installer under myproj installer properties, I set bootstrapper
2
792
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
1212
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 is to use the standard Installation Address dialog that asks for virtual directory name and port, but I DO NOT want my new patch installer to actually create that virtual directory (that would overwrite settings of the currently installed...
1
7152
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 RootSource\Web (which has web stuff) RootSource\Business (which has class libraries)
0
1379
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 RootSource\Web (which has web stuff) RootSource\Business (which has class libraries)
1
1901
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 the build output of the deployment CAB, and the primary output from my custominstaller dll class. So the only difference between the first, working setup project and the new app-only project is that I didn't inlcude the additional CABs and INIs in the...
0
9774
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
11093
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
10715
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...
1
10811
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9550
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5778
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5973
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4596
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
2
4192
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.