How do i specify the "working directory" for shortcuts in Visual Studio Installer

Posted on 2003-03-12
Medium Priority
Last Modified: 2012-06-21
The problem is when my exe tries to run, it cannot find my mdb file. I want to be able to add the app path in the shortcut's "Start In .." field (which is set to blank by Visual Studio Installer).
Question by:mixally
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
  • 2
LVL 11

Expert Comment

ID: 8123347
two things.  One, you start your project in VB within the project folder. (i.e. you double click on the project file in explorer).  But I am not sure whether this will slove the problem.

Other option, which will work is to use App.Path along with your database name.  e.g.

Const DB_NAME = "MyDB.mdb"

Private DbPath as string

Private Sub OpenDBs()
    DBPath = app.Path
    if (Right(DBPath,1) = "\") then
        DBPath = DBPath & DB_NAME
        DBPath = DBPath & "\" & DB_NAME
    End if
End Sub

Good Luck!

Expert Comment

ID: 8124480
Here is a rule for file names and paths that if followed,
should solve your problems:

1. Drive Letters Should be a String * 2
   This allows for a: --> z:
   This also allows a verification of a UNC that starts
   as a "\\"

2. Paths contain Drive letters (or UNCs).
3. Paths should ALWAYS contain a trailing "\"
   IF you are unsure of whether a backslash is there,
   CALL the AddDirSep routine (See Below).

4. File Names are just that. File Names.
   You could use a CONST as suggested in previous example.

5. The concatenation of a PATH + FILE NAME is valid.


Public Sub AddDirSep (ByRef xsPath as string)

   If Right$(xsPath,1) <> "\" then
      xsPath = xsPath & "\"
   End If

End Sub


If you are still having problems, they may be related
to whether you are running in design-mode / "VB" or
running "real-time" compiled EXE.


Author Comment

ID: 8125704
is this code i can type in visual studio installer?? how do i access the editor ?

Accepted Solution

JRCSystems earned 150 total points
ID: 8127622
Ahhhhhhhhhhh! Now I see your problem.

Verify the installation setup to make sure you are not doing anything "weird". (sorry).

But when a normal installation program installs an program-link to an executuable, the "START IN" path is automatically setup to the installation directory.

If it is BLANK, somehow, you are overriding it.

Try a quick-and-simply setup, and don't make any changes to it... the "START IN" path should be filled in.

Author Comment

ID: 8129570
the START IN still doesnt get filled in. let me tell you the steps i took to create the msi file:
    Micrososoft Visual Studio 6.0->
      Microsoft Visual Studio 6.0 Enterprise Tools->
        Visual Studio Installer

From here, in the New tab, I have Visual Studio Installer Projects folder selected (top left window)
At the bottom, the Name is: VBInstaller1
Below that in the Location I have: C:\Documents and Settings\Administrator\Desktop\VBInstaller1
I then proceed to the Visual Basic Installer icon on the right and double click it...

This presents me with a wizard. I click Browse and point to my vbp file and leave the preseleced radio selection of 'Create Installer'..then i click Finish.

Next, from the Project menu, I click Add File and select TAC.MDB which the executable needs as its database. This
adds the file to the Project explorer.
Next, I delete msado25.tlb from my project explorer since
this seems to crash when i run the installer. I dont
know how to fix this :(
Finally, i choose Build from the Build menu and this
creates a folder on my desktop called VBInstaller1.
Within that, is a folder called Output with some other files. In the Output folder i go to DISK_1 and within that
I get my msi file. When i try to install it (using defaults, nothing fancy), it adds a shortcut to my start menu but when i click the start menu item, i get the error:  "Could not find TAC.mdb"

Hope this makes sense

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

752 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