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

Application Data Folder

Bob
Hi,
How do you get the application folder path that a user select in a msi
install which defaults to c:\Program Files\Company Name\...?

Thanks,
Bob
Feb 28 '08 #1
4 5179
Bob,

Are you doing this in a setup project (for the application you are
trying to find the folder for) or are you trying to do this for ^any^
application.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bob" <bs********@yahoo.comwrote in message
news:79**********************************@n77g2000 hse.googlegroups.com...
Hi,
How do you get the application folder path that a user select in a msi
install which defaults to c:\Program Files\Company Name\...?

Thanks,
Bob

Feb 28 '08 #2
Bob
On Feb 28, 10:07 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Bob,

Are you doing this in a setup project (for the application you are
trying to find the folder for) or are you trying to do this for ^any^
application.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Bob" <bshumsk...@yahoo.comwrote in message

news:79**********************************@n77g2000 hse.googlegroups.com...
Hi,
How do you get the application folder path that a user select in a msi
install which defaults to c:\Program Files\Company Name\...?
Thanks,
Bob
In my setup (msi) I copy some files to the location that the user
specifies for the application folder. I need to access those files at
runtime. I am currently using
System.Windows.Forms.Application.StartupPath but I think this will
break if the user moves the exe.

Thanks,
Andrew
Feb 28 '08 #3
Bob,

If the person removes the EXE from the folder, then they have broken
your product, IMO. If they move the EXE, then I would expect the EXE to
look in its location to find the files, and fail because it can't find them.

The files are read-only, right? Not everyone will have access to the
Program Files directory for writing. If you need to write to these files,
then you might want to consider placing them in the application data
directory.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bob" <bs********@yahoo.comwrote in message
news:78**********************************@d21g2000 prf.googlegroups.com...
On Feb 28, 10:07 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
>Bob,

Are you doing this in a setup project (for the application you are
trying to find the folder for) or are you trying to do this for ^any^
application.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Bob" <bshumsk...@yahoo.comwrote in message

news:79**********************************@n77g200 0hse.googlegroups.com...
Hi,
How do you get the application folder path that a user select in a msi
install which defaults to c:\Program Files\Company Name\...?
Thanks,
Bob

In my setup (msi) I copy some files to the location that the user
specifies for the application folder. I need to access those files at
runtime. I am currently using
System.Windows.Forms.Application.StartupPath but I think this will
break if the user moves the exe.

Thanks,
Andrew

Feb 28 '08 #4
Bob
On Feb 28, 2:58 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Bob,

If the person removes the EXE from the folder, then they have broken
your product, IMO. If they move the EXE, then I would expect the EXE to
look in its location to find the files, and fail because it can't find them.

The files are read-only, right? Not everyone will have access to the
Program Files directory for writing. If you need to write to these files,
then you might want to consider placing them in the application data
directory.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"Bob" <bshumsk...@yahoo.comwrote in message

news:78**********************************@d21g2000 prf.googlegroups.com...
On Feb 28, 10:07 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Bob,
Are you doing this in a setup project (for the application you are
trying to find the folder for) or are you trying to do this for ^any^
application.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Bob" <bshumsk...@yahoo.comwrote in message
>news:79**********************************@n77g200 0hse.googlegroups.com...
Hi,
How do you get the application folder path that a user select in a msi
install which defaults to c:\Program Files\Company Name\...?
Thanks,
Bob
In my setup (msi) I copy some files to the location that the user
specifies for the application folder. I need to access those files at
runtime. I am currently using
System.Windows.Forms.Application.StartupPath but I think this will
break if the user moves the exe.
Thanks,
Andrew
Thanks, that is a good point. The files are read/write. The App Data
Directory seems to work well although it doesn't seem to delete when I
uninstall the program even though i have set permanent to false.
Also, I get a bunch of compiler warnings "should not be installed into
a User's Profile folder because it may not be available to all
users". Is there any alternative location like a global Data
Directory that I could use. I would prefer all users to share the
same set of files.
Feb 28 '08 #5

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

Similar topics

2
by: Tim Failes | last post by:
Our application needs to write some application specific data, but I have not been able to find the recommended method to obtain the correct pathname. I have found many references to the...
13
by: Dennis C. Drumm | last post by:
I use the Documents and Settings\All Users\Application Data\AppName folder to store xml settings that are applicable to all user who log onto a machine. (The uers personal settings associated with...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
0
by: steve | last post by:
I am using vb.net 2005 Express Edition. Application Settings would be a very useful thing, as a global program database that persists; if only it would work! Does anyone know a hack or a...
2
by: Bill Fallon | last post by:
I have a VS2005 VB.Net windows form application deployed to a share drive. The windows explorer security permissions for this application (.exe) file is set for Everyone with List Folder/Read Data...
4
by: - HAL9000 | last post by:
When un-installing an application... Is it normal practice to write a special program that erases all the files and folders for all the users of an application that reads and writes to...
5
by: =?Utf-8?B?VHJhY2tz?= | last post by:
I include some sample binary data files (produced by my software) with my application installation for the user to do what they want with. I put the files in the Users Personal Data...
1
by: =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?= | last post by:
For in-house tools, the approach of writing to the program files folder is fine. Here are a few ways that it can be problematic if the code goes out of your team, such as to a customer: 1....
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.