473,396 Members | 1,756 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,396 software developers and data experts.

Detecting install folder during installation

Hi,

I have created a .NET deployment project in Visual Studio 2003. I have
specified an entry point into my own code in this installer which launches
into the familiar:

public override void Install(IDictionary savedState)
{
Application.Run(new MyForm());
base.Install(savedState);
}

That's the background and everything works swimmingly - one thing I cannot
find anywhere is how to get the installation location at this point, for
instance if the user chooses to install to the E: drive or similiar during
the install process, how would you then find the path the user chose?

The reason I want this path is because this application is a visual studio
add-in and thus can't use System.IO.Directory.GetCurrentDirectory() later on,
yet I want to allow the user to choose where the files it uses should be
installed and be able to access those.

Any help is kindly appreciated,

Chad Smith.
Nov 22 '05 #1
3 3987
Pass TARGETDIR into the custom action like this:
http://msdn.microsoft.com/library/de...taproperty.asp

You might get some unusual things happening because what you're doing is not
supposed to be done. The architecture of MSI setups is that there is a UI
sequence and then a silent sequence running on top of the MSI Service. You
shouldn't be showing UI like this, and it might be safer to launch your app
rather than have it run on top of the MSI Service.
System.IO.GetCurrentDirectory() is just one of those things that won't be
what you expected. Do any of your users expect to be able to do a silent
install?
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Chad Smith" <ch***@burning-ice.co.uk> wrote in message
news:dk**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi,

I have created a .NET deployment project in Visual Studio 2003. I have
specified an entry point into my own code in this installer which launches
into the familiar:

public override void Install(IDictionary savedState)
{
Application.Run(new MyForm());
base.Install(savedState);
}

That's the background and everything works swimmingly - one thing I cannot
find anywhere is how to get the installation location at this point, for
instance if the user chooses to install to the E: drive or similiar during
the install process, how would you then find the path the user chose?

The reason I want this path is because this application is a visual studio
add-in and thus can't use System.IO.Directory.GetCurrentDirectory() later
on,
yet I want to allow the user to choose where the files it uses should be
installed and be able to access those.

Any help is kindly appreciated,

Chad Smith.

Nov 22 '05 #2
Thank you for your reply, I'll test that now.

Users won't be running a silent install at this stage but thanks for the
pointer, I'll keep this in mind.

This goes off topic but as you mentioned it, and if you wouldn't mind helping
further; what is the .net best practice for actually launching an app from
inside a component such as this?

Many thanks again,

Chad.

On 10/11/2005 15:07:37, "Phil Wilson" wrote:
Pass TARGETDIR into the custom action like this:
http://msdn.microsoft.com/library/de...taproperty.asp

You might get some unusual things happening because what you're doing is not
supposed to be done. The architecture of MSI setups is that there is a UI
sequence and then a silent sequence running on top of the MSI Service. You
shouldn't be showing UI like this, and it might be safer to launch your app
rather than have it run on top of the MSI Service.
System.IO.GetCurrentDirectory() is just one of those things that won't be
what you expected. Do any of your users expect to be able to do a silent
install?
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Chad Smith" <ch***@burning-ice.co.uk> wrote in message
news:dk**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi,

I have created a .NET deployment project in Visual Studio 2003. I have
specified an entry point into my own code in this installer which launches
into the familiar:

public override void Install(IDictionary savedState)
{
Application.Run(new MyForm());
base.Install(savedState);
}

That's the background and everything works swimmingly - one thing I cannot
find anywhere is how to get the installation location at this point, for
instance if the user chooses to install to the E: drive or similiar during
the install process, how would you then find the path the user chose?

The reason I want this path is because this application is a visual studio
add-in and thus can't use System.IO.Directory.GetCurrentDirectory() later
on,
yet I want to allow the user to choose where the files it uses should be
installed and be able to access those.

Any help is kindly appreciated,

Chad Smith.



Nov 22 '05 #3
It depends what your app code does. If it collects data from the user, that
should be happening in the UI sequence up front. That data typically gets
stored in properties that you define (like [TARGETDIR] is a built-in
property). If there are default values for the properties you can specify
them with a command line install:

msiexec /i <path to msi> MYPROPERTY=something

or just put the defaults in the Property table in the MSI (no VS support for
that). If you just want to run your app, it's common to trigger it off the
Finish button when you get the final dialog (no VS support for that) if
there's always a user interface. If the install is always quiet (there's a
UILevel property to tell you whether it is or not) you can just run an
executable rather than have your app running on top of the MSI Service.
Since you mentioned .NET best practice, I'll add that none of this .NET -
Windows Installer has been around since before .NET, but since VS .NET
started offering setup projects many people think that VS .NET setup
projects and Windows Installer are somehow the same thing.

--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Chad Smith" <ch***@burning-ice.co.uk> wrote in message
news:dk**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Thank you for your reply, I'll test that now.

Users won't be running a silent install at this stage but thanks for the
pointer, I'll keep this in mind.

This goes off topic but as you mentioned it, and if you wouldn't mind
helping
further; what is the .net best practice for actually launching an app from
inside a component such as this?

Many thanks again,

Chad.

On 10/11/2005 15:07:37, "Phil Wilson" wrote:
Pass TARGETDIR into the custom action like this:
http://msdn.microsoft.com/library/de...taproperty.asp

You might get some unusual things happening because what you're doing is
not
supposed to be done. The architecture of MSI setups is that there is a UI
sequence and then a silent sequence running on top of the MSI Service. You
shouldn't be showing UI like this, and it might be safer to launch your
app
rather than have it run on top of the MSI Service.
System.IO.GetCurrentDirectory() is just one of those things that won't be
what you expected. Do any of your users expect to be able to do a silent
install?
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Chad Smith" <ch***@burning-ice.co.uk> wrote in message
news:dk**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi,

I have created a .NET deployment project in Visual Studio 2003. I have
specified an entry point into my own code in this installer which
launches
into the familiar:

public override void Install(IDictionary savedState)
{
Application.Run(new MyForm());
base.Install(savedState);
}

That's the background and everything works swimmingly - one thing I
cannot
find anywhere is how to get the installation location at this point, for
instance if the user chooses to install to the E: drive or similiar
during
the install process, how would you then find the path the user chose?

The reason I want this path is because this application is a visual
studio
add-in and thus can't use System.IO.Directory.GetCurrentDirectory()
later
on,
yet I want to allow the user to choose where the files it uses should be
installed and be able to access those.

Any help is kindly appreciated,

Chad Smith.


Nov 22 '05 #4

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

Similar topics

2
by: Ralph | last post by:
I used to have Visual Basic .net std. 2003 installed on WinXP SP1A. But I found it too hard to upgrade WinXP to SP2. Now, I do have WinXP SP2 installed, but I am having problems installing...
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...
2
by: Chad Smith | last post by:
Hi, I have created a .NET deployment project in Visual Studio 2003. I have specified an entry point into my own code in this installer which launches into the familiar: public override void...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
4
by: Ronald S. Cook | last post by:
I created an MSI install for a Windows app I wrote. When installing, however, it defaults to install for "Just Me" instead of "Eveveryone" (meaning anyone who uses this computer). I would like...
3
by: Eric | last post by:
Using VS.Net 2003 .Net framework 1.1 SP1 Our installation project calls a Custom Action dll to perform post install actions. It fails if the .msi file is launch from a directory that contains...
3
by: Olav | last post by:
Hi all, I can not install CF 2.0 SP 1 on an Symbol PPT8800 running WinCE 4.2. The Install-Log say's cgacutil.exe failed with exit-code 80000004 and I get a messagebox indicating a support-Info...
5
by: =?Utf-8?B?U3B5a2U=?= | last post by:
I am having some trouble installing Zune for my Xbox360. I see that alot of people are having problems but I can seem to find a fix for me. I download Zune from the website, installs all the way...
4
by: Jim in Arizona | last post by:
Apparently, the FTB forum at http://freetextbox.com/forums/22/ShowForum.aspx isn't very active. I need some kind of text box control that allows formatting AND is free so I came across...
4
by: Amber | last post by:
The installer tells it faild to config db2inst1, the db2setup.err is as following: /usr/share/themes/Clearlooks/gtk-2.0/gtkrc:60: Engine "clearlooks" is unsupporte d, ignoring Jun 15, 2007...
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:
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
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.