Deployment Project Question

  • Thread starter Thread starter GG
  • Start date Start date
G

GG

VB.Net 2003 Standard:

I have a solution that contains 2 projects. Proj 'A' & Proj 'B'. Both are
stand alone executables that share a database. In the code of each project
how do should I reference this database? I have tried the
Application.CommonAppDataPath, UserAppDataPath, LocalUserAppDataPath,
ExecutablePath selections but they point to the individual projects. Do I
have to hardcode something?
I am looking for a way to reference the Db no matter where the apps are
installed. The install paths will be c:\Program Files\<solution name>\Proj
"A" and c:\Program Files\<solution name>\Proj "B". Under <solution name>
will be a folder called Data.

Thanks.
 
When dealing with filenames, '..' will get you the parent of the current folder, so given this structure

C:\Solutio
Dat
database.md
app
app1.ex
app
app2.ex

The path ..\Data\database2.mdb will point to the db when run from either app. That said, placing your connection string in a config file or some other location instead of directly in your executable will save you from a recompile if you decide your db should be located somewhere else

Charli
 
Thanks Charlie. This is just what I needed.

Charlie said:
When dealing with filenames, '..' will get you the parent of the current
folder, so given this structure:
C:\Solution
Data
database.mdb
app1
app1.exe
app2
app2.exe

The path ..\Data\database2.mdb will point to the db when run from either
app. That said, placing your connection string in a config file or some
other location instead of directly in your executable will save you from a
recompile if you decide your db should be located somewhere else.
 
I am trying to build a setup project and am stumped. My 2 apps are working
correctly as far as the paths are concerned. As stated below I want the
following outcome....

(a) InstallPath\"MyProj"\"MyApp Console"\"MyConsole.exe"
(b) InstallPath\"MyProj"\"MyApp Client"\"MyClient.exe"

Both apps share data from INstallPath\"MyProj"\"Data".

My setup projects build both (a) & (b) above as expected. How do I get the
data folder and accompanying files to reside under
InstallPath\"MyProj"\"Data" in the setup project? I'm thinking that I need
to create a third setup project just for the folder and files.

Am I heading in the right direction?

Thanks

GG
 
Try this,

Add a Merge Module Project for your data folder.
Add the Merge Module to both Setup projects.
 
Thanks David.

I have VB.net Standard and the merge is not included. Is there a way to
accomplish this in Standard VB?
 
Your original idea, to use 3 setups (and maybe tie them together with a
batch file or something) is probalby the best.

The reason is that if you duplicated stuff in both setups, i.e. the data,
the rules for what happens to the files in the data directory during
install and uninstall could cause unexpected and undesirable
overwrite/deleting behaviors!


---
David Guyer - VBQA Deployment Testing
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "GG" <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
References: <[email protected]>
 
Back
Top