Link to home
Start Free TrialLog in
Avatar of Gene Moody
Gene MoodyFlag for United States of America

asked on

Where do (published) C# Apps go? Where do they live?

When you finish a project, and you set up that project to publish "offline", with no updates, as a CD Installation, it builds everything neatly into a folder (the one you provided to the system when setting everything up initially) - all ready to go.

(Note: I'm using the included Publisher with Visual Studio 2010 Ultimate, here - no additional third-party utilities are involved.  Yet.)

So you're on a target machine - one that's supposed to run this application "in the field".  You navigate to the [Publish] folder, and click [Setup].  Whammo!  The application starts!  And there, in the applications list, you can clearly see this solution of yours - the utility designed to save hours of time and improve productivity on the line.  It's apparently been successfully installed on your target machine.

But where is it?  In the good old days, these applications were installed to the [C:\Programs] folder (or whatever passed for it), and you could deal with them there.  But now...     ...where did/do these things go?

Reasoning: I have developed a suite of applications that (supposedly) work together, and they use a common configuration scheme.  So they seek a config file in the folder of the application --- only I can't seem to find it!  The Configuration Utility can't very well write out the config data for the suite of apps if it cannot find them, right?  And the apps, not having a default config file to start with, tell the end-user they need to run the Configuration Utility to get things started.  But the Configuration Utility cannot find the other applications, so it has no clue to where it should write out config files.  Frustrating.

Or am I going about this all wrong?  Not my first time trying to apply "old thinking" to the "new system" of doing things.  Anybody out there have any idea how I should approach this?  Or is it time to invest in a third-party installer, which I really have absolutely no desire to do...

Thanks (in advance) for your time and patience,

- The Lurking LongFist
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

1. to find files, you can use utility called Agent Ransack

2. when you find it, you will see that config file, most likely, is installed under user's %appdata%, i.e. application data folder. Today's best practices dictate that writable files are to be installed under %appdata%, not under %programfiles%.

Program files, in turn, have also become less trivial. Now it depends on whether the installation is per-machine or per user. To install per-machine, you need to be local administrator. If you are not, then the product will be installed under user's programs, which is special folder, individual for the user. So non-admin user can't affect other users on the machine, but at the same he can have his own applications.

All this, and much more, was done in order to provide more security.

Regarding common configuration scheme. In Visual studio, the common mechanism to manage settings is via My. object, i.e. My.Settings. These settings are stored in XML file, and are individual for each project. So there's no way to have common My.Settings for the whole solution.

What you can do:

1. store settings in the Registry.

2. - an add-on that implements per-solution settings.
Those 2 apps that need to share the same config, are they different installed in different publish?

If so, they will be in different directories and the clickonce installer will put them in a "random" generated folder in the users folder,appdata,net,etc..

If there is no commom database between them (to store it there), either store in registry as mentioned by vadimrapp1, or after install you force save the config in a specific folder (such as program files), and make both of them read from there.
Avatar of Gene Moody


Imagine constructing a suite of applications that all pertain to the same thing: AVR Coding and SOC Development.  Now, let's say you want these utilities to all "live" in the same folder, maybe in the [Program Files] or [Program Files (x86)] folder under [\Barghest\AVR-Tools\], right?  Based on the information you guys have revealed, that isn't quite possible under Visual Studio.

Yet it happens.  All the time.  If it didn't, there wouldn't be any [Program Files] or [Program Files (x86)] folders, now would there?  And the cute thing about it is that, once I've accomplished this feat, it will be a piece of cake for these utilities to share a config file - they just need a common location from which to share it.  I realize that under the current "extreme paranoia" method of internal security the average user won't be able to write to a text file in the [Program Files] or [Program Files (x86)] folders - but for organizational purposes this is a great start.  I can deal with that.

So I guess this question is less about "Where do they go?" and more about "How do I marshall them?" to the desired destination folder?  Or is that possible under the currently provided Dev Studio?  (Hey, somebody has figured it out - just look in your [Program Files] or [Program Files (x86)] folders for ample proof...
Avatar of TommySzalapski
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
...aaaaand *that* is exactly the response for which I was looking!  Excellent!  You see, after I shifted off to see what I could about installers, I discovered that I could, indeed, build an installer for this application suite by going to File ---> New Project ---> Other Project Types ---> Setup and Deployment ---> Visual Studio Installer: Setup Project (or CAB Project, or whatever I feel like suits this install best) and proceed from there to build an installation project for this suite of apps, by insisting on a common install folder.  This, combined with your solution ["...manually write the config file to %appdata%\Barghest\AVR-Tools\..."] is absolutely perfect!

Thank you, thank you, and Thank You!