HighTechTalks DotNet Forums  

ClickOnce Installation - Finding 'data' directory

Dotnet Framework microsoft.public.dotnet.framework


Discuss ClickOnce Installation - Finding 'data' directory in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jd
 
Posts: n/a

Default ClickOnce Installation - Finding 'data' directory - 10-26-2007 , 10:56 AM






Hi, we're trying to get to grips with using ClickOnce installers and
are having some problems. Once installed, the majority of the
application will reside in the following directory:

C:\Documents and Settings\<username>\Local Settings\Apps\2.0\<x>\<y>
\<z>

where <x>, <y> and <z> are seamingly random strings. The installation
also keeps some files in a 'data' directory:

C:\Documents and Settings\<username>\Local Settings\Apps\2.0\Data\<x>
\<y>\<z>\Data

where <x>, <y> and <z> are again, seamingly random strings, which
differ to the path to the executable.

Whilst it is possible to get the first path relatively easily from
looking up the current directory, I've not found a way to obtain the
path to the 'data' folder.

Whilst searching I found one recommendation which claimed one could
use the following:

(string)AppDomain.CurrentDomain.GetData("DataDirec tory")

However, this always appears to return null.

Can anyone shed any light on how one can obtain the data directory
path?

Many thanks in advance.

JD


Reply With Quote
  #2  
Old   
Mel
 
Posts: n/a

Default Re: ClickOnce Installation - Finding 'data' directory - 10-26-2007 , 01:53 PM






I use this with ClickOnce

using System.Deployment.Application;


public static string GetDataDirectory()
{
if (ApplicationDeployment.IsNotworkDeployed)
{
return ApplicationDeployment.CurrentDeployment.DataDirect ory;
}
else
Application.StartupPath;
}

"jd" <jdorrington (AT) hotmail (DOT) com> wrote

Quote:
Hi, we're trying to get to grips with using ClickOnce installers and
are having some problems. Once installed, the majority of the
application will reside in the following directory:

C:\Documents and Settings\<username>\Local Settings\Apps\2.0\<x>\<y
\<z

where <x>, <y> and <z> are seamingly random strings. The installation
also keeps some files in a 'data' directory:

C:\Documents and Settings\<username>\Local Settings\Apps\2.0\Data\<x
\<y>\<z>\Data

where <x>, <y> and <z> are again, seamingly random strings, which
differ to the path to the executable.

Whilst it is possible to get the first path relatively easily from
looking up the current directory, I've not found a way to obtain the
path to the 'data' folder.

Whilst searching I found one recommendation which claimed one could
use the following:

(string)AppDomain.CurrentDomain.GetData("DataDirec tory")

However, this always appears to return null.

Can anyone shed any light on how one can obtain the data directory
path?

Many thanks in advance.

JD




Reply With Quote
  #3  
Old   
Gigasoft
 
Posts: n/a

Default Re: ClickOnce Installation - Finding 'data' directory - 10-26-2007 , 04:18 PM



Hi,

I've heard this has been helpful learning about Click-Once.

http://www.code-magazine.com/Article...uickid=0611041

best regards,

Robert Dede
Gigasoft, Inc.
www.gigasoft.com



"jd" <jdorrington (AT) hotmail (DOT) com> wrote

Quote:
Hi, we're trying to get to grips with using ClickOnce installers and
are having some problems. Once installed, the majority of the
application will reside in the following directory:

C:\Documents and Settings\<username>\Local Settings\Apps\2.0\<x>\<y
\<z

where <x>, <y> and <z> are seamingly random strings. The installation
also keeps some files in a 'data' directory:

C:\Documents and Settings\<username>\Local Settings\Apps\2.0\Data\<x
\<y>\<z>\Data

where <x>, <y> and <z> are again, seamingly random strings, which
differ to the path to the executable.

Whilst it is possible to get the first path relatively easily from
looking up the current directory, I've not found a way to obtain the
path to the 'data' folder.

Whilst searching I found one recommendation which claimed one could
use the following:

(string)AppDomain.CurrentDomain.GetData("DataDirec tory")

However, this always appears to return null.

Can anyone shed any light on how one can obtain the data directory
path?

Many thanks in advance.

JD




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.