Solved

Finding a file (or the Install Directory that has the file)

Posted on 2008-10-09
3
216 Views
Last Modified: 2010-04-21
I need to programmatically replace a file installed by Firebird after its been installed. The file is aliases.conf.
Now, I could ask the user to "Navigate" to the Firebird install directory, but if there's a more professional way then I should do that...

One option is to find the install directory of Firebird - where would this information be registered - KEEPING IN MIND VISTA

Another option is to search for it in Program Files - but this is very silly - surely there's a better way.
0
Comment
Question by:rfwoolf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 22684831
Create your own install program
and ask your users to run that first
if they can run the Firebird, they sure can run your installer too

Normally install directories are put in the registry under
HKEY_LOCAL_MACHINE/Software/"Software Vendor"
Where "Software Vendor" is Firebird / Intrbase / Borland etc.
I dont have Firebird, only interbase
and for Interbase it's

HKEY_LOCAL_MACHINE/Software/Interbase Corp/Interbase/CurrentVersion
it's in the RootDirectory item

Put the procedure in your installer
If the file would be in use allready when your installer runs
you could use  MoveFileEx
BOOL MoveFileEx(

    LPCTSTR lpExistingFileName,      // address of name of the existing file  
    LPCTSTR lpNewFileName,      // address of new name for the file
    DWORD dwFlags       // flag to determine how to move file
   );      
 
with dwFlags set to
MOVEFILE_DELAY_UNTIL_REBOOT      
Windows NT only: The function does not move the file until the operating system is restarted. The system moves the file immediately after AUTOCHK is executed, but before creating any paging files. Consequently, this parameter enables the function to delete paging files from previous startups.
0
 
LVL 13

Author Comment

by:rfwoolf
ID: 22686196
Interesting...  Thanks for that Geert - with the registry values - does this work on Vista too? (I guess I should do some Vista testing)
I did manage to find a crappy workaround - by installing a utility called Firebird Database Manager - it has a utility that can set up Aliases - and it somehow knows where the aliases.conf file is.
0
 
LVL 13

Author Closing Comment

by:rfwoolf
ID: 31504907
Still would like to know how this works in Vista
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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