How do I...

Got a problem you cannot solve? Try here.
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

How do I...

Post by [MS]Mark »

create a dialogue that will prompt for a folder location and use that location when setting up a ODBC DSN?

I've had a play around with the Enterprise edition but can't readiiy see how to get the path in the dialogue used when installing the ODBC DSN.

Sorting this out would help decided whether to recommend this installation product over a more expensive alternative which has a clear way of doing this...
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

First you need to use either a pre-built dialog (destination), or a custom made dialog, to capture the path you desire. Lets say you store that path in the variable TARGETDIR (this is the default behavior of destination).

Next, just use the Create ODBC DSN command, and in the attributes field, enter a line that reads like DBQ=[TARGETDIR]\\databasefile.dat

Hope this helps...
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

Post by [MS]Mark »

ah - I was trying to use my own-named variable rather than TARGETDIR and getting an error 2715 when testing...

how would that be possible? I.e. - have a text edit field which can be assigned to a variable?

---

edit: tried that and still get the 2715 error - debugging shows the right value going into the variable so not sure what's happening...
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

I looked up your error in MSDN, and it says:
2715 The specified File key ('[2]') not found in the File table.
I'm not sure if that helps you of course :) SDK Error messages can be cryptic at times. If you're having problems please send me your setup project (.mia and .mpr files) and I'll take a look at it for you. 8) [/quote]
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

Post by [MS]Mark »

hmm - seems the Create ODBC statement is still wanting to use my variable rather than [TARGETDIR]...

I'll have another look later - thanks for the help :)
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

Make sure you've rebuilt your setup.
Feel free to send me the script if you can't sort it out.
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

Post by [MS]Mark »

Something I've noticed is that I have a MSM module to install the db ODBC driver but can't see where that is being called in the script.

I have the VFPODBC.MSM module so that the appropiate Visual FoxPro driver can be installed. I am then setting up an ODBC DSN to use that driver. It seems that the driver isn't being installed which is causing the problem...

Do I need to do anything to actually install the MSM module or is that automatically processed? Or is the preferred method to install the ODBC driver? (Only using the VFPODBC.MSM as that ensures the correct versions of the files)

---

What files would you need to check out this?

I appreciate your help - this is the only thing holding back me recommending InstallAware as the install application to use...
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

Post by [MS]Mark »

[MS]Mark wrote:Do I need to do anything to actually install the MSM module or is that automatically processed?
Just noticed that it does get merged into the Windows Installer database - it showing to quickly for me to notice...
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

Yes, when you add a merge module to your project, it automatically gets included in the MSI file at build time. Your installation script does not explicitly "call" the MSM file.
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

Post by [MS]Mark »

got around the problem by adding the reg keys - still not sure why the Create ODBC bit doesn't work...
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

That is odd. If you send me your script, I'd be happy to take a look at it.
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

Post by [MS]Mark »

Sorted it now - the Create ODBC was in the wrong place so I moved it down to the [OFFLINE CONTENT] section and it works...

Thanks for the help :)
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

Ah, great!
[MS]Mark
Posts: 39
Joined: Mon Dec 06, 2004 9:11 am
Location: UK

Post by [MS]Mark »

Having problems (again)...

I have a PTShellTree and a Edit box. The PTShellTree recieves no information and writes data to variable ODBCLoc. The Edit recieves no information and writes data variable ODBCLoc as well.

When the PTShellTree directory changes, the Edit doesn't show this (where as it does if it's set to receive information from Installation Folder).

How do I have so that the Tree and Edit store the data into ODBCLoc and the edit is updated when the Tree changes? I'm just trying to replicate a Install Destination type dialgoue but don't won't the Install Destination as that won't be the same location as the ODBCLoc...

:)
sinan
Site Admin
Posts: 1037
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Post by sinan »

This is exactly why the "Receives Information" field exists. :D

Before you call the ODBC dialog, backup the TARGETDIR variable, and set it to the value of your ODBCLOC variable. Update your ODBC dialog so it receives info and writes to TARGETDIR. After the ODBC dialog returns, update set the ODBCLOC variable to the TARGETDIR variable, and restore the value of the TARGETDIR variable.
Post Reply