Application Data Folder

B

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
B

Bob

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]
- (e-mail address removed)


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
 
N

Nicholas Paldino [.NET/C# MVP]

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]
- (e-mail address removed)

Bob said:
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]
- (e-mail address removed)


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
 
B

Bob

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]
- (e-mail address removed)


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]
- (e-mail address removed)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top