Solved

Installing apps:  Best place for system files

Posted on 1999-01-08
5
147 Views
Last Modified: 2010-05-03
Hey all,

I haven't done much Windows programming and want to know y'all's thoughts on where to install system files that support a VB application.  In the past, I installed them in the application directory so I wouldn't overwrite existing versions in the system directory and perhaps become the source of error for other applications.  However, at times this led to problems when a user would launch my app with the Windows system version of a dll already in memory that was not compatible with the one I needed.  This, of course, also made it look like the app wasn't working right.

So...do y'all recommend that I install system files to the app directory or Windows\system?

Thanks for your thoughts in advance.
0
Comment
Question by:iw
5 Comments
 
LVL 1

Accepted Solution

by:
bear454 earned 50 total points
ID: 1454951
Windows\System, with version checking. Most setup programs will help you handle this.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 1454952
Bear is probably right, if done correctly this is the best place for them, as it keeps your users from installing multiple copies of the same dll's in every application directory.  

I don't know how much flexibility your install program will allow, but it is ideal if it is smart enough to update an older version of a dll with a newer one - while saving the old version in a backup directory.   Because, while your newly installed app will run fine, you may have just blown some other app out of the water.  

Alternatively, you could install only the conflicting DLL's in the application directory, and let the user know if they have a problem running the app to (unfortunately) exit windows and re-enter, then run your app.  

There is also another alternative to explore and that is a product called DLLagator.  I forget the company name, but they produce a product that will allow two copies of a DLL with the same name, different versions to be loaded into memory at the same time.  They also give you the ability to unload a DLL from memory without exiting Windows.  Their tool is also just great to have to monitor which applications load which DLLs and which versions.  It's a good tool for any developer to have if they are having DLL conflicts, though it may be hard to set it up to run transparently on your clients.

MD
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1454953
The setup wizard that comes with VB does a good job of keeping things straight. It won't overwrite newer versions of .DLL files and puts the app .EXE off in \Program Files\appname. Other files that you include will also be placed here.

The generated SETUP.LST file has pointers telling it where to install. Is easy to modify if you don't like defaults.

M

0
 
LVL 3

Expert Comment

by:traygreen
ID: 1454954
Better yet - You can put the DLL's in windows\system < or system32>\<appname> folder
0
 

Author Comment

by:iw
ID: 1454955
Thanks for the comments everyone.  Yes, I thought the best place is the system or system32 directory, but as most of you have said, I should make sure that I don't install over a more recent version of a dll.  I've run into the risk of doing this in the past when I have installed a new version but another app needs the older version of the dll (dll's are not always backward compatible!), and have gotten around it by then installing my newer version in my app directory instead of the systems directory!

I appreciate everyone's comments!  I guess the short answer is that there is no best place to install system files, but that the system directory will likely cause the least number of problems.

Thanks again,

iw
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now